Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Odd / Incorrect FULLPATH return, depending
Message
From
02/03/2022 08:39:47
Lutz Scheffler (Online)
Lutz Scheffler Software Ingenieurbüro
Dresden, Germany
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01683716
Message ID:
01683718
Views:
57
JUSTPATH is a bit a tricky thing. It has odd effects.
Just try to split the one liner into
*this is the current path, the default of fullpath second parameter
lcTemp = fullpath('')
*now step by step
lcTemp1 = tcClassLibName
lcTemp2 = DEFAULTEXT(m.lcTemp1, "VCX")
lcTemp3 = UPPER(m.lcTemp2)
lcTemp4 = FULLPATH(m.lcTemp3)
So, lcTemp points to your EXEs location (if not changed, the default), and lcTemp1 does not contain a path, lcTemp4 should end up like:
lcTemp = fullpath('')
*now step by step
lcTemp1 = tcClassLibName
lcTemp2 = DEFAULTEXT(m.lcTemp1, "VCX")
lcTemp3 = UPPER(m.lcTemp2)
lcTemp4 = lcTemp+m.lcTemp3


Doesn't work on IDE but on EXE? IDE finds the file not in lcTemp?
FULLPATH has abilities to go along the VFP SET PATH. So if your IDE find the VCX in the PATH, it returns this. If this PATH is not in de EXE, and not findeable, it defaults to the current directory. And might do relatives to this, according to first parameter.
*we have a file E:\XXX\YYY\bla.vcx
*we are at E:\ZZZ
SET PATH TO
?fullpath('bla.vcx') && E:\ZZZ\bla.vcx
SET PATH TO E:\XXX\YYY
?fullpath('bla.vcx') && E:\XXX\YYY\bla.vcx
>Hi all -
>
>Without going into nitty-gritty detail here we're seeing a repeatable case where something like FULLPAT(UPPER(DEFAULTEXT(ALLTRIM(tcClassLibName), "VCX"))) returns the correct filespec from the command window, but from the EXE or debugger returns a constructed, NON-EXISTANT filespec that appears to be created based on the location of the executing EXE.
>
>Before delving into this any more curious if anyone has seen behavior along these lines.
>
>Note: The box where this is happening only has SP1 installed--no SP2 nor any of the hotfixes, etc.
>
>TIA.
>________________
>_____/ Regards,
>____/ al
Words are given to man to enable him to conceal his true feelings.
Charles Maurice de Talleyrand-Périgord

Weeks of programming can save you hours of planning.

Off

There is no place like [::1]
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform