Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Set default to...
Message
De
23/07/2001 08:11:08
 
 
À
23/07/2001 08:05:28
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00528803
Message ID:
00533833
Vues:
7
>>VFP is smart enough to recognize a SYS() function or other string expressions and implicitly use name resolution on the expression, as it would with:
>>
>>CD "C:\Foo" + "\Bar\Mumble Bletch"
>>
>>SYS(5) will not contain a space unless you have explicitly referenced a UNC whose UNC name (\\server\share name). Since VFP uses implicit name resolution IAC for this example, it doesn't matter. I'd probably use
>>
>>CD (SYS(5))
>>
>>to explicitly invoke name resolution rather than rely on the implied behavior, and I do not use SYS(5) IAC - I tend to use FULLPATH(CURDIR()), a more explicit statement - SYS(5) resolves to the relative path of the current default drive; so does FULLPATH(CURDIR()). Explicit name resolution avoids errors at no cost in both situations; why make the next person guess at my intent.
>>
>>CD and SET DEFAULT TO are identical in this behavior. This is the stated behavior of VFP commands which take a single name as an argument.
>
>
>Hi Ed,
>
>Ditto with Len on the explanation. Am I correct in assuming that in order to avoid confusion with UNC's, spaces in directory names, you prefer to use FULLPATH(CURDIR()), since it will explicitly resolve any naming idiosyncracy?
>

Yep, but I explicitly encapsulate in parentheses regardless; if I want name resolution, I explicitly use it rather than relying on implicxit behavior in the CLI.

>Also, what happens with resolving the UNC share;
>
>SET DEFAULT TO "\\SERV_NAME\N_DRIVE\SomeFolder", in the case where "\\SERV_NAME\N_DRIVE" resolves to drive 'N:\' say, where the exe is actually located in the map 'N:\SomeFolder'. (There are no spaces on purpose).
>

SYS(5) returns \\SERV_NAME\N_DRIVE

>Is it precisely the sort of confusion you want to avoid when you say 'use FULLPATH(CURDIR())'?
>

It's more important to avoid issues in files resolved via SET PATH, but yes.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform