Qbasicnews.com

Full Version: Optional function parameters?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
This has probably already been covered, but I was wondering if FB supports optional function parameters. Doesn't seem to...if not, is it going to be implemented? It would really help in converting this header I'm working on but it's no big deal really...

Umm...
Quote:C:\freeBASIC-v0.02b-win32\freeBASIC\bin\ld.exe: cannot find -ladvapi32.dll
Looks like it's taking away a space when trying to reference a dll...?
The OPTIONAL keyword doesn't exist, if you mean that - like in VB.

You can declare any argument as optional doing: "arg as somenumerictype = someconstantexpression", just "OPTIONAL arg as sometype" as in VB won't work.


Just a few import libraries are in the /lib's dir, advapi32 wasn't added - all imp libs come from Mingw32, you can just copy them from Mingw's library dir.

LD is a bit weird when passing library names, if the import library is named "libadvapi32.dll.a" (note: all libs must start with "lib" and have the ".a" extension), to include that lib you have to pass the "-l advapi32" option to fbc (w/o quotes). Or if you ported parts of its header and created an advapi32.bi include file, just add the directive '$inclib: "advapi32" to it, fbc will add that library to the list when calling GNU's linker (LD).
I guess I better pick up a copy of mingw then. Big Grin

Hrm...looks like it causes Windows to go crashy-crashy.

Okay...no idea why it's not working, but...oh well. The app seems to crash on RegOpenKey in advapi32.