%%HP: T(3)A(D)F(.);
@ Directory DCV1 - Data Card Viewer 1
@     The basic concept here is that pages (cards) of text can
@       nicely be stored and viewed on the 48.  This is useful
@       for relatively static data.
@     The basic data object would contain a string with up to 6 embedded
@       newline characters and up to 22 characters between the newlines.
@       The Disp function will display this on the 7 line by 22 character
@       screen.  Printing is optional.  A more complex data object would
@       be a list of the basic strings.
@     If there are more than 7 lines, the display cleanly shows the first
@       7, while the printer shows all lines.  If there are more than 22 
@       characters on a line, the display shows 21 and ellipsis, while
@       the printer shows more (although subject to wrap or truncation).
@     Timing on a list is about  0.05 seconds per item.
@ RBJ 5/15/90  Based on ideas from Bill Quinlan
@     5/16/90  Revised list loop from FOR NEXT to WHILE REPEAT 

DIR
  Disp \<< 
    IF DEPTH                                @ Process if something on stack
    THEN
      CLLCD 
      IF DUP TYPE 5 ==                      @ If a list
      THEN DUP SIZE 1 +                     @ Get SIZE (+1 for loop)
        \-> lis n \<<                       @ Empty Lists OK Here
          WHILE 'n' DECR                    @ Decrementing Loop n to 1  
          REPEAT lis n GET                  @ GET the Nth item
          END                               @ We will now have the equivalent
        \>>                                 @ of LIST-> DROP, but in reverse
      END                                   @ (desired) order.
      IF 9 FS? THEN PR1 END                 @ Optional Print
      1 DISP 3 FREEZE                       @ Display
    END 
  \>>

  SAMP  {                                   @ A 2 page object
"FBI     312 431-1333
SecServ 312 353-5431
CGuard  312 353-0278
Police  911
More.."
"For a good time call
Joan 101 555-1234"
}

END

