Glenn:

Nice UDFs coming along.

However, I'd rather move the global variables into the UDfs in such a way that they will be defined automatically. An example could be
code:
Function tsInitTask(OPTIONAL $NullFlag)
; initializing global variables
if not vartype($TASKPARMS)
global $TASKPARMS
$TASKPARMS = "ApplicationName","Parameters","WorkingDirectory","Comment","Creator",
"Priority","MaxRunTime","Idle","DontStartIfOnBatteries","KillIfGoingOnBatteries",
"RunOnlyIfLoggedOn","SystemRequired","DeleteWhenDone","Suspend","StartOnlyIfIdle",
"KillOnIdleEnd","RestartOnIdleResume","Hidden","Interactive","HaltOnError"
endif
if not vartype($TRIGCODES)
global $TRIGCODES
$TRIGCODES = "SDTEDTSTMDURINTHEDKADDISTYPARG"
endif
if not vartype($TRIGPARMS)
global $TRIGPARMS
$TRIGPARMS = "StartDate","EndDate","StartTime","MinutesDuration","MinutesInterval",
"HasEndDate","KillAtDuration","Disabled","Type","TypeArguments"
endif

If $NullFlag <> ""
; return an array with null values
$tsInitTask = "","","","","","","","","","","","","","","","","","","","","",""
Exit 0
EndIf

; return an array with default values
$tsInitTask = "RQ","","%SYSTEMDRIVE%\TEMP","Task created with tsTool","@USERID","NORMAL", \
"3600000","10 60","0","0","0","0","0","0","0","0","0","0","0","0","default","default"

Exit 0

EndFunction

This way, the variables are always created and the user will not have to worry abut this.
_________________________
There are two types of vessels, submarines and targets.