Page 1 of 1

SelectElement() shorthand ?

Posted: Sat Aug 14, 2010 8:47 pm
by USCode
It might be handy if the PB compiler could handle some shorthand that would eliminate the need to call linked list command SelectElement() ...

For example, it would be nice if instead of this ...

SelectElement(mylist(), 7)
mylist()\MyField = 12345

... we could do this instead:

mylist(7)\MyField = 12345

This shorthand would issue an implicit SelectElement and make element 7 the current list element before the assignment.

Doable?

Re: SelectElement() shorthand ?

Posted: Sat Aug 14, 2010 8:54 pm
by STARGĂ…TE
Good idea, should problems with arrays not exist, since they may not have the same name.

But a note:
SelectElement() wrote:As linked lists don't use an index, it will jump compulsory to every element until the target position is reached. If a faster method is needed, ChangeCurrentElement() should be used.