08-18-2016 05:06 AM - edited 08-18-2016 05:07 AM
Hi All,
I used this function long before which was working for me, but not sure what i am doing wrong not able to get my work done.
This is my scenario,
I have a Local variable 1D array of String assume (Locals.XXX)
i need to get First element value
I used the Below syntax
FindIndex(Locals.XXX,1,True)
Advice me what i am doing wrong
Solved! Go to Solution.
08-18-2016 05:11 AM
Hi Palanivel,
Is the array an array of strings? Perhaps you should use
FindIndex(Locals.XXX,"1",True)
Regards,
Charlie Rodway | Principal Software Engineer | Certified TestStand Architect (CTA)
Computer Controlled Solutions Ltd | NI Silver Alliance Partner | GDevCon#1 Sponsor
08-18-2016 05:17 AM
I tried this but i am getting Empty value instead of 1st Index Value
FindIndex(Locals.XXX,"1",True)
08-18-2016 05:30 AM
The FindIndex function returns the index as a string, formatted as "[i][j][k]"; are you trying to use this or are you expecting a numeric index to be returned?
To get a numeric index, use the following expression:
IndexToOffset(Locals.Array, FindIndex(Locals.Array,"1",True))
Regards,
Charlie Rodway | Principal Software Engineer | Certified TestStand Architect (CTA)
Computer Controlled Solutions Ltd | NI Silver Alliance Partner | GDevCon#1 Sponsor
08-18-2016 05:36 AM
Hi Charlie
Thanks for the update,
I need the Index Value assume My Locals.Array contains values as ["asd","fgh","jkl","qwe","rty","uio"]
If my index value is 1 then i need the output as "fgh"
08-18-2016 05:42 AM
Hi Palanivel,
See the attached example.
Charlie Rodway | Principal Software Engineer | Certified TestStand Architect (CTA)
Computer Controlled Solutions Ltd | NI Silver Alliance Partner | GDevCon#1 Sponsor
08-18-2016 05:46 AM
Hi Charlie
Its Working Vice Versa i can able to retrive my index for my Index Vaue which is same as Search 1D Array in labVIEW Functions.
My requirement is to work as same as Index array in labVIEW
08-18-2016 05:55 AM - edited 08-18-2016 05:56 AM
Thanks Charlie
I will use an alternative Method for the same requirement
Locals.MyArray[4] instead of Find Index
Kudos to your support!
08-18-2016 05:56 AM
No problem - glad I could help!
Charlie Rodway | Principal Software Engineer | Certified TestStand Architect (CTA)
Computer Controlled Solutions Ltd | NI Silver Alliance Partner | GDevCon#1 Sponsor