>>Create a share on a server with the share name containing a space, such as the legal share name "A Space". Assuming that your server is named MyServer, issue the following commands:
>>
>>CD "\\MyServer\A Space"
>>? SYS(5)
>>
>>Notice that there is now a space in SYS(5), and since you've referenced it by UNC, there's no colon, and it's more than two characters in length.
>>
>>Try it, you won't be a happy critter at all at all. If you designate the starting folder in the shortcut as a UNC, you'll get bit - the OS sees the UNC and relies on the UNC, not a transient drive mapping...
>
>That's clarified part of the issue of sys(5), & the possibility of spaces in the value returned, again thanks.
>
>The second part of the problem, as stated, was that the "set default to sys(5)" would not
compile - now with the above would you expect a compile time or run-time error.
Neither. I expect:
cPathName = SYS(5)
CD &cPathName
would generate a runtime error if SYS(5) returned a UNC with an embedded space. I don't see a problem with any version of VFP I have here, which is 5.0a, 6.0SP5 and 7.0RC1, but it's possible that some version of the compiler had this error and I just never saw it. The behavior of CD SYS(5) would be unpredictable with a UNC, since the UNC is treated as a full path; try:
CD "\\MyServer\ShareName\SubFolder"
CD SYS(5)
CD
CD C:\Windows\SYSTEM
CD SYS(5)
CD
Notice that with a UNC, CD SYS(5) moves you to the root of the share, while with a drive letter, it moves you to the relative path of the drive. You now see why I don't use CD SYS(5)