Post Reply 
71B: DIM a variable, but keep the old value if it's already the right type?
03-23-2021, 11:01 PM
Post: #6
RE: 71B: DIM a variable, but keep the old value if it's already the right type?
.
(03-23-2021 11:46 AM)Dave Britten Wrote:  I hadn't dived into the Math ROM yet, so didn't know that TYPE() was available. As a matter of fact, I was looking through the 71B manuals last night trying to determine if there was something like that built in. Smile

TYPE should have been built-in, as it's so basic and essential a function that's very difficult and expensive to duplicate in BASIC code (lest you PEEK at various locations), and further it would take very few bytes in the System ROMs to implement it.

But they didn't because they needed those few bytes and several thousands more to implement instead the useless abomination known as "CALC" Mode just to satisfy marketing idiots and someone's ego. So poor TYPE was relegated to the Math ROM which, while being a fantastic, über-essential add-on, a real must, it also has its share of very questionable decisions in its implementation.


Quote:Granted, if the number of input variables gets large enough - say, more than six or so - it's probably less code to just save/load everything in an SDATA file.

The CALL approach is also very workable and preserves every variable under the (main environment) sun, and there are several other very different approaches to solve the problem (*cough* TRANSFORM *cough*) but you're probably well served right now.

Regards. [P.S.: glad you liked my HP-41C vs SHARP PC-1211 comparison article]
V.

  
All My Articles & other Materials here:  Valentin Albillo's HP Collection
 
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: 71B: DIM a variable, but keep the old value if it's already the right type? - Valentin Albillo - 03-23-2021 11:01 PM



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