Page 1 of 1

Posted: Tue Jul 09, 2002 7:58 pm
by BackupUser
Restored from previous forum. Originally posted by El_Choni.

Hi,

This question is for Fred or Danilo, but if anybody else has an answer, I'll be glad to hear it. The question is: how can I make a User library function accept a variable parameter number, like StrF() or CallCOM()?

Thanks a lot. Bye,

El_Choni

Posted: Tue Jul 09, 2002 8:25 pm
by BackupUser
Restored from previous forum. Originally posted by fred.

Just use the following syntax in your .DESC:

Code: Select all

AddGadgetItem, Long, Long, String, [Long],            (#Gadget, Position, Text$ [, ImageID]) - Add an item to a gadget (ListView, ComboBox etc...)
None | DebuggerCheck
And build 2 functions:

PB_AddGadgetItem : This one takes 3 parameters
PB_AddGadgetItem2 : This one takes 4 parameters

If you need more optional parameter, it's possible:

Code: Select all

CallFunction, Long, String, [Long], [Long], [Long]...
Then you will have:

PB_CallFunction : 2 params
PB_CallFunction2 : 3 params
PB_CallFunction3 : 4 params
....

And you can even group optionnal params:

TestFunction, Long, [Long, Long], [Long]...

You will have:

PB_TestFunction: 1 param
PB_TestFunction2: 3 params
PB_TestFunction3: 4 params

I hope this help !

Fred - AlphaSND

Posted: Wed Jul 10, 2002 3:18 am
by BackupUser
Restored from previous forum. Originally posted by El_Choni.
I hope this help !
You wouldn't know how this helps! Thank you,

El_Choni

Posted: Wed Jul 10, 2002 6:06 am
by BackupUser
Restored from previous forum. Originally posted by Danilo.

El_Choni

I explained all this some time ago by e-mail
and it should be clear how to use it.
Remember?

cya,
...Danilo

(registered PureBasic user)

Posted: Wed Jul 10, 2002 3:25 pm
by BackupUser
Restored from previous forum. Originally posted by El_Choni.

I'm very sorry, I don't remember that e-mail. I must have overlooked it. Sorry to waste your time, I promise I'll remember how to code the Desc file now :wink:

Thanks,

El_Choni