Post Reply 
HP-71B BASIC Question
03-17-2021, 05:49 PM (This post was last modified: 03-17-2021 05:55 PM by Valentin Albillo.)
Post: #6
RE: HP-71B BASIC Question
.
Hi again, Sylvain:

(03-17-2021 02:28 PM)Sylvain Cote Wrote:  Valentin, criticize or nitpick at will, you are welcome. Wink

No, no, not at alll, I only tried to point out that you were actually using subprograms, not subroutines as you called them.

Quote:Valentin, Tom & Jean-François, you made me realize that I was asking too much from the BASIC language.

That's patronizing in the extreme.

The HP-71B BASIC dialect is not "the BASIC language" but a 40-year old dialect which was very advanced for a handheld device in its time but 40 years later is nothing but a relic. "The BASIC language" nowadays would be something like MS Visual BASIC in its latest team-oriented incarnations, and you can ask very very much from it and it will deliver, in spades. I've participated in very large commercial projects using it and it worked flawlessly, minimizing the development time and being a pleasure to use.

Quote:I have been spoiled from all the languages/paradigms that I have used since the 1980's and I have difficulty going back to a world that does not even have functional decomposition.

May I remind you that all those "functional decompositions" and other such niceties in the end are converted behind the scenes to a bunch of low-level assembly language operations full of goto's and whatnot. Also, the HP-71B BASIC implementation takes much less than 64 Kb, and I wonder about the size of those advanced languages that even have "functional decomposition". Megabytes ? Gigabytes ?

Last but not least, the possibility of sharing variables and other objects among the main program and subprograms already existed in HP's BASIC in the Series 80 and other models using so-called RMB BASIC, by using the COMMON statement to define a list of elements (don't remember right now if that included UDFs) to share among them. The 71B BASIC dialect does not implement that statement but that doesn't imply that "BASIC" in general doesn't.

Quote:I will refactor the code to remove all the CALL/SUB and replace them with GOSUB/LABEL.
I will also need to seriously manage variables names/usage because they becomes global.

Your decision, but it seems to me that this is the hardest way of the three I suggested. If your user-defined functions are single-line (as opposed to multi-line) no matter how long, it would be most convenient to use the S$ approach. Which is more, even if the definition takes 1,000 characters, you can dimension a 1,000-char string and VAL will evaluate it without complaining, which a single-line UDF can't do, being limited to ~90 chars or less.

On the other hand, replacing your subprograms with subroutines will force you to redesign your variable names so there's no conflicts among them and might also incur in unforeseen side effects (OPTION BASE, for instance) as you're merging a number of different local environments into a single one. I think this goes against maintanability and dismisses the many good points inherent in using subprograms in the first place.

Best regards.
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
HP-71B BASIC Question - Sylvain Cote - 03-16-2021, 12:53 AM
RE: HP-71B BASIC Question - toml_12953 - 03-16-2021, 01:42 AM
RE: HP-71B BASIC Question - J-F Garnier - 03-16-2021, 09:34 AM
RE: HP-71B BASIC Question - Sylvain Cote - 03-17-2021, 02:28 PM
RE: HP-71B BASIC Question - Valentin Albillo - 03-17-2021 05:49 PM
RE: HP-71B BASIC Question - Sylvain Cote - 03-17-2021, 07:30 PM
RE: HP-71B BASIC Question - toml_12953 - 03-18-2021, 07:56 AM
RE: HP-71B BASIC Question - Sylvain Cote - 03-18-2021, 11:02 AM
RE: HP-71B BASIC Question - J-F Garnier - 03-19-2021, 09:01 AM
RE: HP-71B BASIC Question - Sylvain Cote - 03-19-2021, 07:07 PM
RE: HP-71B BASIC Question - J-F Garnier - 03-20-2021, 09:23 AM
RE: HP-71B BASIC Question - Sylvain Cote - 03-20-2021, 01:03 PM
RE: HP-71B BASIC Question - Sylvain Cote - 03-22-2021, 10:31 PM
RE: HP-71B BASIC Question - J-F Garnier - 03-24-2021, 10:05 AM
RE: HP-71B BASIC Question - rprosperi - 03-24-2021, 12:40 PM
RE: HP-71B BASIC Question - J-F Garnier - 03-24-2021, 04:51 PM
RE: HP-71B BASIC Question - rprosperi - 03-24-2021, 07:36 PM



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