Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Access/Assign in COM Object?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Divers
Thread ID:
00481355
Message ID:
00481775
Vues:
16
>And while you're reading (grin), do you know what the difference is between the two? It looks like they return the same thing (I know you are a VBScript guru):
>
>
	Set oFSO = CreateObject("Scripting.FileSystemObject")
>	Set oShell = CreateObject("WScript.Shell")
>
>	TmpDir = oShell.Environment("Process")("Temp")
>	cFolder = oFSO.GetSpecialFolder(2)
>	WScript.Echo vbCRLF
>	WScript.Echo TmpDir
>	WSCript.Echo cFolder
VBScript guru? Me? Naw! I know a bit about the WSH and have dabbled in VBScript, but I'm not any sort of expert. What's below is purely a VFP perspective.

Right off the top, GetSpecialFolder returns a folder object not a string. Secondly the call to oShell.Enviroment returns an environment object. So, from within VFP we'd do
oEnvirn = oShell.Environment("Process")
? oEnvirn.Item("Tmp") && Returns the temporary directory
oFolder = oFSO.GetSpecialFolder(2)
? oFolder.Path && Returns the temporary directory as well
George

Ubi caritas et amor, deus ibi est
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform