Sign in to follow this  
Guest ridgell

example of a 'goto' statement

Recommended Posts

it is mentioned breifly in the panel sdk under order of exectution for operators."The

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

Hi,I've just thought of this simple piece of code as an example 100 90 80 70 60 5 @1 case 4 s0 :0 @Test( l0 ) d (>G:Var1) 75 > if{ l0 -- s0 g0 } Now, (G:Var1) will return 80As you can see, "goto" operators are very powerful when you need to extract values from tables.Tom

Share this post


Link to post
Share on other sites

way over my head tom. i guess i should have prefaced my question "can you explain to an idiot how to use a goto statement" my only exposure to programing is the xml stuff in fs9. except for some basic in collage, before you were born. bit operators ( thinking thats what you wrote) are swahili to me.heres what im trying to do.made a hud controler, i have a on/off switch that is on a side panel. i have a 'c' gauge from doug dawson that lets me monitor the status of the screens defined in the panel config from an xml program. got that working and being a glutton for punishment, now i want to add more hud windows for various brightness settings. i have to qualify is the switch on, am i in the forward screen so i can PANEL_ID_TOGGLE , is the hud screen that matches the brightness switch on/off, then turn the correct hud on/off to match the switch, make sure the other huds are off. with the addition of 3 more hud screens the qualifing is getting nasty to a non programer. with a 'goto' i could knock of multiple steps. i guess im thinking more of a 'goto' like in basic. if xxxx then skip down farther down the gauge to line so&so or some flag. then i will not have to ask the same thing over and over again in every line of code.(L:switchon,bool) if{bla bla}(L:switchon,bool) if{ladeeda}(L:switchon,bool) if{something yet again}what i need(L:switchon,enum) 0 == "SKIP TO brother the darn things off "

Share this post


Link to post
Share on other sites

ridgell,When I was in college, Fortran was the vedette and PC+Basic just newborns.If you want to use "goto" as a jump to avoid some code execution, try something like:(Code_a) if{ g0 } (Code_:( (blabla)(Code_c) (blabla):0(Code_d)(Code_e)If condition in Code_a is met, program jumps to :0 label;Code_b and Code_c are ignored, and processing continues from Code_d on.Now, in case you want to terminate processing inside the , you may as well replace "goto" for "quit", like:(Code_a) if{ quit } (Code_:( (blabla)(Code_c) (blabla)Here Code_b, Code_c, etc are ignored too.Hope to be clear enough this timeTom

Share this post


Link to post
Share on other sites

wow! thats what i was looking for in a nutshell!thanks Tomill paste in my bag of tricks folder. thought pascal came later-- i graduated in 72. we were playing with basic and assembly at UTexas

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this