|
Post by DJLinux on Jun 10, 2007 11:45:52 GMT -5
how i can implement a function in a dll usable from B4GL with a variable number of args?
anyfunction(param1, ...)
Joshy
|
|
|
Post by Tom Mulgrew on Jun 11, 2007 3:37:12 GMT -5
Hmm...
Basic4GL doesn't really have anything like C++'s "..." feature.
You can fake it a little bit by overloading the same function name.
A bit like going:
void myFunction(int p1); void myFunction(int p1, int p2); void myFunction(int p1, int p2, int p3); ...
in C++.
So if there was some reasonable upper limit to the number of parameters your function has, you could just create that many versions of the function.
-Tom
|
|
|
Post by DJLinux on Jun 11, 2007 4:52:34 GMT -5
hello tom you mean B4GL will select the right function (with same name) based on it's number of args?
Joshy
|
|
|
Post by Tom Mulgrew on Jun 11, 2007 20:53:44 GMT -5
hello tom you mean B4GL will select the right function (with same name) based on it's number of args? Yes.
|
|
|
Post by James :) (aka Madcow) on Oct 12, 2007 11:17:41 GMT -5
could you show an example.
|
|