Post Reply 
WP34S - f SLV used with user selectable variables
05-07-2018, 08:08 AM
Post: #11
RE: WP34S - f SLV used with user selectable variables
(05-06-2018 11:36 PM)gomefun2 Wrote:  If I want to store a single number such as 0.8175728566800069800087820069820087 for ASCII. do I have to do something like:

001: LBL A
002: #009 // number of variables
003: SDR 003 // putting 009 into fff, as in cccccc.fffii
004: STO 00 // Store 0.009 to R00
005: CLα // clear alpha registry
00: DBLON // turn double mode on for more than 8 letters stored in single number
// ASCII codes: q(81),k(75),h(72),u(85),B(66),Pe(80/69),Pw(80/87)),re(82/69),rw(82/87)

Important note: always set DBLON or DBLOFF before (!) you store something in data registers. Since double precision requires more memory than standard precision the memory used for the data registers is interpreted differently when you recall or store something. Try it: in DBLOFF, store 0,009 in R00, change the mode and recall the number again: What was stored as 0,009 before is now returned as 2,139 E+16. You may even get a different result.

The stack is not affected by this. Here the numbers stay the same even after a mode switch.

(05-06-2018 11:36 PM)gomefun2 Wrote:  // create the number 0.8175728566800069800087820069820087 for ASCII
// an extra 00 after 80, and 82 used to tell the program subfunction, that there are two letters for // that variable

This of course requires a modified subroutine that implements this special way of encoding one or two characters. If this is required you could also switch to a method similar to ASCIIZ as used in some programming languages for storing strings: here a zero (Null-byte) marks the end of a string. This in turn means at least two digits for each variable. If you want to encode A, B, C1 and EPS this would be 6500660067490069808300.

(05-06-2018 11:36 PM)gomefun2 Wrote:  00: LBL 99 // converts what is in the x-registry to variable names and stores the user input

Which also means that there must be a unique relation between variable name and storage register. If the first character is used for the register number this would mean that E and EPS is stored in the same register...

(05-06-2018 11:36 PM)gomefun2 Wrote:  Since to put such a long number takes so many steps, is this really more efficient, than just using f-alpha-Enter? (for variable prompts?) if this long number could be entered in 1 or 2 steps it seems that it would be good.

IMHO you should think about a maybe completely different approach. Don't get stuck with the idea of encoding variables names in numbers.

Dieter
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: WP34S - f SLV used with user selectable variables - Dieter - 05-07-2018 08:08 AM



User(s) browsing this thread: 1 Guest(s)