LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

problem with appended path

Hi,
 
I using LabVIEW 7.1, but the same is for LabVIEW 7.0.
 
Should this be happening, I am just appending a string containing a filename to a path but sometime my path control contains an empty path. If it is, then I get "filename.ext:\" as seen in picture?
 
Its easily solvable, but I wasn't expecting this to happen.
 
Regards
Ray Farmer
 
<img src="http://forums.ni.com/attachments/ni/170/140979/1/appended_path.PNG">

Message Edited by Ray Farmer on 09-05-2005 08:31 PM

Message Edited by Ray Farmer on 09-05-2005 08:32 PM

Message Edited by Ray Farmer on 09-05-2005 08:33 PM

Regards
Ray Farmer
0 Kudos
Message 1 of 11
(3,751 Views)
That is because filename.txt as root of an absolute path is supposed to be a drive and it is formatted accordingly: <drive>:\ .
What behavior did you expect?


LabVIEW, C'est LabVIEW

0 Kudos
Message 2 of 11
(3,733 Views)

Ray, everything is explained in the online help 😉

To learn more about LabVIEW, I suggest you try searching this site and google for LabVIEW tutorials. Here and here are a couple you can start with. You can also contact your local NI office and join one of their courses. :D:D:D

To be honnest, I ignored that until you asked... 🙂

Message Edité par chilly charly le 09-05-2005 09:57 PM

Chilly Charly    (aka CC)
0 Kudos
Message 3 of 11
(3,736 Views)

The reason appears to be fairly simple - if the path is empty, the string is treated as the beginning of the path, and as such receives the 😕 of the drive letters (like c:\), which does make sense.

As to whether this should be so or should LV detect the fact that the path is empty and use a default (let's say the root directory of the current drive), I don't know.


___________________
Try to take over the world!
0 Kudos
Message 4 of 11
(3,729 Views)
Has anyone got 6.1 installed and can give it a go for me.
 
Regards
Ray
Regards
Ray Farmer
0 Kudos
Message 5 of 11
(3,724 Views)
Exactly same behaviour using 6.1
Chilly Charly    (aka CC)
0 Kudos
Message 6 of 11
(3,717 Views)
Hi Ray
humm -same problem
Investigating further (check labview help for build path)
It states 
            *If base path is an empty path and name or relative path is an absolute path, this function sets appended path to the absolute path in name or relative path.

If base path is empty and you set name or relative path to: c:\d\error.log
then appended path becomes c:\d\error.log

not setting absolut path 'corrupts' result ie error.logC:\
As you say very easy solved with case selector controlled by string length check =0

chow
xseadog
0 Kudos
Message 7 of 11
(3,642 Views)

Hi,

I was expecting my filename or my relative path.

If my base path is empty and my string is a relative path then I should see a relative path!!!!

Ray

Regards
Ray Farmer
0 Kudos
Message 8 of 11
(3,712 Views)
Humm
offline to long

chow
xseadog
0 Kudos
Message 9 of 11
(3,712 Views)
Guys,
Thanks for for your input.
 
 
 
Hi CC,
 
I'm not a novice with labview, just been doing more 'C' than labVIEW the last year.
 
The links may help, as I was thinking about doing the CPD exam to reactivate it.
 
Regards
Ray
Regards
Ray Farmer
0 Kudos
Message 10 of 11
(3,714 Views)