Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Windows Task Scheduler
Message
De
06/01/2015 09:53:37
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Allemagne
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01613154
Message ID:
01613160
Vues:
66
>>Hey all
>>
>>I'm working with the Windows Task Scheduler and I've seen something weird.
>>
>>service=createobject("schedule.service")
>>service.connect()
>>rootfolder=service.getfolder()
>>oTasks=rootfolder.gettasks(0)\
>>FOR EACH task in oTasks
>> IF task.path == "some task"
>> oTask = task
>> ENDIF
>>ENDFOR
>>
>>oTaskDef = oTask.Definition
>>oTrigger = oTaskDef.Triggers.Item[1]
>>
>>
>>The kind of trigger may be Daily, Weekly, Monthly and will have various properties.
>>
>>oTrigger.DaysInterval has to exist on a daily trigger, but not on a weekly trigger.
>>
>>I tried with PEMSTATUS()
>>
>>IF PEMSTATUS(oTrigger,"DaysInterval",5)
>> ADDPROPERTY(poParms,"DaysInterval",oTrigger.DaysInterval)
>>ENDIF
>>
>>
>>It never detects the DaysInterval even on the Daily trigger.
>>
>>I ended up using TRY like this
>>
>>TRY
>> ADDPROPERTY(poParms,"DaysInterval",oTrigger.DaysInterval)
>>CATCH TO loError
>>ENDTRY
>>
>>
>>But I would like to know how to apply pemstatus and why it doesn't work for education's sake.
>>
>>Thanks
>
>Not sure that PEMSTATUS works for every object that is not VFP native one.
>How about type?
>
>IF TYPE("oTrigger.DaysInterval") # "U"
>   ADDPROPERTY(poParms,"DaysInterval",oTrigger.DaysInterval)
>ENDIF
>
Type might be "0" but value might be .NULL,, you need to check it too.
Words are given to man to enable him to conceal his true feelings.
Charles Maurice de Talleyrand-Périgord

Weeks of programming can save you hours of planning.

Off

There is no place like [::1]
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform