LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Path Woes

The detailed help warns of this exact scenario (LV 2020 SP1)

"Partial paths, such as test\subtest, are not valid as array elements..."

 

Frozen_0-1649857947441.png

 

---------------------------------------------
Former Certified LabVIEW Developer (CLD)
Message 11 of 33
(1,498 Views)

@JÞB wrote:

@paul_cardinale wrote:

@AeroSoul wrote:

ah, so it's more for universality among different OS.

I operate exclusively on windows, so i usually just use strings.


Lacking a crystal ball, I don't assume that my code will never be used with a different file system; I consider such an assumption to be bad coding practice.


Try this improved method


I don't Amazon anymore (they sold me some counterfeit goods (at my age and grumpiness level, crap on me one time and you're on my s-list)).

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 12 of 33
(1,494 Views)

Based on what you are explaining, it sounds like cryptomacia to me. I call it cryptomacia.

0 Kudos
Message 13 of 33
(1,493 Views)

@Frozen wrote:

The detailed help warns of this exact scenario (LV 2020 SP1)

"Partial paths, such as test\subtest, are not valid as array elements..."

 

Frozen_0-1649857947441.png

 


This remark already exists with LV15, the oldest version installed on my computer.

0 Kudos
Message 14 of 33
(1,472 Views)

A "path to string" and then a "string to path"  'resolves' the problem.

 

Flattened data shows the differences:

wiebeCARYA_0-1649863202825.png

 

Changing the flattened data to hex reveals that the path is actually internally stored as an array of items, and Array To Path simply put's each item in an array element

 

Here's another way to do it 'right' (on windows):

wiebeCARYA_0-1649863534156.png

And that is what you'd expect Array of String to Path to do...

It's not a bug, it is somewhat unexpected:

wiebeCARYA_1-1649863638952.png

 

Message 15 of 33
(1,459 Views)

wiebe@CARYA wrote:

A "path to string" and then a "string to path"  'resolves' the problem.

 

Flattened data shows the differences:

wiebeCARYA_0-1649863202825.png

 

Changing the flattened data to hex reveals that the path is actually internally stored as an array of items, and Array To Path simply put's each item in an array element

 

Here's another way to do it 'right' (on windows):

wiebeCARYA_0-1649863534156.png

And that is what you'd expect Array of String to Path to do...

It's not a bug, it is somewhat unexpected:

wiebeCARYA_1-1649863638952.png

 


That look will work only if the path element delimiter embedded in the strings matches the delimiter used by the current file system.

The reason that paths are a different data type from strings is to avoid the issue of different delimiters on different systems.

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 16 of 33
(1,436 Views)

@paul_cardinale wrote:

wiebe@CARYA wrote:

A "path to string" and then a "string to path"  'resolves' the problem.

 

Flattened data shows the differences:

wiebeCARYA_0-1649863202825.png

 

Changing the flattened data to hex reveals that the path is actually internally stored as an array of items, and Array To Path simply put's each item in an array element

 

Here's another way to do it 'right' (on windows):

wiebeCARYA_0-1649863534156.png

And that is what you'd expect Array of String to Path to do...

It's not a bug, it is somewhat unexpected:

wiebeCARYA_1-1649863638952.png

 


That look will work only if the path element delimiter embedded in the strings matches the delimiter used by the current file system.

The reason that paths are a different data type from strings is to avoid the issue of different delimiters on different systems.


That look? Not sure what you mean...

0 Kudos
Message 17 of 33
(1,410 Views)

wiebe@CARYA wrote:

@paul_cardinale wrote:

wiebe@CARYA wrote:

A "path to string" and then a "string to path"  'resolves' the problem.

 

Flattened data shows the differences:

wiebeCARYA_0-1649863202825.png

 

Changing the flattened data to hex reveals that the path is actually internally stored as an array of items, and Array To Path simply put's each item in an array element

 

Here's another way to do it 'right' (on windows):

wiebeCARYA_0-1649863534156.png

And that is what you'd expect Array of String to Path to do...

It's not a bug, it is somewhat unexpected:

wiebeCARYA_1-1649863638952.png

 


That look will work only if the path element delimiter embedded in the strings matches the delimiter used by the current file system.

The reason that paths are a different data type from strings is to avoid the issue of different delimiters on different systems.


That look? Not sure what you mean...


That's a strange editing mistake.  I'll chalk it up to a brain cramp on my part.  It should read "That will work only ..."

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 18 of 33
(1,396 Views)

@paul_cardinale wrote:

wiebe@CARYA wrote:

@paul_cardinale wrote:

wiebe@CARYA wrote:

A "path to string" and then a "string to path"  'resolves' the problem.

 

Flattened data shows the differences:

wiebeCARYA_0-1649863202825.png

 

Changing the flattened data to hex reveals that the path is actually internally stored as an array of items, and Array To Path simply put's each item in an array element

 

Here's another way to do it 'right' (on windows):

wiebeCARYA_0-1649863534156.png

And that is what you'd expect Array of String to Path to do...

It's not a bug, it is somewhat unexpected:

wiebeCARYA_1-1649863638952.png

 


That look will work only if the path element delimiter embedded in the strings matches the delimiter used by the current file system.

The reason that paths are a different data type from strings is to avoid the issue of different delimiters on different systems.


That look? Not sure what you mean...


That's a strange editing mistake.  I'll chalk it up to a brain cramp on my part.  It should read "That will work only ..."


A, maybe you mend "That loop will work only..." That makes sense and explains the typo.

 

I think we're in agreement here.

 

There are two flavors:

1) Use a loop and build path-> The strings can be compound, but must be system delimiters

2) Use an array -> Strings can't be compound.

0 Kudos
Message 19 of 33
(1,385 Views)

wiebe@CARYA wrote:

@paul_cardinale wrote:

wiebe@CARYA wrote:

@paul_cardinale wrote:

wiebe@CARYA wrote:

A "path to string" and then a "string to path"  'resolves' the problem.

 

Flattened data shows the differences:

wiebeCARYA_0-1649863202825.png

 

Changing the flattened data to hex reveals that the path is actually internally stored as an array of items, and Array To Path simply put's each item in an array element

 

Here's another way to do it 'right' (on windows):

wiebeCARYA_0-1649863534156.png

And that is what you'd expect Array of String to Path to do...

It's not a bug, it is somewhat unexpected:

wiebeCARYA_1-1649863638952.png

 


That look will work only if the path element delimiter embedded in the strings matches the delimiter used by the current file system.

The reason that paths are a different data type from strings is to avoid the issue of different delimiters on different systems.


That look? Not sure what you mean...


That's a strange editing mistake.  I'll chalk it up to a brain cramp on my part.  It should read "That will work only ..."


A, maybe you mend "That loop will work only..." That makes sense and explains the typo.

 

I think we're in agreement here.

 

There are two flavors:

1) Use a loop and build path-> The strings can be compound, but must be system delimiters

2) Use an array -> Strings can't be compound.


Yes, that's what I "mend".  😀

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 20 of 33
(1,346 Views)