I have a queue with 26 letters of the alphabet, one in each queue entry. I would like to find the record with (say) the letter F in it. Even if I SORT the queue, it still doesn’t help me get to the right record.
Do I really have to LOOP through all the records until I get to the one that matches? Is there nothing more elegant?
Keep in mind that this is case sensitive.
Q.Letter = ‘F’
GET(Q,Q.Letter)
IF NOT ERRORCODE()
YadaYada
END
1 Like
There’s are a couple of GET(Queue, … ) overloads.
I’d wager that the two most common are
GET(Q, N) where N is Nth row in the current sort order
and GET(Q, Q.A, Q.B) etc. where you pass a list of fields in the queue, and preset the value to search for in the queue buffer.
There’s another GET(Q, StringExpression), but I rarely use that one.
Q.Letter = xSearchFor
GET(Q, Q.Letter)
IF ERRORCODE() = NoError
! a row was found where Q.Letter = xSearchFor
! note for strings this is Case sensitive
END
see HELP[ Get ]
and HELP [ Additonal Queue Considerations ]
you can even provide a comparison function, which is handy for things like a case insensitive search.
3 Likes