The #print typeof() output is unfortunately broken at the moment for z/wstring pointers. It includes the pointer size in bytes as the string length even though that does not make sense. I have only a partial fix for it so far...
Either way, zstring * N ptr is not valid FB syntax (at the moment).
If you use -r or -c, you can specify -m <filename-without-extension> to tell the compiler which *.bas file is the main module. __FB_ARGV__ is only available in the main module (in the implicit main() function).
dkl wrote:Yea, -m must be used at least for the main module if you're using -r or -c. That's not new though - for example, fbc 0.20 already behaved this way.
Didn't notice that, yet. Thanks for the information.
dkl wrote:The following should work (in the main module):
function BoxtypeAsString(byval boxtype as integer) as const zstring ptr
select case as const boxtype
case FL_NO_BOX : return @"FL_NO_BOX"
case FL_FLAT_BOX : return @"FL_FLAT_BOX"
case FL_UP_BOX : return @"FL_UP_BOX"
case FL_DOWN_BOX : return @"FL_DOWN_BOX"
case FL_UP_FRAME : return @"FL_UP_FRAME"
case FL_DOWN_FRAME : return @"FL_DOWN_FRAME"
case FL_THIN_UP_BOX : return @"FL_THIN_UP_BOX"
case FL_THIN_DOWN_BOX : return @"FL_THIN_DOWN_BOX"
case FL_THIN_UP_FRAME : return @"FL_THIN_UP_FRAME"
case FL_THIN_DOWN_FRAME : return @"FL_THIN_DOWN_FRAME"
case FL_ENGRAVED_BOX : return @"FL_ENGRAVED_BOX"
case FL_EMBOSSED_BOX : return @"FL_EMBOSSED_BOX"
case FL_ENGRAVED_FRAME : return @"FL_ENGRAVED_FRAME"
case FL_EMBOSSED_FRAME : return @"FL_EMBOSSED_FRAME"
case FL_BORDER_BOX : return @"FL_BORDER_BOX"
case FL_SHADOW_BOX : return @"FL_SHADOW_BOX"
case FL_BORDER_FRAME : return @"FL_BORDER_FRAME"
case FL_SHADOW_FRAME : return @"FL_SHADOW_FRAME"
case FL_ROUNDED_BOX : return @"FL_ROUNDED_BOX"
case FL_RSHADOW_BOX : return @"FL_RSHADOW_BOX"
case FL_ROUNDED_FRAME : return @"FL_ROUNDED_FRAME"
case FL_RFLAT_BOX : return @"FL_RFLAT_BOX"
case FL_OVAL_BOX : return @"FL_OVAL_BOX"
case FL_OSHADOW_BOX : return @"FL_OSHADOW_BOX"
case FL_OVAL_FRAME : return @"FL_OVAL_FRAME"
case FL_OFLAT_BOX : return @"FL_OFLAT_BOX"
case FL_ROUND_UP_BOX : return @"FL_ROUND_UP_BOX"
case FL_ROUND_DOWN_BOX : return @"FL_ROUND_DOWN_BOX"
case FL_DIAMOND_UP_BOX : return @"FL_DIAMOND_UP_BOX"
case FL_DIAMOND_DOWN_BOX : return @"FL_DIAMOND_DOWN_BOX"
case FL_PLASTIC_UP_BOX : return @"FL_PLASTIC_UP_BOX"
case FL_PLASTIC_DOWN_BOX : return @"FL_PLASTIC_DOWN_BOX"
case FL_PLASTIC_UP_FRAME : return @"FL_PLASTIC_UP_FRAME"
case FL_PLASTIC_DOWN_FRAME : return @"FL_PLASTIC_DOWN_FRAME"
case FL_PLASTIC_THIN_UP_BOX : return @"FL_PLASTIC_THIN_UP_BOX"
case FL_PLASTIC_THIN_DOWN_BOX : return @"FL_PLASTIC_THIN_DOWN_BOX"
case FL_PLASTIC_ROUND_UP_BOX : return @"FL_PLASTIC_ROUND_UP_BOX"
case FL_PLASTIC_ROUND_DOWN_BOX : return @"FL_PLASTIC_ROUND_DOWN_BOX"
case FL_GTK_UP_BOX : return @"FL_GTK_UP_BOX"
case FL_GTK_DOWN_BOX : return @"FL_GTK_DOWN_BOX"
case FL_GTK_UP_FRAME : return @"FL_GTK_UP_FRAME"
case FL_GTK_DOWN_FRAME : return @"FL_GTK_DOWN_FRAME"
case FL_GTK_THIN_UP_BOX : return @"FL_GTK_THIN_UP_BOX"
case FL_GTK_THIN_DOWN_BOX : return @"FL_GTK_THIN_DOWN_BOX"
case FL_GTK_THIN_UP_FRAME : return @"FL_GTK_THIN_UP_FRAME"
case FL_GTK_THIN_DOWN_FRAME : return @"FL_GTK_THIN_DOWN_FRAME"
case FL_GTK_ROUND_UP_BOX : return @"FL_GTK_ROUND_UP_BOX"
case FL_GTK_ROUND_DOWN_BOX : return @"FL_GTK_ROUND_DOWN_BOX"
case else : return @"UNKNOW_BOX_TYPE"
end select
end function
function BoxtypeAsString(byval boxtype as integer) as const zstring ptr
select case as const boxtype
case 0 : return @"FL_NO_BOX"
case 1 : return @"FL_FLAT_BOX"
case else : return @"UNKNOW_BOX_TYPE"
end select
end function
Could you post a small code example that triggers the issue? Then others could test it and see whether they can reproduce it.
By the way, which fbc build are you using? I thought the fbc.exe from 1.00.0 release all had 09-14-2014 build date, not 09-10-2014 (maybe it's from 1.00.0rc1?). (there weren't many changes between 1.00.0rc1 and 1.00.0, so that's probably not the problem... but what else could it be)
dkl wrote:I can't reproduce it; the following code compiles fine
Same here :lol:
I copied the latest version of "ftlk-c.bi" to folder "fltk-ide" and the warnings are gone.
The function BoxtypeAsString() is the same as before
but something was different in the older version of "ftlk-c.bi" and trigers the warning's.
I've just started a wiki page for binding creation issues: DevBindingCreation
First thing on there: data types. It might already answer your question regarding Integer vs Long. I'm sure I'll have more ideas what to write on this page ;)