Article 5696 of comp.sys.handhelds:
Path: en.ecn.purdue.edu!noose.ecn.purdue.edu!samsung!usc!wuarchive!psuvax1!rutgers!maverick.ksu.ksu.edu!uafhp!engr.uark.edu!dhe
From: dhe@engr.uark.edu (David Ewing)
Newsgroups: comp.sys.handhelds
Subject: HP48SX PROGRAM: TEXTVIEW
Keywords: Nice Text Utility
Message-ID: <6260@uafhp.uark.edu>
Date: 9 Apr 91 00:48:29 GMT
Sender: netnews@uafhp.uark.edu
Lines: 153


HP48sx Program : TEXTVIEW
---------------------------------------------------------------------

Ever wished for a better way to view a large text string containing 
new lines as if it was a 'text document'?  Well, this program may be 
what you've been looking for.

TEXTVIEW: A String viewing utility.

   TEXTVIEW requires string that you wish to view on the stack - 
an error message will be displayed otherwise.  The string may contain 
any number of new line characters (which of course indicate the end of 
a line) and any number of characters per line (within memory limits), 
but only 32 characters can be displayed per line.

   Once TEXTVIEW is started it will analyze the string for lines, 
the results of which are briefly displayed on the top line along with 
the string size.  After all the program initialization is complete, 
which will depend on the string size, the screen will display the first 
ten lines using the smallest text font; the smallest font is used to 
display the most on the screen at once, however the only drawback is 
that all the characters are displayed only in upper case.  Six keys on 
the keyboard now become active at this point:

 Arrow up             :  Up one page   (if not at the beginning)
 Arrow down           :  Down one page (if not at the end)
 Arrow left           :  Top of string/document
 Arrow right          :  Bottom of string/document
 Enter                :  Exit TEXTVIEW program
 Blue/Right-Shift On  :  Turns off Calculator -Pressing ON resumes.

     (Pressing any other key simply refreshes the screen just
      to let you know that the HP really felt you press a
      mostly-dead key :-)

As always in RPL programs, ON is active - but not really recommended as 
an exit since it will leave one or two objects of its own on the stack.
TEXTVIEW will also not erase anything that was previously on the stack
besides the object that you wished to view.


     VERY QUICK OPERATION SUMMARY:
--------------------------------------
On Stack Level 1:  A string   (e.g. "This is a string
                                     with a line-feed in it")
Press the TEXTVIEW menu key or type 'TEXTVIEW'.
Arrow keys acts as page up and down, and ENTER quits


     TO INSTALL:
---------------------
   Simply strip off all this documentation until only the program
remains, then set the HP48 for a ASC transfer with translate code
3 set, and finally send it to the calculator.   I recommend putting
it in the HOME directory so that it is available anywhere in the
directory structure.


     COMING SOON (probably after this post!)
----------------------------------------------
     TCAT: A text string catalog program; Nice User interface for
           navigating directories and selecting a string variable 
	   to view using this TEXTVIEW program.

#include <disclaimer.h>
  "...this program shouldn't in anyway damage data, and if it does
   I can't be held responsible - blame some other program...."  :-)

        -David

==============================================================================
 dhe@engr.uark.edu                        David Ewing, University of Arkansas
 dewing@uafhp.uark.edu                        Computer Science Engineering

Ensign, if you encounter any holes...steer clear.
    -- Riker to Wesley, "Where Silence Has Lease",
        stardate 42193.6
==============================================================================

--------------------->Cut Here and Download to HP<-------------------
%%HP: T(3)A(D)F(.);
\<< 0 1 1 1 1 0 \-> S a
b c l m
  \<< CLLCD ERASE DUP
TYPE
    IF 2 \=/
    THEN DROP
"Invalid Object Type"
DOERR
    END 'S' STO S
"
" + 'S' STO S
SIZE 'l' STO
"Size:" l \->STR + 1
DISP
    WHILE S "
" POS
DUP 'b' STO 0 >
    REPEAT S c b 1
- SUB S b 1 + l SUB
'S' STO 'm' 1 STO+
    END "Lines:" m
\->STR + 2 DISP m
\->LIST 'S' STO 0 'l'
STO
    DO 1 l + m l -
10 MIN l +
      FOR a S a GET
1 \->GROB PICT SWAP a
1 + 'b' STO # 0d a
l - 1 - 6 * R\->B 2
\->LIST SWAP REPL
      NEXT { # 0d
# 0d } PVIEW 0 WAIT
DUP { 25.1 35.1
34.1 91.3 36.1 51.1
} SWAP POS DUP
      IF 0 \=/
      THEN ERASE {
        \<<
          IF l 0 >
          THEN 'l'
10 STO-
          END
        \>>
        \<<
          IF l m 1
- 10 / IP 10 * <
          THEN 'l'
10 STO+
          END
        \>>
        \<< 0 'l' STO
        \>>
        \<< OFF
        \>>
        \<<
          WHILE l m
1 - 10 / IP 10 * <
          REPEAT 1
'l' STO+
          END
        \>>
        \<<
        \>> } SWAP
GET EVAL
      ELSE DROP
      END
    UNTIL 51.1 ==
    END
  \>>
\>>


Article 5697 of comp.sys.handhelds:
Path: en.ecn.purdue.edu!noose.ecn.purdue.edu!samsung!usc!wuarchive!psuvax1!rutgers!maverick.ksu.ksu.edu!uafhp!engr.uark.edu!dhe
From: dhe@engr.uark.edu (David Ewing)
Newsgroups: comp.sys.handhelds
Subject: HP48SX PROGRAM: TCAT
Keywords: String Catalog Utility for TEXTVIEW
Message-ID: <6261@uafhp.uark.edu>
Date: 9 Apr 91 00:50:32 GMT
Sender: netnews@uafhp.uark.edu
Lines: 268


HP48sx Program : TCAT
---------------------------------------------------------------------

TCAT: A String Catalog designed to work with TEXTVIEW.

   This is the String Catalog Program mentioned in the previous post.
It has been modeled somewhat from the Equation Card Catalog program.

   To install this, follow the directions below.  Once TCAT has been 
installed and started, it searches for the variable TCATPATH which 
should contain the directory path where you want TCAT to start
in.  If TCAT is unable to locate TCATPATH, then it will start in
the current directory.  After this point it searches all variables
types in the directory for string variables and directory variable, 
and will display the results:  The first line will be the parent 
directory (or a null path if the current directory is HOME), then 
all directories are listed, and finally all string variables.   The 
directories are indicated by a folder icon in front of the name, 
and when one is selected, the current directory is changed and 
the catalog is updated for the new directory.  If the total number of 
directories and string variables exceed the number of lines that 
can be displayed at once, an arrow will appear on the lower-right side 
indicating that more items exist.   Finally a menu item will appear 
above the 'F' key for exiting TCAT, and the following keys will 
become active:
  
 Arrow up             :  Up one line   (if not at the top)
 Arrow down           :  Down one line (if not at the bottom)
 Blue/Right-Shift up  :  Top of string list
 Blue/Right-Shift down:  Bottom of string list
 Enter                :  Select String to view or directory to enter
 Blue/Right-Shift On  :  Turns off Calculator -Pressing ON resumes.
 F (or Exit)          :  Exit TCAT

             (Pressing any other key is mostly pointless)

During the program, the up/down arrows will indicate whether
there are items above or below the page displayed on the screen.  The
inverted line is, of course, the item that will be selected if ENTER is
pressed.  To exit at any point, press the F key, and HP will return
to the directory and status it was before TCAT was started.   

 As always in RPL programs, ON is active - but not really recommended as 
an exit since it will leave one or two objects of its own on the stack.
TEXTVIEW will also not erase anything that was previously on the stack
besides the object that you wished to view.


     VERY QUICK OPERATION SUMMARY:
--------------------------------------
Nothing required on the stack
Press the TCAT menu key
Arrow keys acts as page up and down, ENTER selects item, and F exits.


     TO INSTALL:
---------------------
   Simply strip off all this documentation until only the program
remains, then set the HP48 for a ASC transfer with translate code
3, and finally send it to the calculator.   I recommend putting 
TCAT in the HOME directory along with the TEXTVIEW program so 
that it is available anywhere in the directory structure.  Matter of
fact, TCAT REQUIRES that TEXTVIEW be in the HOME directory to work
fully - otherwise TCAT will probably die when a string is selected.   
The optional variable 'TCATPATH' should also be put in the HOME 
directory where TCAT can find it - TCATPATH is provided only
as a convenience and is not required for the program to run properly.
( if you do use TCATPATH, here's an example PATH stored in 
 TCATPATH: {HOME TXT} )

#include <disclaimer.h>
  "...this program shouldn't in anyway damage data, and if it does
   I can't be held responsible - blame some other program...."  :-)

        -David

==============================================================================
 dhe@engr.uark.edu                        David Ewing, University of Arkansas
 dewing@uafhp.uark.edu                        Computer Science Engineering

Data, I would like to have been consulted.
I have not observed anyone else on board consulting you about their
  procreation, Captain.
    -- Picard and Data, "The Offspring", stardate 43657.0
==============================================================================

--------------------->Cut Here and Download to HP<-------------------

%%HP: T(3)A(D)F(.);
\<< 0 1 0 0 1 { } { }
{ } # 117d # 8d
BLANK NEG
GROB 8 6 6090171818FF
0 \-> a b o n p l d g
s f z
  \<< PATH 'TCATPATH'
VTYPE
    IF 5 ==
    THEN TCATPATH
EVAL
    END
    DO VARS OBJ\->
DUP
      IF 0 >
      THEN 1 SWAP
        START DUP
VTYPE
          IF 2 ==
          THEN DUP
l SWAP + 'l' STO
'a' INCR DROP \->STR
DUP SIZE 2 SWAP 1 -
SUB 2 \->GROB g SWAP
+ 'g' STO
          ELSE DUP
VTYPE
            IF 15
==
            THEN
DUP d + 'd' STO 'b'
INCR DROP \->STR DUP
SIZE 2 SWAP 1 - SUB
2 \->GROB g + 'g' STO
            ELSE
DROP
            END
          END
        NEXT
      END PATH OBJ\->
1 - SWAP DROP \->LIST
\->STR 2 \->GROB g +
'g' STO
      DO # 131d
# 64d BLANK PICT
STO n 1 + a b + n 8
+ MIN
        FOR o PICT
# 8d o n 1 + - 8 *
R\->B 2 \->LIST g o GET
GOR
          IF o b \<=
          THEN PICT
# 0d o n 1 + - 8 *
R\->B 2 \->LIST f GOR
          END
          IF p n +
o ==
          THEN PICT
# 0d o n 1 + - 8 *
R\->B 2 \->LIST s GXOR
          END
        NEXT PICT {
# 123d # 45d }
        IF a b + n
- 6 >
        THEN
GROB 7 10 C141414141773663C180
        ELSE # 7d
# 10d BLANK
        END REPL
PICT { # 117d # 57d
}
GROB 14 7 FFF39A22DA639D63DA639A63FFF3
REPL PICT { # 123d
# 0d }
        IF n 0 >
        THEN
GROB 7 10 80C163367741414141C1
        ELSE # 7d
# 10d BLANK
        END REPL 0
'z' STO
        DO { # 0d
# 0d } PVIEW 7
FREEZE 0 WAIT DUP {
16.1 35.1 25.1 25.3
35.3 91.3 } SWAP
POS DUP PICT # 0d p
1 - 8 * R\->B 2 \->LIST
s GXOR
          IF 0 \=/
          THEN {
            \<< 2 'z'
STO
            \>>
            \<<
              IF n
a b + < p 8 == AND
              THEN
'n' 8 STO+ 1 'p'
STO 1 'z' STO
              ELSE
IF p n + a b + n 8
+ MIN <
THEN 'p' INCR DROP
END
              END
            \>>
            \<<
              IF n
0 > p 1 == AND
              THEN
'n' 8 STO- 8 'p'
STO 1 'z' STO
              ELSE
IF p 1 >
THEN 'p' DECR DROP
END
              END
            \>>
            \<<
              IF n
0 >
              THEN
'n' 8 STO- 1 'z'
STO
              END 1
'p' STO
            \>>
            \<< a b +
'p' STO
              WHILE
p 8 >
              REPEAT
'n' 8 STO+ 'p' 8
STO- 1 'z' STO
              END
            \>>
            \<< OFF
            \>> }
SWAP GET EVAL
          ELSE DROP
          END PICT
# 0d p 1 - 8 * R\->B
2 \->LIST s GXOR
        UNTIL 51.1
== z 0 \=/ OR
        END TEXT
CLLCD
        IF z 0 ==
        THEN
          IF p n +
b >
          THEN l p
b - n + GET RCL
TEXT TEXTVIEW ERASE
          ELSE
            IF p n
+ 1 >
            THEN d
p n + 1 - GET EVAL
            ELSE
UPDIR
            END
          END
        END
      UNTIL p n + b
\<= z 2 == OR
      END 1 'b' STO
0 'a' STO { } 'd'
STO { } 'l' STO { }
'g' STO 1 0 'n' STO
'p' STO
    UNTIL z 2 ==
    END EVAL
  \>>
\>>


