<pre>
DIR
@ StenoPad, 1.2a
@
@ This is a bug-fix version of 1.2; note that in this version,
@ all data files must now be in the subdirectory called 'data'.
@ StenoPad is freely distributable and modifiable,
@ so long as no fee is charged for either.
@ Copyright 1996, Michael Heinz
STENO
@ The main program.
@ #FB1Ah 491
½ DATA @ Change to data sub-directory
RCLF -40 CF @ Save the current flags, turn off the clock display.
RCLMENU @ Save the current menu.
DRCL SIZE 1 ì Äsize Äoffset @ Initialize the list size and offset variables.
½
DO INDEX wait
{
½ DUP MAP DUP { DRCL SWAP GET SHW } { DROP EBP } IFTE ╗
11 ½ Äoffset 8 - 1 MAX 'Äoffset' STO ╗
17 ½ Äoffset 8 + Äsize MIN 'Äoffset' STO ╗
1 NEW
4 DEL
5 EDI
8 { HLP SHW }
14 ½ NEWPAD DRCL SIZE 'Äsize' STO 1 'Äoffset' STO ╗
12 LIST
45 { DROP -1 }
}
DUP2 SWAP POS 1 + GET @ Find the action that matches the keystroke
EVAL @ Execute it.
UNTIL -1 == @ If the action left a -1 on the stack, then quit.
END
╗ MENU STOF UPDIR
╗
INDEX
@ Display a list of pages
@ #E162h 282.5
½ SCN PICT STO @ Load the main screen template.
{ # 0d # 0d } PVIEW @ Display it.
PICT { # 78d # 2d } 'FNAME' RCL ìSTR 1 ìGROB REPL @ Display the Pad name
Äsize
{ DRCL
Äoffset Äsize OVER
7 + MIN SUB 2 OVER SIZE 1 + @ Pick the first and last elements to display.
FOR i
DUP TAIL SWAP HEAD 1 GET 1 ìGROB @ Convert page name to a grob
PICT { # 10d } # 6d i * + ROT REPL @ load it into the display.
NEXT DROP
} IFT
╗
NEW
@ Add a page to the current pad.
@ #C26Fh 152
½ 28 MENU @ Display the Edit menu
{ { } } 1
"Page Name?" { "" î } INPUT @ Get the page name
DUP ":" + { "" î } INPUT @ Get the page text.
2 ìLIST PUT DRCL + SORT DSTO
'Äsize' INCR DROP
╗
DEL
@ Delete a page
@ #7134h 253
½ wait MAP @ Get the page to delete.
DUP @ If MAP returns a positive number, delete that record, else beep.
{ DRCL OVER GET 1 GET
"Delete " SWAP + "? (y/n)" + { "" î }
INPUT
IF "Y" == THEN
@ Remove the page from the Pad
Äsize SWAP - 2 +
DRCL OBJì DUP 2 + ROLL ROLL DROP 1 - ìLIST DSTO
@ Decrement the size, make sure offset is less than size.
'Äsize' DECR Äoffset MIN 'Äoffset' STO
END
}
{ EBP DROP }
IFTE
╗
LIST
@ List the Steno Pads
@ #B11h 80
½ VARS OBJì { } 1 ROT
START
SWAP ìSTR +
NEXT
CHOP { "LIST:" } SWAP + SHW
╗
EDI
@ Edit a page.
@ #B715h 129
½ wait MAP
DUP @ If MAP returns a non-zero value, edit that record.
{ DRCL SWAP DUP2 GET EVAL OVER ":" + SWAP { î } +
28 MENU INPUT @ get the new Page.
2 ìLIST PUT DSTO @ Put it in the Pad.
}
{ EBP DROP }
IFTE
╗
EBP
@ My very own error beep. Change this to suit your tastes.
@ #E4F6 41
½ 1000 .1 BEEP
╗
NEWPAD
@ Open a new pad. If the pad does not exist, query the user
@ if it should be created.
@ #C30Bh 307
½ 28 MENU
"StenoPad Name?" { "" î } INPUT
"'" DUP ROT + SWAP + OBJì @ Convert string into name
ì fname
½
IFERR fname RCL THEN
ìSTR " does not exist.
Should I create it?
(Y/N)"
+ { "" î } INPUT
IF "Y" == THEN @ Create a new pad.
UPDIR
fname 'FNAME' STO
DATA
{ } DSTO
END
ELSE
@ switch to new pad.
UPDIR
DROP fname 'FNAME' STO
DATA
END
╗
╗
DRCL
@ Recall the current pad.
@ If you want to use BZ, uncomment the UBZ line.
@ #BBF0h 27
½ FNAME
@ UBZ
╗
DSTO
@ Store the current pad.
@ If you want to use BZ, uncomment the BZ line.
@ #A21Eh 37
½ @ BZ
'FNAME' RCL STO
╗
@ The Data directory contains the Steno Pads,
@ and the name of the current pad.
DATA
DIR
INTRO { {
"FEATURES"
"- Allows you to easily create
and manage short text files.
- Keeps files in alphabetical
order for easy searching.
- Uses SYSRPL for speed-critical
components.
- Supports BZ for lower memory
usage."
} { "INTRODUCTION"
" I often find it useful to
jot down short notes during
meetings, but I don't want to
carry my HP and a notebook.
This program allows me
to create, store and edit
notes easily, and without
sucking up too much memory
in my HP48G. I had tried
YONPI earlier, but while
it was quite useful, I
found it too limited.
QUESTIONS? E-MAIL ME:
MichaelHeinz@worldnet.att.net"
} { "TEST PAGE"
"123456789012345678901234567890
ABCDEFGHIJKLMNOPQRSTUVWXYZ
Now is the time for all good
countries to come to the aid
of their men."
} }
README { {
"VERSION"
"This is version 1.2a of StenoPad."
} { "Release Notes"
"In this version, all pads
are in the DATA directory.
If you have old pads, move
them to that directory.
This version also
adds the 'list' command
and fixes a bug in 'CHOP'"
} { "Known Bugs"
"All known bugs are
fixed."
} }
END
@ FNAME defines the current steno pad.
FNAME INTRO
MAP
@ Convert a keystroke into a record number.
@ Returns zero if the keystroke does not
@ match a displayed Page.
@ #2785h 150.5
½ { 41 42 43 36 37 38 31 32 } SWAP POS @ Map the keystroke to the range 1-8.
DUP @ If the result isn't zero...
{ 1 - Äoffset + Äsize MIN } IFT @ Adjust for the current offset.
╗
CHOP { @ This is a place holder. Chop is SysRPL. @ }
SVIEW { @ This is a place holder. SVIEW is SysRPL. @ }
wait { @ This is a place holder. wait is SysRPL. @ }
SHW
@ Display a Page. Page must be on the stack.
@ #FBAFh 195
½ EVAL @ Convert the page list { "NAME" "DATA" } to a pair of strings.
CHOP @ Convert the data into a list of strings.
+ DUP SIZE # 7d * # 131d SWAP PDIM @ Make sure the screen dimensions are big enough.
# 0d
DO
OVER TAIL ROT HEAD @ Split off the first line of text.
1 ìGROB PICT { # 0d } 5 PICK + ROT REPL @ Display it.
SWAP # 7d +
UNTIL OVER SIZE NOT END
DROP2
# 0d DUP SVIEW
╗
HLP { "Help"
" 1-8: VIEW A PAGE
ÅÉ: SCROLL TEXT
A: ADD A PAGE
D+#: DELETE A PAGE
E+#: EDIT A PAGE
H: THIS SCREEN
N: NEW PAD
L: LIST PADS
ON: EXIT STENO"
}
SCN
@ Screen Graphic
GROB 131 64 EFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF30100000000000000000000000000000004010BBB47072303C1000000000000000004018098550555020100000000000000000401019B75777502C1000000000000000004010298650155024000000000000000000401819B47015307D10000000000000000040100
00000000000000000000000000000401CFFFFFFFFFFFFFFFFFFFFFFFFFFFFF14010000000000000000000000000000000401EFFFFFFFFFFFFFFFFFFFFFFFFFFFFF34010000000000000000000000000000000409100000000000000000000000000000040110000000000000000000000000000004011000000000000000000
0000000000004011000000000000000000000000000000409B00000000000000000000000000000040100000000000000000000000000000004093000000000000000000000000000000401200000000000000000000000000000040930000000000000000000000000000004090000000000000000000000000000000409B0
0000000000000000000000000000040100000000000000000000000000000004093000000000000000000000000000000401200000000000000000000000000000040930000000000000000000000000000004012000000000000000000000000000000409B0000000000000000000000000000004010000000000000000000
0000000000004092000000000000000000000000000000409200000000000000000000000000000040930000000000000000000000000000004012000000000000000000000000000000401A0000000000000000000000000000004010000000000000000000000000000000409300000000000000000000000000000040900
0000000000000000000000000000040930000000000000000000000000000004012000000000000000000000000000000409B0000000000000000000000000000004010000000000000000000000000000000401300000000000000000000000000000040900000000000000000000000000000004093000000000000000000
0000000000004092000000000000000000000000000000409B0000000000000000000008FFFFFFFF40100000000000000000000004000000005093000000000000000000000473766055501200000000000000000000045511105550110000000000000000000004737220C1509000000000000000000000041514404150980
0000000000000000000041573304150100000000000000000000004000000005093000000000000000000000400000000509200000000000000000000047730571750930000000000000000000004155051155092000000000000000000000475307717509B0000000000000000000004155051115010000000000000000000
000417505771501000000000000000000000040000000050100000000000000000000008FFFFFFFF401000000000000000000000000000000040EFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF30
END
DIR
TT
@ Returns the current Julian Day, Local Sidereal Time,
@ age of the Moon and illuminated fraction of the moon.
@ Requires that the Latitude, Longditude and Time Zone variables are set.
@ Lat and Long are positive for positions north of the equator and west of
@ Greenwich. Time Zone is measured in positive numbers for locations east
@ of Greenwich, negative for locations west of Greenwich.
½ DATE TIME ATIME ╗
ALTAZI
@ Converts a stellar co-ordinate into Altitude and Azimuth bearings.
@ ( R.A. Dec -> Altitude Azimuth)
@
@ Input and Output are in HH.MMSS format. Requires that the clock, TZ,
@ Lat and Long be correctly set.
@
½ HMSì SWAP HMSì 15 * DATE TIME JDAY LST HMSì 15 * SWAP - ì DEC H
½ LAT SIN DEC SIN * H COS DEC COS * LAT COS * + ASIN ìHMS "Alt (dms)" ìTAG
H SIN NEG DEC COS * LAT COS DEC SIN * LAT SIN DEC COS * H COS * - / ATAN
ìHMS "Azi (dms)" ìTAG
╗
╗
ATIME
@ Given a date and time, returns the Julian Day, LST, age and illuminated fraction of the moon.
½ JDAY DUP DUP LST SWAP MOON ╗
aSEP
@ Given two stellar co-ordinates (in R.A. and Dec format), returns the angular seperation
@ between them.
@ Input and Output are in HH.MMSS format.
½ CìV ROT ROT CìV DOT ACOS ìHMS "Ç (dms)" ìTAG ╗
ADDMAG
@ Given two stellar magnitudes, returns the sum.
½ 100 .2 ^ DUP ROT NEG ^ SWAP ROT NEG ^ + LN -2.5 * 10 LN / "New Mag" ìTAG ╗
MOON
@ Calculates the fractional "age" and the illuminated fraction of the moon.
½ 2451550.1 - 29.530588853 / FP DUP 0 < { 1 + } IFT "Moon Age" ìTAG DUP DUP
.5 > { 1 SWAP - } IFT .5 / "Moon %Full" ìTAG
╗
JDAY
@ Calculates the Julian Day for a given date and time. TZ must be correct.
½ SWAP DUP IP SWAP FP 100 * DUP IP SWAP FP 10000 * ROT ROT 42 FS? { SWAP }
IFT 4 ROLL HMSì TZ - 24 / ì Y M D F
½ 367 Y * M 9 + 12 / IP Y + 7 * 4 / IP - 275 M * 9 / IP + D + 1721013.5 +
F + "JDay" ìTAG
╗
╗
LST
@ Given a Julian Day, calculates the Local Sidereal Time.
@ Requires that Long be set correctly.
½ GST LONG 15 / ìHMS HMS- "LST (hms)" ìTAG ╗
GST
@ Given a Julian Day, returns the Greenwich Sidereal Time.
½ DUP IP SWAP FP OVER 2451545 - 36525 / ì J F T
½ J T FLOOR 36525 * 2451545 + - .5 + 36525 / 8640184.81287 * T FLOOR
184.812866 * + 24110.54841 + T SQ .093104 * + T 3 ^ .0000062 * -
86400 / FP F .5 - 1.002737909 * + 24 * 24 MOD ìHMS "GST (hms)" ìTAG
╗
╗
CìV
@ Converts a stellar coordinate into a 3d, spherical, vector.
½ HMSì 90 SWAP - SWAP HMSì 15 * 1 SWAP ROT ìV3 ╗
@ Your current latitude. Measured in degrees NORTH of the equator.
LAT 40.25
@ Your current longditude. Measured in degrees WEST of Greenwich.
LONG 75.67
@ Your current time zone. -5 = EST, -8 = PST, 0 = GT
TZ -4
END