Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Change system date programatically
Message
De
04/01/2005 09:11:04
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
À
04/01/2005 09:06:58
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 6
OS:
Windows '98
Network:
Windows 98
Database:
Visual FoxPro
Divers
Thread ID:
00974058
Message ID:
00974061
Vues:
33
>Dear Experts
>
>To change system date programatically I use following method
>
>lcCmd = GETENV("ComSpec") + [ /C ]
>lcCmd = lcCmd + [ DATE 04-01-2005"
>loShell = CREATEOBJECT("wscript.shell")
>= loShell.Run(lcCmd,1,.t.)
>
>This works fine but I want to change system date with date given in a textbox.
>
>To do this there is a date type textbox containing value 04-10-1975
>And there is a command button having following code
>
>lcCmd = GETENV("ComSpec") + [ /C ]
>DATE1=thisform.text2.Value
>lcCmd = lcCmd + [ date ] + DATE1
>loShell = CREATEOBJECT("wscript.shell")
>= loShell.Run(lcCmd,1,.t.)
>
>But it does not work and shows error message, Operator/Operant type mismatch.
>
>Please help

I suspect the variable Date1 is of type date. Comparing with your first sample, the one that works, it seems you have to convert that to type caracter. You might use the dtoc() function for this.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform