Learning Basic....and a question about MAKELEX in Joseph Horn's "HP-71B BASIC MADE EASY"



#26

Hello all,

Just getting aquainted with BASIC for the HP 71B and have written as short program to correct low temperature errors in the barometric altimeter:

Correction = H * (( 15 – T0 ) / (273 + T0 – 0.5 * L0  * ( H + H2 )))

where:

H = Minimum height above the altimeter setting source (setting source is normally the aerodrome unless otherwise specified) in ft
T0 = T0 + L0 * H1 which is the aerodrome (or specified temperature reporting point)temperature adjusted to sea level in °C
L0 = Standard Lapse Rate (0.0019812 °C/ft or 0.0065 °C/m) in °C/ft
H2 = Altimeter setting source elevation ft
T0 = Aerodrome (or specified temperature reporting point) temperature in °C
H1 = Aerodrome (or specified temperature reporting point) elevation

Here is a listing of the progam and I realize for you pros this is as BASIC as it GETS, please excuse the pun!


TEMP		BASIC		405	04/26/08 12:37

10 L0=.0019812 @ FIX 0 @ CFLAG 1
20 REAL A(6) @ DIM A$(6)[10]
30 A$(1)=”Sector” @ A$(2)=”IF”
40 A$(3)=”FAF” @ A$(4)=”MDA”
50 A$(5)=”MAP”
100 INPUT “Airport altitude: “;H1
110 INPUT “Airport temperature: “;T
120 FOR X=1 TO 5 @ DISP A$(X)
130 INPUT A(X) @ NEXT X
200 FOR X=1 TO 5
210 H2=A(X) @ H=H2-H1 @ T0=T+L0*H1
220 C=H*((15-T0)/(273+T0-.5*L0*(H+H2)))
230 C1=H2+C
240 IF X=4 THEN SFLAG1
300 IF FLAG(1) THEN C2=IP(C1/10)*10 @ CFLAG 1 @ GOTO 500
310 IF NOT FLAG(1) THEN C2=IP(C1/100)*100 @ GOTO 500
500 DISP A$(X);TAB(10);C2 @ WAIT 3 @ NEXT X
510 DESTROY ALL

1  lines 10 through 70 set the computer into the correct mode for display and input the variables as well as their display lables.

2 lines 100 - 130 input via two prompts and a loop the initial variables.

3 lines 200 - 240 calculate the new corrected altitudes via the formulae.

4 lines 300 - 310 output the corrected altitudes to a correction truncated to the nearest 100 and one correction to the nearest 10's.

5 lines 500 and 510 display the new altitudes along with the correct name associated with the altitude


AND NOW THE QUESTION ABOUT MAKELEX:

My question regards the guide "HP-71B BASIC MADE EASY" by Joseph Horn. I downloaded from the DVD and printed this out in manual form a easy reading.

On page 132 of the manual there is a listing in BASIC for "MAKELEX", a program used to take a LEX file and type it directly into the HP-71.

The following LINE will not be accepted by the HP-71B and for the life of me and my limited knowledge I cannot see the error in the sytax (is this a typo?):

A=HTD(ADDR$('DUMMY')) @ A1=A @ P$=RPT$("-",16)

The string definition P$=RPT$("-",16) when endline is pressed gives the error code "Invalid Expr" and the cursor sits on the P of RPT$.....

This looks like an extremely useful program, also described as such and I would like to add it to my catalogue of programs but I cannot get past the error when inputting the code.

Any ideas would be appreciated, as I stated earlier, is this a typo?

Cheers, Geoff


#27

Change it to:

A=HTD(ADDR$('DUMMY')) @ A1=A @ P$="----------------"
RPT$ comes from a LEX file (don't recall which one). Kind of a chicken/egg if you do not have that LEX file in your 71B.

#28

Thanks!!!!

oops spoke to soon, what exactly follows the quotes? ;-)

Edited: 28 Apr 2008, 3:23 p.m.

#29

Hi Geoff,

Certaily there is no such RPT$() function in HP-71B BASIC ROM, it's itsef a LEX (Languaje EXtension) that may be available elsewere. Sorry but I haven't found it handy... but don't worry, there is a ver simple workaround:

IICR, RPT$("x",n) is intended to build a string RePeaTing "x" character n times.

So, P$=RPT$("-",16) can be replaced by P$="----------------"

Not so cute but hopefully effective... ;-)

Hope this helps.

Diego.


#30

Thanks Egan and Diego!!!
\
Cheers, Geoff

#31

Hi Geoff,

RPT$ can be found in either:

GRAPHLX,

RPTLEX,

STDLEX,

or

STRINGLX

...and probably in other LEX files...

Kind regards from France.

Etienne

Edited: 28 Apr 2008, 4:13 p.m.


#32

Thanks Etienne,

success and now I see why the RPT$ command works, Nice shortcut for the 16 hyphens.

Got the makelex program working and have installed a couple of useful lex files already. Backups on the card reader.

I really like the clockdsp "clock on" lex program as time is important in the cockpit and the HP 41cx has such an excellent time system.

Cheers, All, Geoff


#33

Hi Geoff,

If you need a particular lex word, I would advise you to visit the LexIcon from Joe Horn.

Here you will find a lot of cross-referenced lex words and lexfiles.

The first step would be to identify there what could be of interest to you and then head to the HpMuseum ftp program library.

There you will find the lexfiles with the extension .l71 in the lif directories.

Cheers

Etienne

#34

file that creates an alarm setting. It would be nice to have an alarm on the HP 71B in Lex. I am sure I could cobble together one based on the timer function and seconds from now, but if the lex is out there wonderful

alarmlx.lex, did a site search and all I get is the name but no listing. Off to the DVD and the IDS to see if I can find one.

If you want to shorten my evenings work how about a listing or a destination.

Cheers, Geoff


#35

Quote:
It would be nice to have an alarm on the HP 71B in Lex.
That was one of my few disappointments in going from the 41 to the 71, but I was able to fill in most of the void (and then some) in BASIC with ON TIMER. The HP-71 Users' Library Solutions "Utilities" book has time and date functions. (You might also like the System Catalog program in this book, which catalogs all the LEX file keywoords for you. Note that you can use ENDUPLEX to call a program when the machine turns off, or re-assign the OFF key to call a program that has uses the OFF command after it has done whatever else you want it to do.

#36

Did a site search and can't find ONTIMER, can you point me in the correct direction? Also have the DVD and the day time function look good for input but don't have any alarm functions built in.

I was successful in loading MAKELEX and CLOCKDSP.LEX which gives a constant clock display to the right of the displya while allowing you to key without interfering with the clock and vis versa.

Any lex alarm programs (I know they are out there as Horner's lists about 5 of them but no source code) would be appreciated.

Cheers and thanks Garth. I agree the HP41cx cannot be replaced until I find a timer alarm program (or write on myself!).

Geoff


#37

Quote:
Did a site search and can't find ONTIMER. Can you point me in the correct direction?
ON TIMER is one of the built-in things in the HP-71, even with no modules. It's in the manuals.

#38

Quote:
ON TIMER is one of the built-in things in the HP-71, even with no modules. It's in the manuals.

Last night while sleeping I realized that it had to be a built in function, just like the 41cx. Printed the manual off the other day and I just haven't reached that chapter yet!

So ontime along with the HH.MMSS to decimal functions on the util manual plus a simple basic program should give me all I need to write a routine that is user friendly!

Thanks for the heads up Garth.

Geoff

Edited: 29 Apr 2008, 11:48 a.m.


#39

Hi Geoff,

Funny to see that this is not the first time we are looking for the same thing. On one of the swap disks there is an Alarm Call
program.
Regretfully in line 110 two Functions are unknown. I remember I
have played with it. It is a snooze function, what it does it resets the Alarm 5 minutes.

0010 ! ALARM CALL
0020 BEEP @ INPUT "Alarm to ring at : ";T
0030 W=60*(60*IP(T)+IP(FP(T)*100))-TIME
0040 DISP "Set for";T;
0050 IF W<0 THEN W=W+86400 @ DISP "tomorrow." ELSE DISP "today."
0060 ON TIMER #1,W GOTO 80
0070 WAIT 3 @ BYE
0080 OFF TIMER #1 @ DISP "* ";TIME$;"-";DATE$[4,8]&"/"&DATE$[1,2]&" *"
0090 SFLAG -25 @ FOR I=1 TO 25 @ IF KEYDOWN THEN 120
0100 BEEP 200 @ BEEP 800 @ NEXT I
0110 T=XFN80001(XFN80002(T)+5/60) @ GOTO 30
0120 CFLAG -25 @ PUT "#43" @ END

Greetings,

RamLab


#40

Ramlab, Hello and the lap top is fixed?

yes it does look like a snooze alarm, with a function called probably from a module or lex file. should be a basic workaround on that line.

In any case thanks for the listing and I will see what I can do with it, i like the snooze function!

Cheers, Geoff

#41

Quote:
Printed the manual off the other day and I just haven't reached that chapter yet!
You do have both manuals, don't you? The Owner's Manual and the Reference Manual are two separate manuals, and both came with every new 71. You need both. The Reference Manual has all the keywords in alphabetical order along with the syntax, example usages, a list of related words, and comments. In the back, they're categorized, you can also look up error numbers and messages, there's a glossary, treatment of the IEEE standard for handling math exceptions, statistical array discussion, system memory requirements for different kinds of variables, files, command stack, etc., the reset conditions, escape and control code sequences, the various environments, the flags, and other things.

ON TIMER is the one you're looking for. The maximum delay before the timer comes due is over four years. You can have an unlimited number of timers pending at once, as long as your program sorts them and keeps giving the ON TIMER statement the next one to come due, and when it does come due, give it the one after that, and so on. You can write your program to make the repeating intervals like the 41 does, but make it even more flexible than the 41's. The alarms can be to do anything the computer can do, from beep you and show a message, up to run some kind of control operation on a workbench, like taking and reporting data and setting the instruments for the next test in so many minutes, etc..


#42

Printed off the HP 71B owners manual, reference manual, Utility manual and Joseph Horn's "HP basic ...." and then had them spiral bound for about $10.

I made it through HP basic made easy and am plodding through the manual now as well as the utitilty manual. Just got the 71B about 4 days ago and spent the 1st day dismantling it, cleaning connections (no port covers and filthy) and then polishing the lcd cover lense. Sanded and masked the aluminum bezel and then laquered it.

It looks good and works well, the 'a' key does not have the positive click the rest do but it works now. Added a card reader from ramlab, have a 32K ram module comming and an HPIL for my printer and 9114B disc reader.

All in all a nice package. I do have a mint spare comming in the mail which included an HPIL module also (this won't need any work and has all it's port covers intact).

Cheers, Geoff

Edited: 29 Apr 2008, 2:43 p.m.


#43

Geoff,

you seem to be going back in time like I have been over the last few months. Of course my real life work leaves me too little time of picking up my BASIC programming skills of the yesteryears.

I have picked up all the hardware you have (and some more). I am actually currently evaluating the HP-IL ISA card for the PC to connect the 71 to a PC and transfer programs. I have been able to transfer programs with the 9114B and disks but it is quite a task to rid the program files of the the required bytes (coming from the PC), restore it then safe it on disk and then load it on the 71. I have had success with it but then thought the card would be easier. Unfortunately the card is not working with my PC (and I have tried everything - thanks Christoph and Jean-Francois for all their support, unfortunately without success and unfortunatley I have limited time playing with these toys) and I suspect I need a different PC to try again (I do not believe it is the card).

So, not to bore you or the Forum, but just trying to let you know that there other newcomers to the oldscholol techniques. I love doing that and offer to exchange any experience I am making at this (usefull?? - I still wonder) quest.

Keep BASIC alive!

Regards, Alexander


#44

It would seem that we are "pseudo ludites" destined to be 20 years behind!

I too do this as a hobby but the instruments are used in the cockpit and do help (not required but fun). Beats doing crossword all the time!

I have an old 486 sitting in the garage with ISA bus and window 98 sitting on it and am considering the card but as of now the 9114b lif discs hold my HP41cx memory state as well as quite a few programs from my university days.

The HP71B gives me an excuse to learn basic which seems other then the plethora of "key words" similar to the other programs I learnt. To bad I didn't appreciate all this in 1976 when I held my first HP25....

I have spent the last 3 weeks trying to program a pic18f252 chip on what can only be a defunct programmer and can 'feel your pain' when technology does not correctly convert thought processes into actual software ;-0

Good luck is all I can say and try to find an old 486 with and install does and windows 3.11, it would seem to be the same era as the HP71B!

Of course I remember our labs first computer "AMDEK" amber screen with a double stacked 5mb hard drives and 1mb ram with a dot matrix printer and dos 1.10. Looked at it and went back to my 41cx as a much more capable machin (1984).

Cheers, Geoff


#45

Thanks for your thoughts. I actually plan to start on my PPL in June, so we could exchange programs? Do you have the Navigation Module for the 41? I have the Bobby Schenk Yacht Module (though my Yacht now resides in Germany whereas I am in Wisconsin) which somehow has functions I consider usefull for flying.

I have actually the ISA card in a Pentium, so maybe one step further back is a good idea. I am also trying to use the 71 with my HP-110Plus.

So many new things to discover as during my university days I "only" used a 15C and then a 48SX. For BASIC I had my ZX-81. After that I learned Pascal, Fortran and then turned to Visual Basic. I am returning back to the Basics (get the line) now and looking at all the dialects out there (Sharp, Casio, TI, etc.).

Hope to stay in touch. My email is firstnameatlastnameminusfamilydotde.

Regards, Alexander

#46

Quote:
Unfortunately the card is not working with my PC (and I have tried everything - thanks Christoph and Jean-Francois for all their support, unfortunately without success and unfortunatley I have limited time playing with these toys) and I suspect I need a different PC to try again (I do not believe it is the card).

What kind of problems? What did you try?

#47

Egan,

thanks for your interest. I am referring to Christoph Klug's card, just to make sure, it is not the original HP card.

I installed the card in my Pentium PC. This PC is the one I have been using for swapping discs with my 9114B. The ISA slot is a 16 bit slot but I seem to remember it made no difference if you installed a 8 bit card in that slot. I am running MS-DOS 6.22 on that PC (and SUSE Linux) and I set up the card according to instructions. I could not get any HP-IL device (including EMU41) to communicate with the card. I troubleshooted with the help of Christoph and Jean-Francois (position in slot, HEX address, HP-41CX setup and commands) but nothing changed. After several hours of trials and no success I have given up (with this PC card combination). I have another old PC but just not have had the time to put the card in there (I have not even looked if it has a 8 bit ISA slot).

Do you have any other suggestions I should seek. Christoph has been very helpful but also was running out of ideas. He checks the card before sending them out so I really do not believe the card is an issue.

Comments welcome!
Regards, Alexander


#48

Have you tried test.com from hplink? It's a simple check for the card. You can put an 8bit card in a 16bit slot. I'm using a Pentium 66/200 Mhz without issue. Perhaps try to set BIOS settings to defaults.


#49

Egan,

thanks for these additional tips. I have tried test.com and that did not work either. I will try some things with the BIOS settings this weekend. Actually the ISA slot is on a riser card together with one PCI slot. There are some DIP switches on the motherboard and unfortunately I have not been able to find any documentation for these. My PC is also a Pentim 66 MHz, a HP (figure that!) Vectra. Iw ill see if I can make sense of these switches too. I have not given up completely.

Regarding a csetup with the HP110Plus would you know to happen if I could store LIFDISK files stored from the PC (without the procedure of editing the header) then read them from the 9114B to the HP110plus and then store them from there to the HP71B?

Regards,
Alex


#50

Quote:
Regarding a csetup with the HP110Plus would you know to happen if I could store LIFDISK files stored from the PC (without the procedure of editing the header) then read them from the 9114B to the HP110plus and then store them from there to the HP71B?

Sorry, no idea.

Possibly Related Threads...
Thread Author Replies Views Last Post
  HP Prime - Short "learning" modules CR Haeger 1 481 11-27-2013, 02:13 PM
Last Post: Jonathan Cameron
  An easy course in using the HP16c-wanted- Frank 4 719 10-29-2013, 11:50 AM
Last Post: Mark Hardman
  [HP-Prime] connector made with printer3D CompSystems 0 358 10-18-2013, 04:53 PM
Last Post: CompSystems
  OT: Jeppesen E6B Wind-Easy Computer (Slide Rule) Eddie W. Shore 18 2,418 10-12-2013, 03:26 PM
Last Post: George Litauszky
  HP PRIME - Need help for basic program svp. dg1969 4 654 10-08-2013, 04:06 PM
Last Post: dg1969
  Do You Think a Listing Error Was Made? Jim Johnson 13 1,290 09-04-2013, 09:23 AM
Last Post: Eddie W. Shore
  About changing or deleting content after replies were made Raymond Del Tondo 1 393 08-26-2013, 05:01 PM
Last Post: Massimo Gnerucci (Italy)
  Self-made WP-34s flashing cable? Victor Koechli 6 1,125 08-15-2013, 10:11 AM
Last Post: Les Wright
  Easter Sunday Basic Trigs (HP-12C) Gerson W. Barbosa 29 2,543 04-04-2013, 02:19 PM
Last Post: Gerson W. Barbosa
  "The Basic HP-71" Jeff Davis 3 585 08-30-2012, 12:20 AM
Last Post: Howard Owen

Forum Jump: