Hi Mike,
I am definitely still not master of thinBASIC SDK, but there are multiple ways.
The most appropriate one could be:
[code=thinbasic]
Function EV_AddEvent() As Ext
'Add ( functionName [,startTime [, eventType [,eventGroup [, activeFlag ]]]]) As eventID
LOCAL fname As STRING
LOCAL nParsed AS LONG
LOCAL startTime, eventType, eventGroup, activeFlag AS EXT
' -- Default values in case any of them not parsed from script
startTime = 1
eventType = 2
eventGroup = 3
activeFlag = 4
nParsed = thinBasic_Parse1StringXNumbers(0, 4, fname, startTime, eventType, eventGroup, activeFlag)
' <- code here ->
function = eventID
end function
[/code]
nParsed returns how many optional parameters were parsed, that can be handy sometimes.
The thinBasic_Parse1StringXNumbers handles the open parents/close parents automatically.
I did not tried it, but should work.
Bye,
Petr
EDITED, wrong order of parameters and wrong datatypes
Bookmarks