LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how can i compare strings

Solved!
Go to solution

Hi,

My program is like once i get one string in my program, my microsoft access database is updated.

If another string is come in, the first string is replaced with the last one.

Now my problem is

Before replace the string, I want to compare them first.. eg of my two strings are EYT4730Z and ELT?7302.

Now in my program, I have No. of matches and No. of ?. For above e.g.of two strings: No. of matches: 5 and No. of ?: 1.

I can get upto this stage. What am I suppose to do next is if the No. of matches < 4, i want to replace the old one saved in database with new one.

If No. of matches > 4, go to next stage.. Look the No. of ?... If the No. of ? of the new string is zero or less than the old string, i want to replace the old one with new one. if the No. of ? of the new string is more than the old string, not replace and ignore the new one...

I am quite new to labview so i don't know how to write such a simple program.

 

If someone can help that will be great .

Thanks for your help .

 

0 Kudos
Message 1 of 5
(6,255 Views)

HI Min1992,

 

I guess you can use the equal function present in comparision directly to compare two strings and based on the result, i think u can select the update or insert statement. Hope this will work in your case..

LV 8.0, 8.6, 2011,2012,2013 WinXP
0 Kudos
Message 2 of 5
(6,245 Views)

Here you go with this VI, try with different string 1 and string 2. It should work.

0 Kudos
Message 3 of 5
(6,234 Views)
Solution
Accepted by Min1992

Hi Min,

   This is my first post in this forum. Here is the attachment. Check it out.

Let me know if any changes.
Regards,

Aarthi.

Aarthi
0 Kudos
Message 4 of 5
(6,216 Views)

Hi Aarthi Arivindh,Puneet K and Subbzz,

 

Thanks all of u guys.. it really works well in my program.

Regards,

 


0 Kudos
Message 5 of 5
(6,169 Views)