Qbasicnews.com

Full Version: Function pointer request
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Code:
type psuitype
    arg1 as uinteger ptr
    arg2 as uinteger
    funcarg as function (arg1 as integer, ...) as integer
    moreargs as uinteger
end type
Or something simillar, so we dont have to use the same amount of args in each function we want to pass..

Also, how about a (...), to allow for no passed args..
Code:
declare sub foo(...)
would be cool yeah. also a way to get argument count?
Quote:- variable-arguments, as in C: "sub foo(byval bar as integer, ...)" (v1c)
Quote: VA_FIRST() macro (returns a pointer to the first variable-argument)
VA_ARG(a,t) macro (returns the current var-arg, a= argument, t= argument type)
VA_NEXT(a,t) macro (returns a pointer to the next var-arg, a= current argument, t= current argument type)

Is this what you want? (version 0.13)
I know about those crappy, evil, retarded functions.. yes..

I would like to point everyone to this:
Quote:- variable-arguments, as in C: "sub foo(byval bar as integer, ...)" (v1c)
FreeC ?

I made another topic about it..



Anyways, read my post again.. you cant have varargs in function pointer type thingy..

Nor can you have empty varargs..


EDIT: http://forum.qbasicnews.com/viewtopic.php?t=9578 :lol:
Hmmm, you're right... that doesn't make any sense, especially the 'only ...' version.

And they're not crappy, evil, or retarded, and neither is C, and FreeBASIC is not FreeC, but that's been done to death already, so you can do your little victory dance or whatever...
Read my other topic..