LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

array string

Hello,
I'm a student. I'm doing a code and I can not solve a problem.
I have to compare the elements of an array (indefinite number of elements) with two strings. Specifically, I need to compare the date with the string indicating the date and time with the one showing the time.
Is there a way to do this cycle?

I enclose a picture showing the array and strings with which I have to compare elements in the array.

Thanks

0 Kudos
Message 1 of 7
(2,949 Views)

It's simple, connect your string array to a for loop and do your comparisons inside (you'll then work on 1 item at a time). If you wire the results out of the loop you'll get an array of results as standard.

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 2 of 7
(2,937 Views)

Ok, thank you.
But there is another problem:
first I have to break down the elements of the array "data" and "time" so I can compararare it with the string separately.
Can I do, or is there an easier way to make the comparison?

0 Kudos
Message 3 of 7
(2,929 Views)

Check out the 'Get Date/Time String' function. This will split it for you.

0 Kudos
Message 4 of 7
(2,905 Views)

To Yamaeda:
Do you understand my problem? is there a way to pass it?
To Mike:
I have no difficulty to get the current date and time. I can not separate the two terms (date and time) of the array elements.

0 Kudos
Message 5 of 7
(2,864 Views)

Hi gmazza,

 

- use SpreadsheetStringToArray with "-" as separator...

- use SplitString with offset

- use MatchPattern with "-"

- don't forget TrimWhitespace, it's a handy function 😄

 

There are so many functions in the string palette, did you even try one of these?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 7
(2,859 Views)

GMazza,

 

I have a feeling you are looking at 'Get Date/Time In Seconds'. You want to use 'Get Date/Time String'.

 

As 

0 Kudos
Message 7 of 7
(2,852 Views)