Search found 27 matches

by toml_12953
Aug 30, 2019 22:49
Forum: Windows
Topic: DEF FN Not Working?
Replies: 2
Views: 4521

DEF FN Not Working?

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.

Code: Select all

10 def fna(x)=4*x
error 10: Expected '=', found 'fna'
10 def fna(x)=4*x
by toml_12953
Jan 19, 2010 14:34
Forum: General
Topic: Option for detecting errors
Replies: 2
Views: 953

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.
by toml_12953
Jan 19, 2010 14:18
Forum: General
Topic: Option for detecting errors
Replies: 2
Views: 953

Option for detecting errors

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...
by toml_12953
Aug 12, 2008 8:01
Forum: General
Topic: QB-compatibility: ON ERROR GOTO <label>
Replies: 2
Views: 2144

QB-compatibility: ON ERROR GOTO <label>

The same problem exists in the 0.20b Windows version.
by toml_12953
Aug 11, 2008 14:06
Forum: Beginners
Topic: Converting program from QBasic to FreeBasic help
Replies: 3
Views: 2005

Syntax Errors

Try upgrading to .20

Code: Select all

If 1 Then Print "? ", Else Print "2"
If 1 Then Print "? "; Else Print "2"
seems to work in the latest version.
by toml_12953
Feb 13, 2008 2:12
Forum: General
Topic: FB Insomnia (no SLEEP)
Replies: 3
Views: 1479

No SLEEP

No, I'm not using a GFX mode and I am using 18.3. My machine is a 2.66 GHz Core 2 Duo w/4 GB RAM running Vista Ultimate 32-bit.
by toml_12953
Feb 13, 2008 1:57
Forum: General
Topic: FB Insomnia (no SLEEP)
Replies: 3
Views: 1479

FB Insomnia (no SLEEP)

The following doesn't keep the output window on the screen at all

SLEEP

but

SLEEP n (where n > 0)

does. I'm using -lang qb, BTW.
by toml_12953
Feb 13, 2008 1:11
Forum: General
Topic: freeBASIC Error?
Replies: 7
Views: 1896

FB Bug?

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 ...
by toml_12953
Feb 12, 2008 20:51
Forum: General
Topic: freeBASIC Error?
Replies: 7
Views: 1896

freeBASIC Error?

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...
by toml_12953
Feb 07, 2008 18:42
Forum: Beginners
Topic: For...Next loop with Arrays
Replies: 18
Views: 4460

FOR...NEXT variable use

There's a good reason for being able to use the value of the index variable outside the loop:


FOR i=1 TO 10
IF a(i) = TestVal THEN EXIT FOR
NEXT i
IF i< 11 THEN ' We found a match

This saves having to use a flag.
by toml_12953
Jun 12, 2007 18:19
Forum: General
Topic: Not operator should work like a Function, not like this.
Replies: 11
Views: 2558

Not Operator

If fb !qb then could you say

NOT fb=qb

?
by toml_12953
Jun 05, 2007 15:22
Forum: General
Topic: FB Bug
Replies: 10
Views: 3231

Delete VIEW

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...
by toml_12953
Jun 05, 2007 12:42
Forum: General
Topic: FB Bug
Replies: 10
Views: 3231

FB Bug

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,...
by toml_12953
Jun 18, 2006 19:03
Forum: General
Topic: Bug
Replies: 13
Views: 3782

Re: BUG

[quote="tunginobi]

@toml_12953: Compile with -exx.[/quote]

I know that's what is necessary but my point is it shouldn't be necessary to prevent FB from causing a Windows error.
by toml_12953
Jun 17, 2006 3:03
Forum: General
Topic: Bug
Replies: 13
Views: 3782

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...