Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Long file name
Message
 
 
To
10/12/2011 09:21:19
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01530741
Message ID:
01530800
Views:
45
>>Hi everybody,
>>
>>In the form I adapted there is the following code
>>
>>select * from (tcReportName + .RepExt) ...
>>USE IN (tcShortName)
>>
>>where tcShortName is the JUSTSTEM(tcReportName).
>>
>>This code fails when the file name has spaces in it. In my tests I found that spaces are replaced with _.
>>
>>The question is - how can I close reliably the alias opened by selecting everything from the file name?
>
>Since aliases can be used without quotation marks in several contexts (which is a holdover from early days, and has confused me a lot), they must conform to the naming rules for variables. If you just
>
use "something with spaces.dbf"
>or
>
use "1234.dbf"
>it's obvious that the filename can't be the alias, so Fox will make one for you.
>Two ways out of this:
>1) force an alias
>
use "something with spaces.dbf" alias something
>2) accept the alias but save it somewhere:
>
use "something with spaces.dbf"
>lcSomethingAlias=alias()
>
>There's a third way, to guess the rules Fox uses when renaming your unusable filename into an alias, but that's guesswork. At some point it may just switch to aliases like W134, where 134 is its workarea, and you don't know when will that be.

In my tests it was changing spaces to _ and & also to _.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform