Search found 603 matches

by VirusScanner
Feb 03, 2009 4:18
Forum: Community Discussion
Topic: FreeBasic in GCC?
Replies: 23
Views: 4281

I don't think it would be, since the current C backend doesn't emit C++, only plain C, and since current FB has everything plain C does (as far as I know), there would be no reason to have features in only C mode.
by VirusScanner
Jan 15, 2009 0:01
Forum: Community Discussion
Topic: Expanded "IF" Functionality
Replies: 17
Views: 3338

When you compare things like if somefn() = a orelse somefn() = b somefn is evaluated twice (as long as its result is not equal to a), which is sometimes not desirable. If we eliminated the need to retype it, you would not be able to see that as clearly in the code. As it is, if you d...
by VirusScanner
Dec 09, 2008 2:41
Forum: General
Topic: Setting EXE information
Replies: 5
Views: 1191

You use resource files for this: see http://webster.cs.ucr.edu/AsmTools/GoAsm/Doc/RESOURCE.HTM under "versioninfo resources". You will need to create a .rc file that includes that versioninfo block, and then pass that to fbc along with your .bas files. Resource files are also the way to add icons to...
by VirusScanner
Nov 16, 2008 18:06
Forum: Community Discussion
Topic: MOCKUP of FreeBASIC 1.0 Goals
Replies: 52
Views: 11466

After reading all this talk of rewriting FB from the ground up, something comes to mind: I've started many (probably >100) projects that never got finished because I decided it would be better to write it in another language, or I couldn't understand the code because I'd been away from it too long, ...
by VirusScanner
Nov 16, 2008 17:50
Forum: Community Discussion
Topic: Is FreeBasic original?
Replies: 4
Views: 1475

I've seen something like this before. I believe v1ctor knew of a dead project also called FreeBASIC before starting this one, but I don't think the real FB is based off that one (besides maybe the fact that it compiles QB code).
by VirusScanner
Jun 07, 2008 23:25
Forum: General
Topic: A little problem with oop...
Replies: 7
Views: 1871

Your original code will work if you use DIM SHARED.
by VirusScanner
Jan 05, 2008 5:17
Forum: General
Topic: Pointers
Replies: 84
Views: 13557

I think there's a valid point here. I personally am in favor of getting rid of all loop statements also, as they are unneeded. Instead, we can replace them with the much more traditional looking (and easier to understand...?) line numbers and GOTO. For example, this (bad) code: for i as integer = 0 ...
by VirusScanner
Jan 05, 2008 4:45
Forum: Beginners
Topic: Easy WinAPI declaration (like Visual Basic)
Replies: 6
Views: 2118

Literal strings are ZSTRING type, not STRING, so passing them to any pointer parameter doesn't need STRPTR.
by VirusScanner
Dec 30, 2007 4:47
Forum: Libraries
Topic: C header conversion, need clarification
Replies: 5
Views: 2260

New returns a pointer. You want

Code: Select all

private function cpv( byval x as const single, byval y as const single ) as cpVect
  return type<cpVect>( x, y )
end function
by VirusScanner
Dec 28, 2007 0:16
Forum: Libraries
Topic: porting libraries
Replies: 9
Views: 2940

You wrote this:
#inclib "libChipmunk.a"

You should write this:
#inclib "Chipmunk"

The linker automatically adds the "lib" and the ".a", so the way you're doing it it will look for liblibChipmunk.a.a, which will obviously not be found.
by VirusScanner
Nov 30, 2007 0:26
Forum: General
Topic: swig help
Replies: 3
Views: 1557

In C, it's defining character constants, not strings. This is correct:

Code: Select all

#define K_BS     asc(!"\b")
#define K_CR     asc(!"\r")
by VirusScanner
Nov 30, 2007 0:21
Forum: General
Topic: using const
Replies: 10
Views: 2369

integer: Using const variables/parameters doesn't waste any stack space, or any other memory. What it does do is force you not to modify that variable, which is actually very useful because in large projects sometimes you can do things you didn't want to, and it helps the compiler to catch these pro...
by VirusScanner
Nov 26, 2007 5:49
Forum: General
Topic: Error message for wrong argument type?
Replies: 2
Views: 1269

For number types, the standard is that if you aren't going to lose any precision (byte to integer, integer to single, single to double, etc), the types can be converted for you. I didn't know it worked for arrays too, though.
by VirusScanner
Oct 30, 2007 3:14
Forum: General
Topic: return a function with array
Replies: 5
Views: 1709

I added this to the sourceforge tracker a little while ago ( http://sourceforge.net/tracker/index.ph ... tid=693199 ) but as there is an easy workaround already, it's not top priority.
by VirusScanner
Oct 30, 2007 3:08
Forum: General
Topic: Bug finding game!
Replies: 6
Views: 2179

I think one of the main reasons is C++ compatibility. FB aims to be as close to compatible as possible with GCC/G++, and since most well-written C++ libraries use the const attribute (and it is a part of the mangling), it is needed.

Go to advanced search