Register

Lookup a value in a list

Discuss issues related to the Casio Basic Language
Junior Member
Posts: 8
Joined: Wed Dec 21, 2016 8:29 pm

Lookup a value in a list

hi
i have made some list and my list has several rows and columns. i want to search in this list for a special value. and get the row number of where it sit in the list.

for example i input x
and i want to find x in the list1's first column, and find out which row it sit!
like lookup function in excel.

thank for helping me

Junior Member
Posts: 9
Joined: Sun Aug 21, 2016 10:33 am
Calculators: None

Re: Lookup a value in a list

A simple for loop would be enough, I think.
Code: Select all
`For 1->I To 999 //change to 255 if you have an older OS/calcList 1[I]=X => BreakNext//I is the row where the variable is`

Junior Member
Posts: 8
Joined: Wed Dec 21, 2016 8:29 pm

Re: Lookup a value in a list

thank u
the cod i used:

Code: Select all
`input j[[21.3×2,1.21,0.962,0.571,0.536,0.686],[21.3×2.6,1.53,1.21,0.681,0.639,0.668],[21.3×3.2,1.82,1.44,0.768,0.722,0.65]]⇒IPfor 1=>i  to rowdim(IP) ' represent the last row number 'if IP[i,1]=I :thenprint IP[i,3]print IP[i,4]ifendnext`