Sunday, July 10, 2005

'Save' for The HP48gx

i am having the most terrible time with this entry...
it seems that the html reader keeps misinterpreting

my backslashes & other seemingly benign characters
as instructions for it's formater...???

What is the most annoying thing that you have to constantly worry about when using a programmable calculator...???
For me; It's Saving things!
i find it tremendously tedious to think up names for items that i want to save,
Often; i only want to save an item for a mintue or two,

and the act of thinking up a new; unique name that i've not already used is quite stressfull...!!!
So i've come up with, and evolved, a program that saves things for me,

always careful to use a unique name that's prefixed with a general reminder of what it is...

How to use It:
This program ( Save ) has a Double Click Option;
So that if you Double Click the Key to Activate it--
By Using Either a Menu Key, Choose ENTER Key, or a UserKey...
It will bring up a Menu with Special Routines...

Theses are:
Illegal Name:
Any String will be made into a Name
Store Number:
The Number will be used as the Name, Prefixed with a leaping dot.
Make The Tag into the Name:
Use the Tag as the Name,
If the Tag would make an Illegal Name,
it will be Made into an Illegal Name!
Purge Illegal Name:
Since Illegal Names are somewhat tricky to Purge,
this brings up All the Objects in the current directory--
On to a Choose Menu,
and you then select the Name that you want to Purge!
Save as a Unique Name:
This has the same functionality as if you'd only hit the access key once,
in case you accidently hit it twice!
---
If you only hit the Access Key once, or chose Save as a Unique Name from the Menu,
The program will Save whatever's on the stack as a unique name,

with a coded Prefix to give you some clue as to what the object is...
Such as a number, complex number, string, list or whatever...
Use the ones i've provided, or pick you're own prefixes...!
The Unique part of the name is a number in Alphabase! A-Z
It is incremented automatically; whenever Save is used.
---
There are also five subroutines that Save uses:

->St2
Changes an Algebraic or Name into a String,
or puts Double String Quotes around a String.

Nam
Makes an Illegal Name from any String.
This SysEval works on a gx... will it work on your 48...???

->Abc
Converts ( Toggles ) Decimal to Alphabase Numbers.

->ai
Source for ->Abc's Alphabase Incrementing Number

Clic
Takes either a String, which is used to make an INPUT prompt,
or a Program which is Evaluated ( such as an INFORM or CHOOSE prompt )
The Prompt is presented if the access key is double clicked or ignored if not.


Program Listings:
Apparently: --!!!
This blog html interpreter will just not allow me to use certain characters in various combinations...???!!!
Such as backslashes & the more and less signs...!!!
It will just go crazy if i try to use them...???

Any time i'm timid about a character or characters,
i'll just put them in ( )'s and write out what i mean...!
This is the first time, pretty much,
that this Blogger has been this crazy with me...???

Main Program: Save

(0:beginprogram)
.2 WAIT KEY
(1a:beginprogram)
DROP "Bonus Savings!"
{
{ "IllegalName?"
(2a:beginprogram)
DUP TYPE 2 (notequal)
(3a:beginprogram)
DUP (rightarrow)St2 EVAL
1 8 SUB
(3a:endprogram)
IFT
:&: (rightarrow)Nam EVAL STO
(2a:endprogram)
}
{ "StoreNumber"
(2b:beginprogram)
DUP (rightarrow)STR "-" "-"
:&: RePlc EVAL
-@ these -'s are characters 173 & 45
-@ "."'s are character 183
"." SWAP + OBJ(rightarrow) STO
(2b:endprogram)
}
{ "MakeTag(rightarrow)Name"
(2c:beginprogram)
OBJ(rightarrow)
:&: (rightarrow)Nam EVAL STO
(2c:endprogram)
}
{ "PurgeIllName!"
(2d:beginprogram)
"PURGE ILLEGAL NAME"
VARS 1 CHOOSE :: PURGE IFT
(2d:endprogram)
}
{ "(rightarrow)UniqueName"
(2e:beginprogram)
:&: Save EVAL
(2e:endprogram)
}
}
{ 2 0 12 }
IFERR
4 PICK TYPE POS DUP NOT
(4:beginprogram)
DROP 1
(4:endprogram)
IFT
THEN DROP2 4
END
CHOOSE
:: EVAL
IFT
(1a:endprogram)
(1b:beginprogram)
PATH SWAP HOME DUP TYPE
12 (equalequal)
(5a:beginprogram)
1 (rightarrow)LIST "(uparrow)"
(5a:endprogram)
(5b:beginprogram)
{
"(rightarrow)" @ for object type 0/Number
"(cents)" @ 1/ComplexNumber
"(dollars)" @ 2/String
"(bar-x)" @ 3/RealArray
"(bar-x)" @ 4/ComplexArray
"(englishlb)" @ 5/List
"(tilde)" @ 6/GlobalName
"(tilde)" @ 7/LocalName
"(icelandicP)" @ 8/Program
"(oldfashiondivide)" @ 9/Algebraic
"(leftarrow)" @ 10/Binary
"(blacktriangle)" @ 11/GraphicObject
0 ( zero ) @ 12/TaggedObject
"(enminus&hoppingdot)" @ 13/UnitObject
"(infinity)" @14/XLIBName
"(universalcurrency)" @ 15/Directory
"(infinity)" @ 16/Library
}
OVER TYPE 1 + DUP
17 (equaltoorlessthan)
:: GET
(6:beginprogram)
DROP2 "."
(6:endprogram)
IFTE
(5b:endprogram)
IFTE
"." SWAP +
'ai' INCR :&: Abc EVAL
+ OBJ(rightarrow)
ROT EVAL STO
(1b:endprogram)
IFTE
(0:endprogram)
--------------

Subroutine: (rightarrow)St2

(0:beginprogram)
DUP TYPE (rightarrow) (tau)
(1:beginprogram)
CASE
(tau) 2 (equalequal)
THEN 34 CHR DUP 3 ROLLD
+ + END
{ 6 7 9 } (tau) POS
THEN (rightarrow)STR 2 OVER
SIZE 1 - SUB END
(rightarrow)STR
END
(1:endprogram)
(0:endprogram)
-----------

Subroutine: (rightarrow)Nam

(0:beginprogram)
DUP TYPE 2 (equalequal)
(1a:beginprogram)
# 23317d SYSEVAL
(1a:endprogram)
(1b:beginprogram)
"Must Be A String!"
DOERR
(1b:endprogram)
IFTE
(0:endprogram)
--------------

Subroutine: (rightarrow)RePlc

(0:beginprogram)
"3: SomeObject
2: NewThing
1: ReplaceThis"
:&: Clic? EVAL
(rightarrow)STR SWAP
(rightarrow)STR SWAP
DUP SIZE
(rightarrow) (alpha) (omega) z
(1:beginprogram)
6 OVER TYPE 2 (equalequal)
::CF ::SF IFTE
(rightarrow)STR ""
WHILE
OVER (omega) POS DUP
REPEAT
(rightarrow) (barx)
(2:beginprogram)
OVER 1 (barx) 1 - SUB + (alpha) +
SWAP (barx) z + OVER SIZE SUB SWAP
(2:endprogram)
END
DROP SWAP +
6 FS? ::OBJ(rightarrow) IFT
(1:endprogram)
(0:endprogram)
--------------

Subroutine: (rightarrow)Abc

(0:beginprogram)
DUP TYPE (rightarrow) (tau)
(1:beginprogram)
CASE
(tau) 0 (equalequal)
THEN IP ""
WHILE
OVER 26 (morethan)
REPEAT
OVER 26 SWAP 1 - SWAP MOD
1 + DUP 64 + CHR ROT +
3 ROLLD - 26 / SWAP
END
SWAP 64 + CHR SWAP +
END
(tau) 2 (equalequal)
THEN
DUP SIZE
(rightarrow) (cents)
(3:beginprogram)
0 1 (cents) FOR $
OVER $ $ SUB NUM 64 -
26 (cents) $ - ^ * +
NEXT
SWAP DROP
(3:endprogram)
END
(tau) 5 (equalequal)
THEN
1 'Abc' DOLIST
END
" Huh?" CLLCD 3 DISP
.25 WAIT
TEXT
END
(1:endprogram)
(0:endprogram)
--------------

Subroutine: (rightarrow)Clic?

(0:beginprogram)
.2 WAIT KEY
(1:beginprogram)
DROP DUP TYPE 2 (equalequal)
(2:beginprogram)
RCLMENU DEPTH ROLLD
(grob 21 x 8 of vertical lines)
DUP DUP 3 DUPN 6 (rightarrow)LIST
TMENU ""
IFERR
INPUT
THEN
DROP2 DEPTH ROLL MENU KILL
ELSE
OBJ(rightarrow)
END
DEPTH ROLL MENU
(2:endprogram)
:: EVAL
IFTE
(1:endprogram)
:: DROP
IFTE
(0:endprogram)
--------------
--------------
Subroutine: (rightarrow)Clic?

(0:beginprogram)
.2 WAIT KEY
(1:beginprogram)
DROP DUP TYPE 2 (equalequal)
(2:beginprogram)
RCLMENU DEPTH ROLLD
(grob 21 x 8 of vertical lines)
DUP DUP 3 DUPN 6 (rightarrow)LIST
TMENU ""
IFERR
INPUT
THEN
DROP2 DEPTH ROLL MENU KILL
ELSE
OBJ(rightarrow)
END
DEPTH ROLL MENU
(2:endprogram)
:: EVAL
IFTE
(1:endprogram)
:: DROP
IFTE
(0:endprogram)
--------------
--------------

No comments: