Page 1 of 1 1
Topic Options
#98481 - 2003-02-18 12:40 AM Discussion: Task Scheduler Functions (1/16 : Header)
Sealeopard Offline
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 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.

Top
#98482 - 2003-02-18 12:42 AM Re: Discussion: Task Scheduler Functions (1/16 : Header)
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
[Eek!]
I'd remove all the UDFs and combine them.
they are all working the same stuff so there is NO NEED to use multiple UDFs...

me thinks...
_________________________
!

download KiXnet

Top
#98483 - 2003-02-18 12:49 AM Re: Discussion: Task Scheduler Functions (1/16 : Header)
MCA Offline
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.
_________________________
email scripting@wanadoo.nl homepage scripting@wanadoo.nl | Links | Summary of Site Site KiXforms FAQ kixtart.org library collection mirror MCA | FAQ & UDF help file UDF kixtart.org library collection mirror MCA | mirror USA | mirror europe UDF scriptlogic library collection UDFs | mirror MCA

Top
#98484 - 2003-02-18 12:56 AM Re: Discussion: Task Scheduler Functions (1/16 : Header)
MCA Offline
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.
_________________________
email scripting@wanadoo.nl homepage scripting@wanadoo.nl | Links | Summary of Site Site KiXforms FAQ kixtart.org library collection mirror MCA | FAQ & UDF help file UDF kixtart.org library collection mirror MCA | mirror USA | mirror europe UDF scriptlogic library collection UDFs | mirror MCA

Top
#98485 - 2003-02-18 01:00 AM Re: Discussion: Task Scheduler Functions (1/16 : Header)
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
I don't mind that and normal users of the board most likely will not even see it.

actually, as it's possible to call a function from another function, glenn could write this as UDF-library:
myfunction.mysomesubfunction($arg)

but I still insist those 16 UDFs to be combined in one as it's easily done.
_________________________
!

download KiXnet

Top
#98486 - 2003-02-18 01:46 AM Re: Discussion: Task Scheduler Functions (1/16 : Header)
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4402
Loc: New Jersey
Um - guys..

Yes, they are ALL related!! [Wink]

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 [Big Grin] ) 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! [Big Grin]

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!!! [Roll Eyes]

See the beginning of the test code in post 15.

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#98487 - 2003-02-18 02:16 AM Re: Discussion: Task Scheduler Functions (1/16 : Header)
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
eh, what is that word html stuff you are talking about?
kix has nothing to do with them
_________________________
!

download KiXnet

Top
#98488 - 2003-02-18 02:42 AM Re: Discussion: Task Scheduler Functions (1/16 : Header)
MCA Offline
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.
_________________________
email scripting@wanadoo.nl homepage scripting@wanadoo.nl | Links | Summary of Site Site KiXforms FAQ kixtart.org library collection mirror MCA | FAQ & UDF help file UDF kixtart.org library collection mirror MCA | mirror USA | mirror europe UDF scriptlogic library collection UDFs | mirror MCA

Top
#98489 - 2003-02-18 03:34 AM Re: Discussion: Task Scheduler Functions (1/16 : Header)
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4402
Loc: New Jersey
Yes, exactly. I have some MS-Word docs that describe the functions and have examples. PostPrep doesn't seem to be helpful for that.

The HTML that word produces is useless for this BBS' purpose - too many styles and other META definitions.

Is there any way to attach a binary file, like a ZIP, to a message so that docs and such can be distributed in a native format?

Thanks

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#98490 - 2003-02-18 03:37 AM Re: Discussion: Task Scheduler Functions (1/16 : Header)
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Nope, there's no way, unfortunately.
_________________________
There are two types of vessels, submarines and targets.

Top
#98491 - 2003-02-18 03:45 AM Re: Discussion: Task Scheduler Functions (1/16 : Header)
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
I still don't get it.

where do common man (common admin) need any shit like word?
it's just fancy interface for notepad with some add-ons...

I still don't get it, how word is in anyway related to kixing? or real-life?
_________________________
!

download KiXnet

Top
#98492 - 2003-02-18 05:04 PM Re: Discussion: Task Scheduler Functions (1/16 : Header)
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4402
Loc: New Jersey
Lonkero:

Word makes pretty (and in our environment, portable) documents.

I work for a Government organization with 14 other admins. Before I deploy any script more than 5-6 lines long (considering we have a 3 line header!) I have to write a document that describes how it is used, and it has to be circulated and reviewed before we implement it throughout the system infrastructure. Sometimes we even need to have our security group review it.

Anyway, I was trying to post those docs here in a nice looking format - html - but exporting from word got ugly real fast. Plain text is OK, but you scripting types would do just as well with reading the code & comments. Most of our admins don't script, so the docs are a MUST!

Bottom line - if anyone wants the docs - or even the whole package zipped up, I'd be happy to email it to them.

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
Page 1 of 1 1


Moderator:  Arend_, Allen, Jochen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 583 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.064 seconds in which 0.027 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org