#98467 - 2003-02-17 10:50 PM
Cold, 18+ inches of snow.. perfect coding day
|
Glenn Barnas
KiX Supporter
   
Registered: 2003-01-28
Posts: 4402
Loc: New Jersey
|
As the topic shows, I've been snowed in - in front of the computer - so I decided to get busy with a function library. 1030 lines later, plus 300+ lines of test & example code.. well.. is this too much to post here?
I was inspired by Jens' ScheduleTask UDF and, faced with a need to remotely deploy scheduled tasks on a few hundred servers, wrote a library of UDFs to interface with the task scheduler. 12 functions (and lots of coffee) later, I can create, edit, or delete any type of task, and query the server for information about existing tasks.
Any interest in seeing it? If so, what about guidelines or suggestions for posting such a large block of code? I also have Word docs for the JT.exe tool and the function library (yes, it's been a LOOONG weekend!).
Regards,
Glenn
_________________________
Actually I am a Rocket Scientist!
|
|
Top
|
|
|
|
#98468 - 2003-02-17 10:55 PM
Re: Cold, 18+ inches of snow.. perfect coding day
|
Howard Bullock
KiX Supporter
   
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
Give them a common naming scheme like: quote: DBCommand DBConnClose DBConnOpen DBExecuteSQL DBGetRecordset DBRecordsetClose DBRecordsetOpen
Post individual UDFs to the UDF library. See the format there.
|
|
Top
|
|
|
|
#98471 - 2003-02-17 11:10 PM
Re: Cold, 18+ inches of snow.. perfect coding day
|
Glenn Barnas
KiX Supporter
   
Registered: 2003-01-28
Posts: 4402
Loc: New Jersey
|
OK - they already do. I guess that it's important to note that as a "library", there are a few "global" definitions that are shared by all functions, so they can't really be used one at a time. I can certainly post them that way, and it would make it easy to discuss each function..
Before I get beat up about "globals".. I decided on a global var to route the output of the shell commands to a common place so it would be easy to debug - or dump to the bit-bucket - universally. Also, four functions share a pair of text strings - a Global Constant would have been better, but.. next release.
So, that said, I suppose I can post the header and global/constant definitions, then post the remaining functions, and finally the code samples.
It's still snowing fast & furious - I'll post some after dinner, after maybe a chance to get and digest some other feedback.
Glenn
Code tags? You want me to make this easy for you? ![[Big Grin]](images/icons/grin.gif) [ 17. February 2003, 23:53: Message edited by: Glenn Barnas ]
_________________________
Actually I am a Rocket Scientist!
|
|
Top
|
|
|
|
#98473 - 2003-02-18 02:07 AM
Re: Cold, 18+ inches of snow.. perfect coding day
|
Howard Bullock
KiX Supporter
   
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
The last time I spoke with anyone the rule was to only post a single UDF per thread. I think that rule still exists.
I think that lonkero would like to to see all 16 pieces of code combine into one UDF not one post of 16 UDFs.
If I can put works in his mouth, he is thinking that there should be one function to manipulate TaskScheduler. Not sure if it is doable since I have not read through your code yet.
I know that Sealeopard has 7 DB related UDFs that are NOT combined into one. Not sure why Lonkero has such strong feelings at this time.
Lonkero, correct me if I spoke incorrectly.
|
|
Top
|
|
|
|
#98476 - 2003-02-18 02:26 AM
Re: Cold, 18+ inches of snow.. perfect coding day
|
Sealeopard
KiX Master
   
Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
|
With regards to the DB UDFs. There's one all-encompassing UDF, which is DBCOMMAND().
However, sometimes you want to execute multiple database actions, thus you need to open the database, execute a SQL statement, retrieve a recordset based on the previous actions, and then you need to close the database connection. Therefore, the UDF collection provides you with the ability to interact on multiple (actually three) levels, depending on yoru requirements.
It might be possible to condense the task scheduler UDFs by functionality, e.g. one to add/modify/delete a task, one to add/modify/delete a trigger,... [ 18. February 2003, 02:27: Message edited by: sealeopard ]
_________________________
There are two types of vessels, submarines and targets.
|
|
Top
|
|
|
|
Moderator: Arend_, Allen, Jochen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 1636 anonymous users online.
|
|
|