#98481 - 2003-02-18 12:40 AM
Discussion: Task Scheduler Functions (1/16 : Header)
|
Sealeopard
KiX Master
   
Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
|
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 becode:
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.
|
|
Top
|
|
|
|
#98483 - 2003-02-18 12:49 AM
Re: Discussion: Task Scheduler Functions (1/16 : Header)
|
MCA
KiX Supporter
   
Registered: 2000-04-28
Posts: 5152
Loc: Netherlands, EU
|
Dear Lonkero,
A good suggestion. We will wait with our daily update of this part. greetings.
|
|
Top
|
|
|
|
#98484 - 2003-02-18 12:56 AM
Re: Discussion: Task Scheduler Functions (1/16 : Header)
|
MCA
KiX Supporter
   
Registered: 2000-04-28
Posts: 5152
Loc: Netherlands, EU
|
Dear Lonkero,
FYI
Removing the topics before entering the combined one prevents a jump in the forum numbering. Previous week another unwanted topic on UDF forum was removed and that number was assigned to another new topic. greetings.
|
|
Top
|
|
|
|
#98486 - 2003-02-18 01:46 AM
Re: Discussion: Task Scheduler Functions (1/16 : Header)
|
Glenn Barnas
KiX Supporter
   
Registered: 2003-01-28
Posts: 4402
Loc: New Jersey
|
Um - guys..
Yes, they are ALL related!!
This was indended to be all in ONE udf file.. a Library of Functions, if you will...
I took the suggestion of posting them independently because of the size of the UDF file was over 1000 lines. Separate function posts would be easier to review and discuss as well. If you read the first post, it suggests that the user combine the code from each of the first 14 posts back into one file to read in.
Jens:
I considered that, but chose to put the definition in the header (since <I> had them all in one file ) to make them easier to maintain. The 4 global vars (as constants) are used by multiple functions. Since the JT command appears to be a "work in progress" with some parameters not working, I figured that I'd be updating the parameter lists someday and didn't want to do it in multiple functions.
Lonkero:
As above, they are all in one file.. I'm not sure what advantage the sub-function concept would provide. Also, If you combine all 16 posts, you'll get no end of syntax errors when Kix encounters the MS-Word/HTML document!
Finally, I think that if you combine the code and try the sample, you will all have a clearer understanding of how this works... Sheesh! I'd never write something that made you load 14 separate yet inter-related UDF files!!!
See the beginning of the test code in post 15.
Glenn
_________________________
Actually I am a Rocket Scientist!
|
|
Top
|
|
|
|
#98488 - 2003-02-18 02:42 AM
Re: Discussion: Task Scheduler Functions (1/16 : Header)
|
MCA
KiX Supporter
   
Registered: 2000-04-28
Posts: 5152
Loc: Netherlands, EU
|
We think he is talking about a nice way of presenting the documentation on this forum. Possible inspired with PostPrep possibilities. greetings.
|
|
Top
|
|
|
|
Moderator: Arend_, Allen, Jochen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Mart
|
1 registered
(StuTheCoder)
and 798 anonymous users online.
|
|
|