From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to select the end of the string?

I have a table with many strings.  How can I select the last string entered into the table OR Is there a way so that I can reverse the order of the string? 
0 Kudos
Message 1 of 8
(3,014 Views)
Hi,
I can't understand exactly what you are trying to do, but yes there is a function that reverses a string and the last element in the string become the first one.
it is located in Functions>>Strings>>additional string functions>>reverse string
 
good luck
 
Tareq
Message 2 of 8
(3,006 Views)
Hi,
 
Dealing with tables is just like dealing with 2D array so you can use index array function to acess the string you want
 
good luck
 
Tareq
0 Kudos
Message 3 of 8
(3,002 Views)
I have table that consists of strings, such as:          Read page 1
                                                                                  Read page 2
                                                                                  Read page 3
 
I would like to select 'Read page 3'.   How can I select the last string in the table or how can I reverse the order of the strings?  I tried using the function 'reverse string' but it also reverses the string order (ie. 3 egap daeR).  How can I only reverse the string order?
0 Kudos
Message 4 of 8
(2,995 Views)
Thes quesion is a bit ambiguous.
 
Yes, a table indicator is just a fancy display for a 2D array of strings.
 
How is the string entered (e.g. Via a control for row+colum+text, typed directly into the table, etc...))?
What do you mean by "select" (e.g. highlight it in the table with a different background, extract it to another indicator, etc.)?
 
To record the last change to the table, you would typically keep it in a shift register, then see which element has changed from the last iteration.
 
 
Could it be your "table" is just an string indicator with table elements seperated by tabs and linefeeds? Is the "last element entered" always at the end of the string? Again, what do you mean by "select"?
0 Kudos
Message 5 of 8
(2,994 Views)
In my while loop, I have a function that adds strings into a table that is then converted into an array.  The last thing entered into the table, shows as the last thing on the table.  I would like to be able to take the last string entered into the table and use it somewhere else.  I would like to use the last value from the table, because it is all connected in a while loop through shift registers.   Whenever I use index function from the array panel it gives me the first value entered. but I need to know how can I get the last value entered. 
0 Kudos
Message 6 of 8
(2,987 Views)

Whenever you place a new string into the table, also place it in a shift register. Thus you can get the last entered item directly from the shift register, no need to extract it from the table again later.

The "Index Array" function only gives you the first element IF you don't wire the index. Wire the desired index and you should be able to get any element you want. If it is a 1D array get the last element by wiring "array size - 1" to the index. If it is a 2D array, it'll be a bit more complex.

The attached example (LabVIEW 7.0) shows a few possibilities.

  • It highlights the last line of the table (listbox indicator).
  • It extracts the last element from the array (code in upper right corner).

Modify as needed. 🙂

Message 7 of 8
(2,979 Views)
I want to select a string inside of my table.  After I select a string I want to be able to use the selected string for another task.  How can I go by selecting one string from a table?
0 Kudos
Message 8 of 8
(2,958 Views)