LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

scan string for "returns"

Hi,
I have a multi lined string and want to put it as list into a listbox (i
did it with a for loop and the "i"attached to the line index of the
"pick line" vi) but now a have let my for loop know how many rounds it
must do! How can scan a multi lined strings for "number of lines"?

Regards Thijs
0 Kudos
Message 1 of 4
(2,486 Views)
I would to "Scan String for Tokens", as for a delimiter, just hit return
(the "\ codes" display will be "\r"). Put the "Scan String..." in a For
loop, and hook up (i+1) to the "N" for your For loop.

--
Rick
0 Kudos
Message 2 of 4
(2,486 Views)
I would like to use while loop instead of for loop and use the EOF of the "pick line" vi to control the loop.
0 Kudos
Message 3 of 4
(2,486 Views)
Thijs,

Use the "Spreadsheet String to Array" function (in string functions). Wire
it as follows:

format string: string constant containing "%s"
spreadsheet string: your string
array type: (empty) array string constant
delimiter: string constant containing enter ("\n" with string in code
display mode)

The output "spreadsheet" is an array with strings that can be wired to the
attribute node of the listbox.


Important notice: \n is not the same as \r ! If your string comes from a
..txt file, this can cause unexpected results!

Regards,

Wiebe Walstra.
AIR technical Automation.


By the way, Thijs. If your in the Nederlands, maybe you'd like to visit our
annual LabVIEW meeting, PierVIEW. This also applies to the rest of the
group. Check out www.air.nl, and follo
w PierVIEW 2001.






--
AIR technical Automation
www.air.nl
"Thijs Boeree" wrote in message
news:3AB75ABF.75C8D18E@amc.uva.nl...
Hi,
I have a multi lined string and want to put it as list into a listbox (i
did it with a for loop and the "i"attached to the line index of the
"pick line" vi) but now a have let my for loop know how many rounds it
must do! How can scan a multi lined strings for "number of lines"?

Regards Thijs
0 Kudos
Message 4 of 4
(2,486 Views)