Welcome! Log In Create A New Profile

Advanced

[WD11] ArraySeek Syntax

Posted by David Egan 
David Egan
[WD11] ArraySeek Syntax
September 18, 2008 09:15AM
I am trying to do an ArraySeek on the second column in a 2 dimensional array, declared as 2 by 100 strings.
With the following syntax, the only time it returns the correct value is when the item is physically in position 2 in the array.
PROCEDURE FindField(_sFieldToFind)
RESULT ArraySeek(:arrFields,asLinearFirst,"2",_sFieldToFind)
However if I do a manual linear search as below it always works.
PROCEDURE FindField(_sFieldToFind)
li_pos is int
for i = 1 to 100
	IF :arrfields[2,i] = _sFieldToFind THEN
		li_pos = i
		break
	END
END
result li_pos
I'm sure it's me not understanding something in the syntax for multi-dimensioned arrays but I've looked at the help till I'm blue in the face and still can't see what I'm missing. Can anyone shed some light on this for me please?

Thanks

David
David Egan
Re: [WD11] ArraySeek Syntax
September 18, 2008 09:26AM
Geez, I'm stupid. The array is declared back to front!:mad:
Nothing wrong with me

David
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: