Array Search Function Problem

BlitzPlus Forums/BlitzPlus Programming/Array Search Function Problem

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

The purpose of the following Function is to search the 25x1 array A$ (with a 0 in the second array dimension) for the entry specified in on$, and return a 1 if it is there, and a 0 if it isnt

Function SearchAnims(on$)
While Not (TNum = 26 And oncheck$ = on$)
oncheck$ = A$(TNum, 0)
TNum = TNum + 1
Wend
If TNum = 26 Then
Return 0
Else
Return 1
EndIf
End Function

The function doesnt do that however, it used to return a 0 weather the entry was present or not until I added the $ signs to on$ and oncheck$, now it complains about the array element being out of bounds

Any help would be much apreciated