Post Reply 
HP-71B BASIC Question
03-20-2021, 09:23 AM (This post was last modified: 03-20-2021 09:35 AM by J-F Garnier.)
Post: #13
RE: HP-71B BASIC Question
(03-20-2021 12:51 AM)Valentin Albillo Wrote:  A few simple additional ones, many of them avoid unnecessary GOTO's (slow and unsightly):

1) Your original (sans comments):

      440 'ISMSTYPE':
      441 D=DEVAID(A) @ IF FND(D)=1 THEN GOTO 443
      442 DISP "Err: Inv Device Type" @ STOP
      443 RETURN


Somewhat optimized:

      440 'ISMSTYPE':
      441 D=DEVAID(A) @ IF FND(D)=1 THEN RETURN
      442 DISP "Err: Inv Device Type" @ STOP
      443 RETURN

Probably a matter of programming style, but I would rewrite it as:

440 'ISMSTYPE':
441 D=DEVAID(A)
442 IF FND(D)=0 THEN DISP "Err: Inv Device Type" @ STOP
443 RETURN


There are as many programming styles as programmers !

Quote:Somewhat optimized and if you can use the JPC ROM:
[...]

Yes! If you want to write better structured code, the JPC ROM is a must, with it's structured programming constructions modelled from the Series 200/300 HP BASIC.

J-F
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 - 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)