The following warnings occurred:
Warning [2] Undefined array key 251956 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 251959 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 251960 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 251968 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 251985 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined variable $thread - Line: 295 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 295 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Trying to access array offset on value of type null - Line: 295 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 295 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined variable $fid - Line: 295 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 295 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 251960 - Line: 331 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 331 errorHandler->error_callback
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 304 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 251985 - Line: 331 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 331 errorHandler->error_callback
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 304 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined variable $theme - Line: 3 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 3 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Trying to access array offset on value of type null - Line: 3 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 3 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined variable $theme - Line: 3 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 3 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Trying to access array offset on value of type null - Line: 3 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 3 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined variable $lang - Line: 5 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 5 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Attempt to read property "messages_in_thread" on null - Line: 5 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 5 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks





Loops in Prime



#6

hello,

As a newbie here a couple of questions. I am developing a program to create corrected altitudes for barometric altimeters when the out side air temperature is less then 0'C.

EXPORT Corr_Temp(a_tmp, a_alt, f_alt)

BEGIN

HFormat:=1;
HDigits:=0;
HAngle:=1;

T:=a_tmp+.00198*a_alt;
C:=f_alt*(15-T)/(273+T-.5*.00198*(f_alt-a_alt));
F:=f_alt+C;
F:=10*ROUND(F/10);

MSGBOX("Corr Fix Alt = " +F);

END;

above is the code, rather simple and without a loop. You will notice the variables:

a_tmp
a_alt
f_alt

As you can see the program prompts for 3 variables. At the moment the program will only solve for a single f_alt at a time. What I would like to do is actually prompt for a total of five variables, the last three listed below will replace the f_alt single variable:

FAF
MDA
MAP

I can easily prompt for these variables by adding them to the Export section as follows:

EXPORT Corr_Temp(a_tmp,a_alt,FAF,MDA,MAP)

I would now like the routine to loop three times calling the old FAF and displaying the new FAF then calling the old MDA and then displaying the new MDA and finally calling the old MAP and then displaying the new MDA.

The output to be formatted like after the three loops are done:

Corrected FAF: xxxx
Corrected MDA: yyyy
Corrected MAP: zzzz

I know I need a 'for' loop command and have an idea for a local variable in the 'for' loop and a local variable for the new FAF,MDA,MAP.

So I would call FAF and store it in a local variable 'f' then run the routine, display the new FAF as above then at the end store the MDA in f and rerun the routine, displaying the new MDA then call and store MAP in f and run again.

Hope I have explained the problem. Any takers, as I am going to run this through my brain and try to solve it. Maybe someone can beat me to it!

oh yes, the other question. I have read that you can create your own apps based on your programs, and as Joe just posted, move apps to the front of the list. Can you change the icon for the app? I know how to create the app but not how to change the icon.

Cheers, Geoff


Edited: 2 Oct 2013, 11:37 a.m. after one or more responses were posted


#7

> Can you change the icon for the app?

For now, you have to use one of the already-existing icons. Whether a future firmware version will allow custom icons, or whether external development tools will be created for such things, remains to be seen. I'm keeping my fingers crossed!


#8

Joe, You are still up!!

That's what I read but I was hoping my manual was an older version!

Cheers

#9

What you want to do can be easily accomplished with an array. Since I do not have a Prime at hand, here's a solution in Visual Basic:

Function Corr_Temp(a_tmp, a_alt, FAF, MDA, MAP)
 
Dim ff(3), Message(3)
 
ff(1) = FAF
ff(2) = MDA
ff(3) = MAP
 
Message(1) = "Corrected FAF = "
Message(2) = "Corrected MDA = "
Message(3) = "Corrected MAP = "
 
For i = 1 To 3
f_alt = ff(i)
T = a_tmp + 0.00198 * a_alt
C = f_alt * (15 - T) / (273 + T - 0.5 * 0.00198 * (f_alt - a_alt))
f = f_alt + C
f = 10 * Round(f / 10, 0)
MsgBox Message(i) + Str$(f)
Next
 
End Function

Another (IMHO more elegant) option is a separate calculation function that is called three times:

Function Corr_Temp(a_tmp, a_alt, FAF, MDA, MAP)
x = Calculation(a_tmp, a_alt, FAF)
MsgBox "Corrected FAF = " + x
x = Calculation(a_tmp, a_alt, MDA)
MsgBox "Corrected MDA = " + x
x = Calculation(a_tmp, a_alt, MAP)
MsgBox "Corrected MAP " + x
End Function
 
Function Calculation(a_tmp, a_alt, f_alt)
T = a_tmp + 0.00198 * a_alt
C = f_alt * (15 - T) / (273 + T - 0.5 * 0.00198 * (f_alt - a_alt))
F = f_alt + C
F = 10 * Round(F / 10, 0)
Calculation = Str$(F)
End Function
Quote:
Hope I have explained the problem. Any takers, as I am going to run this through my brain and try to solve it. Maybe someone can beat me to it!

I hope so. ;-)

Dieter


#10

Thanks Dieter!

That's looks similar to tsolution on my 71b and completely forgot to check it!

I will convert the first one into equivalent Prime code as soon as I read up on matrices.

Cheers, Geoff

Edited: 2 Oct 2013, 10:47 a.m.


Possibly Related Threads…
Thread Author Replies Views Last Post
  39gii Tutorial: FOR loops is posted Eddie W. Shore 0 950 03-16-2013, 12:13 PM
Last Post: Eddie W. Shore
  Using loops and SOLVE together Matt Agajanian 5 1,624 03-25-2012, 09:02 PM
Last Post: bill platt
  Loops of Addition benchmark for the 41CL Monte Dalrymple 8 1,980 08-19-2010, 09:48 PM
Last Post: Wlodek Mier-Jedrzejowicz
  Loops of addition Palmer O. Hanson, Jr. 7 1,822 06-21-2010, 05:26 AM
Last Post: Don Shepherd
  Loops on 48GX V Green 3 1,133 04-25-2005, 05:53 AM
Last Post: Raymond Del Tondo
  loops V Green 3 1,124 02-12-2005, 03:21 AM
Last Post: Vieira, Luiz C. (Brazil)
  17BII and 19BII indefinite loops ? Vincent Weber 0 633 09-10-2004, 03:52 AM
Last Post: Vincent Weber

Forum Jump: