Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP Tip - #2 Today
Message
From
10/07/1999 11:42:46
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
09/07/1999 18:21:31
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00238801
Message ID:
00239828
Views:
25
>>>Hi gang,
>>>
>>>While I realize that's there's already been one "Tip of the Day" here's a bonus one.
>>>
>>>If you've ever had to deal with parsing a "Table.Field" expression, VFP 6.0 added some functions that can make this easier. Of course, they weren't designed for this purpose, but they can be used to do this. The functions are JUSTSTEM(), JUSTEXT() and FORCEEXT(). Here are some sample:
>>>lcalias = 'mytable'
>>>lcfield = 'myfield'
>>>lctableexpr = FORCEEXT(lcalias, lcfield) && returns 'mytable.myfield'
>>>lcnewexpr = FORCEEXT(lctableexpr, 'yourfield') && 'mytable.yourfield'
>>>lcjustalias = JUSTSTEM(lctableexpr) && 'mytable'
>>>lcjustfield = JUSTEXT(lctableexpr) && 'myfield'
>>
>>This worked as early as fpath.plb, so for those who may need this in FPD/FPW 2.5 or 2.6 - just do it.
>
>When I use GETFILE to obtain a full path to a file and the path contains spaces and immediately after that the function FILE() returns .T., then I proceed to open the file with something like
>
>Use &VarName && the file is a table
>
>It does not work.
>
>What I’m doing is to append ‘”’ at the begining an end of the string contained into VarName.
>
>Is there any function like FORCEEXT, ADDBS useful to obtain a full path which can be used when there are spaces in one or more of the directories or the file name?

No need for such a function:

use (VarName)

If this is a filename with special drive-type designators (like "File:whatever") then this may not work, but then, like you said,
use "&VarName"

covers for such cases.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform