In upper right corner "Help" "Error Codes" shows only 17 codes. When activating a calculation-program I encountered codes 95 and 97. Where
to find those? The accompanying text (97) is: Branch crossing local array, var-len ... . What does that mean? And how to deal with such an error?
Where to find an instruction manual with error codes? My Free Basic IDE is: ver. 0.4.6, date Feb 19, 2006, wxW.: 2.6.2.
I encountered the above problems when I tryed to run my program. I wanted the program to GOTO a part of the program. This part is a seperate
program which I have copied into the main program. A GOTO for get back to main program is also there. Both the main program and extension program work fine before "joining". None of the two programs contains references to external sources. The main program is approximately 5000
lines, the extension program is only 100 lines. I have with success copied this extension program (Lagrange interpolation) into other programs.
I am looking forward reply
Yours sincerely
Niels Olsen
Error code, etc.
-
- Posts: 29
- Joined: May 28, 2006 18:32
- Location: denmark
Re: Error code, etc.
Try compiling with the "-exx" option. That might give you more details.
Re: Error code, etc.
Last edited by badidea on Jun 11, 2018 18:05, edited 1 time in total.
Re: Error code, etc.
Simple example inducing such an error message:
error 105: Branch crossing local array, var-len string or object definition, to label: LABEL, local string: S
- Easy solution if that works:
Try to compile your program in -lang qb or -lang fbliteOK
- If your program cannot be compiled in -lang qb or -lang fblite, the solution is less obvious.
Code: Select all
goto label
dim as string s
label:
- Easy solution if that works:
Try to compile your program in -lang qb or -lang fblite
Code: Select all
#lang "qb" '' or #lang "fblite"
goto label
dim as string s
label:
- If your program cannot be compiled in -lang qb or -lang fblite, the solution is less obvious.
-
- Posts: 29
- Joined: May 28, 2006 18:32
- Location: denmark
Re: Error code, etc.
Dear Sirs,
I thank you very much for your help. I learned something about Freebasic.
My problem was solved by using #lang "fblite".
Yours sincerely
Niels Olsen
I thank you very much for your help. I learned something about Freebasic.
My problem was solved by using #lang "fblite".
Yours sincerely
Niels Olsen
-
- Site Admin
- Posts: 6323
- Joined: Jul 05, 2005 17:32
- Location: Manchester, Lancs
Re: Error code, etc.
If you want to keep it compiling in the default dialect, then you can probably fix it by rearranging the code so that the Dim statements appear earlier in the code, e.g. with fxm's example:
(If the Dim initialises 's', it would mean moving the Dim but keeping the assignment where it is.)
Or maybe you can limit the scope of 's' to the place it's used:
Code: Select all
dim as string s
goto label
[s = ...]
...
label:
Or maybe you can limit the scope of 's' to the place it's used:
Code: Select all
goto label
scope
dim as string s
...
end scope
label: