|Learning Basic....and a question about MAKELEX in Joseph Horn's "HP-71B BASIC MADE EASY"|
Message #1 Posted by Geoff Quickfall on 28 Apr 2008, 3:03 p.m.
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 )))
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)
30 A$(1)=”Sector” @ A$(2)=”IF”
40 A$(3)=”FAF” @ A$(4)=”MDA”
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
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?