Is DEF FN not working in lang qb? Quick BASIC allows the user to define functions but FreeBASIC gives me an error when I try to compile a program with a DEF FN line.
fxm wrote:Among compiling options, you can use the option -exx (error checking with RESUME support + array bounds and null-pointer checking).
See documentation.
Ah! I looked through the docs but missed that. I tried -ex and then -exx but neither caught the out of data error.
Currently, FB has no way to detect common errors, such as accessing elements of arrays outside their bounds, trying to read past the end of data, and overflow to mention a few. This is counter to almost all other versions of BASIC. Would it be possible to add a switch to test for these errors? I kno...
Thanks for all the helpful replies! The problem *was* a stack overflow. I added -t 5000 to compiler options and an OPTION BASE 1 to the beginning of the program. I would have thought -exx would have caught the stack error. The answer to the matrix as given is 0 which was an unfortunate result since ...
The following program calculates the determinant of a matrix. In freeBASIC, the exe file crashes. I have -exx and -qb set. Could it be a stack overflow? I don't see a way to increase the stack size in FB. How would you do that? DECLARE FUNCTION DET(a()) LET N=3 DIM a(N,N) FOR r=1 TO N FOR c=1 TO N R...
If the VIEW is removed, it still doesn't work as expected. The DRAW statement should draw a line from the origin to the starting point before drawing the triangle. True, without VIEW the triangle is now in the correct position but the initial line is missing. FB seems to keep the pen off until the f...
In QB, the following program draws a white line from the upper left of the viewport then draws a white triangle that's overwritten by a red one. In FB, there's no connecting line and the triangles are not coincident. screen 8 view (.1*640,.1*200)-(.9*640,.9*200),,15 window(-2,-4)-(5,4) draw"m0,...
The code was just to illustrate that FB doesn't handle the error as it should. Instead it causes an XP error which it should never do. Why should FB handle the error? I, for one, would not want the overhead of a safety net. You run the program, it crashes, you find the problem, and you fix it. Seem...