Aviation MMBasic programs

27 Jun 25
Hello - My name is Jim. 787Geoff inspired me to join this forum. I too recently stop flying after 66 years in the GA industry. Over the years I have developed several aviation programs and spreadsheets for the VFR pilot. I have not ordered my Picocalc yet but have uploaded 3 of these programs to my GetHub account: GitHub - UtahPilot/AviationPrograms: Aviation Programs and Spreadsheets I hope that somone here will load these programs onto their Picocalc and let me know if they run (formatted) all right. Thank you. If they are ok, then I’ll have some questions about the computer/calculator itself. - Like, is there a way to use the function keys within a program? - Jim

4 Likes

That makes two of us, aviation types, newbies.

I will be taking my aviation programs from the HP 15ce and my HP 71B and converting them into basic programs also.

We’ll try yours out and let you know and thanks!

As I stated in the other thread, I would love to see a GPS ability as a plug-in accessing the ports on the picoCalc that can be accessed by the basic programs for such things is time to go distance to go true track converted to magnetic track using a database and etc..

Cheers

2 Likes

The function keys return codes so you can test for them while a program is running by using INKEY$

do
  do
    a$=inkey$
  loop until a$<>""
  select case asc(a$)
    case 145
      print "F1 pressed"
    case 146
      print "F2 pressed"
    case 147
      print "F3 pressed"
    case 148
      print "F4 pressed"
    case 149
      print "F5 pressed"
    case else
      print "Some other key pressed"
  end select
loop
2 Likes

Hi 787Geoff and Toml - I started writing aviation programs on my TRS-80 and my TRS-100 in the late 70’s. I ended up with my HP-42s and my DM42. (I was using spreadsheets on the DM42.) That’s a great idea about a GPS on a Picocalc!
Thank you, Toml_12953. I have never heard of the ā€˜Select Case chr$’ command. I think that is just what I needed. A lot of aviation formulas have multi varibles that have to be ā€˜inputed’. I have been using numbered variables in a list to input each variable value. Like: 1 Latitude 2 Longitude 3 Magnitic Var etc. Then I used the ā€˜Input’ command to inter the two numbers. Like: Input ā€œLatititudeā€; 1,42.13 : Lat1 = N2 Now, with the ā€˜Select Case’ command, I will be able to store the variable vaule directly to its name (Lat1) with a function key! Thank you so much!

1 Like

@UtahPilot, I remember reading, in Portable 100 magazine, a pilot wrote a couple articles about flying, and programs on a TRS-80, Model 100. If I remember correctly, he said that there wasn’t really enough room in most cockpits to hold the M100. Was that by any chance your article, or did you write articles for Portable 100?

Oops! Instead of chr$() use the asc() function instead. I’ve modified my first message so it’s correct now.

1 Like

28 Jun 25
Hi granzeier - Ahhh - Yes, I remember the Portable 100. Learned alot about programming from it. But, no, that was not me who wrote those flying articles. And he was right about the small size of most cockpits.
Thank you Toml_12953 - I hope I’ll be able to add that code to my Dead Rockoning program sometime today. I’ll let you know if I get it working. - Jim

28 Jun 25
Toml - I got your code into my two Dead Reckoning programs and it works like a charm. It makes entering the input data so much easier! Thank you for your help. I’ve already changed out the two programs on my GitHub site. For those who are interested, that address is: (GitHub - UtahPilot/AviationPrograms: Aviation Programs and Spreadsheets) - Jim

Very nice! Here in the USA, the intended path of travel of a craft is spelled course. Coarse means rough. Is it different where you are?

Also,

If N1 = 1 Then GoTo PFM1
If N1 = 2 Then GoTo PFM2
If N1 = 3 Then GoTo PFM3
If N1 = 4 Then GoTo PFM4
If N1 = 5 Then GoTo PFM10
If N1 = 6 Then Cls :End

Could be replaced by

On N1 GoTo PFM1,PFM2,PFM3,PFM4,PFM10
If N1 = 6 Then Cls :End

But in MMBasic, the On X Goto is replaced by the select case.

Select case N1
    case 1
        goto PFM1
    case 2
        goto PFM2
.
.
.
    case else
        cls
        end
end select

It can be but doesn’t have to be replaced. I prefer the more compact ON-GOTO for some uses. As long as MMBasic supports it, I’ll use ON GOTO.

Toml - I live in the USA. I’m just a bad speller. I would have never made it out of college if it wasn’t for math. Thank you and rlauzon for the wonderful ā€˜hints’ in MMBasic! - Jim

In AircraftPerformance you have this:

If N1 = 1 Then GoTo PFM9
If N1 = 2 Then GoTo PFM1
If N1 = 3 Then GoTo Perform
GoTo Perform

This could be replaced by

If N1 = 1 Then GoTo PFM9
If N1 = 2 Then GoTo PFM1
GoTo Perform

since if N1 is not 1 or 2 it will go to Perform anyway.

Good catch, Tom! Thank you. - Jim