Search code examples
c#qbasicgw-basic

QBASIC: Execution of a GOTO Line if Condition Is Not Met


I am converting GW-BASIC code to C# and have very limited experience in BASIC languages in general. I am trying to understand how IF...THEN...GOTO statements behave. For example, I have the following statement:

85 IF M(3,1)>M(2,1) THEN 95
90 M(3,1)=M(3,1)+P2
95 Z1=R1*(90.567-41.685/M(2,3))

My question is this: if the condition at line 85 is not met, will it still execute code at line 95, or does it skip it?

Any direction would be greatly appreciated...


Solution

  • Yes, regardless of the evaluation of the Boolean condition at line 85, line 95 will be executed BUT if 85 evaluates to true, then line 90 will be jumped and thus won't be executed.