From helens!shelby!bloom-beacon!snorkelwacker!usc!ucsd!ucbvax!ndsuhp.UUCP!hernes Mon May 14 22:10:09 PDT 1990
Status: RO

Article 1627 of comp.sys.handhelds:
Path: helens!shelby!bloom-beacon!snorkelwacker!usc!ucsd!ucbvax!ndsuhp.UUCP!hernes
>From: hernes@ndsuhp.UUCP
Newsgroups: comp.sys.handhelds
Subject: String catalog for the Hewlett Packard HP-48SX
Message-ID: <9005142325.AA27038@plains.NoDak.edu>
Date: 14 May 90 23:25:35 GMT
Sender: daemon@ucbvax.BERKELEY.EDU
Distribution: inet
Organization: The Internet
Lines: 292

Hi guys,

The following set of programs simulate the hp-48sx's catalog function for
strings.  The main program is 'CAT' which I have bound to
user-blue-shift-9. 'CAT' figures out which varibles in the current directory
contain strings, then forms a catalog-look-alike menu of them.  There could
be several options added, if you have any ideas that you think are real
stud, (regarding Less/CAT) send me mail.

The keys used for 'CAT' are the up and down arrows, blue-shift-up and -down
arrows, and the menu keys.

'Less', is basically the same program with several
added key-bindings.  The keys are as follows:

Page down: B, spc

Page up: C

Line down: D, Q, ENTER

Line up: E, K

Quit: F

Off: blue-shift-on

End of string: blue-shift-Q, blue-shift-B

Begining of string: blue-shift-K, blue-shift-C

Repeat previous command: .

Extended Command: A 
(Not yet implemented)


---------------directory-starts-here-----------------
%%HP: T(3)A(D)F(.);
DIR
  CAT
    \<< STRINGS     @ this string contains 5 new-lines
"




" 3 DISP 1 1
RCLMENU RCLF \-> b c
d men flag
      \<< 62 SF {
Less QUIT NEW PURGE
} TMENU
        WHILE 62
FS?
        REPEAT
          IF b SIZE
          THEN c b
SIZE OVER 4 + MIN
            FOR x x
d SAME "\|>" " " IFTE
b x GET + x c - 3 +
DISP
            NEXT -1
WAIT
            CASE
DUP 11.1 SAME
              THEN
DROP b d GET OBJ\->
LCD\-> \-> e
\<< Less e \->LCD
\>> { Less QUIT NEW
PURGE } TMENU
              END
DUP 25.1 SAME
              THEN
DROP d DUP 1 > -
'd' STO c d OVER <
- 'c' STO
              END
DUP 13.1 SAME
              THEN
DROP
IF DUP TYPE 2 SAME
THEN
"Name the string,
Press ENTER."
{ \Ga V } INPUT OBJ\->
STO STRINGS 'b' STO
1 'c' STO 1 'd' STO
END
              END
DUP 14.1 SAME
              THEN
"'" b d GET + OBJ\->
PURGE STRINGS 'b'
STO 1 'c' STO 1 'd'
STO
              END
DUP 35.1 SAME
              THEN
DROP d b SIZE OVER
> + 'd' STO c d
OVER 4 + > + 'c'
STO
              END
DUP 12.1 SAME
              THEN
DROP 62 CF
              END
DUP 25.3 SAME
              THEN
DROP 1 1 'c' STO
'd' STO
              END
DUP 35.3 SAME
              THEN
b SIZE DUP 'd' STO
4 - 1 MAX 'c' STO
              END
91.3 SAME
              THEN
OFF
              END
            END
          ELSE 62
CF
          END
        END men
MENU flag STOF
      \>>
    \>>
  STRINGS
    \<< VARS \-> a
      \<< { } 1 a
SIZE
        FOR x a x
GET DUP VTYPE
          IF 2 SAME
          THEN +
          ELSE DROP
          END
        NEXT OBJ\->
DUP
        IF
        THEN 1 SWAP
DUP \-> a
          \<<
            START
\->STR DUP SIZE 1 - 2
SWAP SUB a ROLL
            NEXT a
\->LIST
          \>>
        ELSE DROP {
}
        END
      \>>
    \>>
  Less
    \<< SPLIT DEPTH
\->LIST 1 RCLMENU
RCLF 12.1 \-> A L men
FLAG X
      \<< 64 SF 63
-49 -50 CF CF SF
-40 CF
        WHILE 64
FS?
        REPEAT
          IF 63 FS?
          THEN A L
LL L 6 + A SIZE /
100 * IP DUP 100 <
SWAP \->STR "%" +
"END" IFTE { "P\|v"
"P\|^" "\|v" "\|^" "QUIT"
} + TMENU 63 CF
          END -1
WAIT
          IF DUP
93.1 SAME
          THEN DROP
X
          END
          CASE DUP
11.1 SAME
            THEN
'X' STO "Command?"
{ ":" 2 ALG \Ga }
INPUT
            END DUP
12.1 SAME OVER 94.1
SAME OR
            THEN
'X' STO L DUP 7 + A
SIZE < 7 * + 'L'
STO 63 SF
            END DUP
13.1 SAME
            THEN
'X' STO L 7 - DUP 1
\>= SWAP 1 IFTE 'L'
STO 63 SF
            END DUP
14.1 SAME OVER 35.1
SAME OR OVER 51.1
SAME OR
            THEN
'X' STO L DUP 1 + A
SIZE < + 'L' STO 63
SF
            END DUP
15.1 SAME OVER 25.1
SAME OR
            THEN
'X' STO L DUP 1 - 0
> - 'L' STO 63 SF
            END DUP
16.1 SAME
            THEN
DROP 64 CF
            END DUP
12.3 SAME OVER 35.3
SAME OR
            THEN
'X' STO A SIZE 6 -
'L' STO 63 SF
            END DUP
13.3 SAME OVER 25.3
SAME OR
            THEN
'X' STO 1 'L' STO
63 SF
            END DUP
91.3 SAME
            THEN
'X' STO OFF
            END
          END
        END FLAG
STOF men MENU
      \>>
    \>>
  LL
    \<< DUP 7 + SUB 1
7
      FOR ln DUP ln
        IFERR GET
        THEN DROP
DROP "~"
        END ln DISP
      NEXT DROP
    \>>
  STR\->GROB
    \<< SPLIT DEPTH
\->LIST \-> A
      \<< # 83h A
SIZE 8 * R\->B BLANK
A 1 SWAP SIZE
        FOR I A I
GET 2 \->GROB # 0h I
1 - 8 * R\->B 2 \->LIST
SWAP GOR
        NEXT
      \>>
    \>>
  SPLIT
    \<<
      WHILE DUP
SIZE 22 > OVER "
"
POS OR
      REPEAT DUP
"
" POS DUP DUP
        IF 22 < AND
        THEN OVER
SWAP 1 SWAP DUP 4
ROLLD 1 - SUB 3
ROLLD 1 + OVER SIZE
SUB
        ELSE DROP
DUP 1 22 SUB SWAP
23 OVER SIZE SUB
        END
      END DUP "" ==
      IF
      THEN DROP
      END
    \>>
END


