WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.


!! WIL SDK !!

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

How to Specify Optional Parameters in the WIL SDK


I was under the understanding that it was possible to pass optional parameters to SDK extenders, eg StrCat() must have optional parameters as its possible to pass severial strings?


Its all defined in the function table where you define your function name and the types of parameters it will accept.

Basically there is a 4 byte, 32 bit bumber there.

The top word (two bytes) are reserved and should be zero

The high order byte of the low order word is the number of optional parameters, and the low order byte of the low order word is the number of required parameters.

tablestruct CommandExtTable[] =
{10, FUNCTION, 0x0000000000000000, 0x00000101L, 9, "Function1" }, 
The fourth value (0x00000101L in the example above) tells how many parameters are expected. Digits 5 and 6 tell how many optional parameters, digits 7 and 8 tell how many required parameters.

For example...

0x00000001L, No optional, One required
0x00000102L, One optional, Two required 
0x00000F01L, Fifteen optional, One required 
0x00001000L, Sixteen optional. No required
Note that the limit is 16 parameters total, in any combination of required and optional.

In the function itself, the value "nArgCount" tells how many parameters were actually passed.

Article ID:   W16880
File Created: 2017:07:28:13:58:14
Last Updated: 2007:07:03:14:26:40