Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SYS(16) returning tilde in path name.
Message
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
00474804
Message ID:
00474811
Views:
25
Edmond -
I don't know the cause of this but I have seen it too. I think there is a WinAPI function called GetLongFileName which apparently will transate the ~ version to the long name version, but I haven't used it. You might try incorporating that like so:

lcProgram = SYS(16)
IF "~" $ lcProgram
    * Declare GetLongFileName here *
    lcProgram = GetLongFileName()
ENDIF && "~" $ lcProgram


Hope this helps ...
zahid

>I’m trying to find the cause of apparent inconsistent behavior of SYS(16) in VFP6.
>
>If I have a space in the path name, such as “C:\Program Files\MyExe”, SYS(16) will sometimes return “C:\Program~1\MyExe” but other times return the correct path with the space. I’ve tried to create simple exe programs to duplicate the problem but all of my tests return the correct path. Only in my production app do I get this behavior but I can’t discover what is causing it.
>
>One thing that I have is a “startup” exe which calls the main exe (both in the same directory) and the problem is happening in the main exe (it works fine in the startup exe). I have tried to made two test exes to see if it was the fact that SYS(16) was being called from a second tier exe but the tests work fine. Also, elsewhere in the main exe SYS(16) returns the full path. The behavior seems to be inconsistent but there must be some cause that I am not seeing.
>
>Does anyone have a cause for this behavior?
>
>TIA
>
>Ed
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform