Page 1 of 1

a parameter for ResetList() to seek behind end

Posted: Thu Oct 25, 2007 1:12 am
by #NULL
..optional, something like ResetList(list(),-1).
would be nice for reverse iterating with While

Posted: Thu Oct 25, 2007 1:38 am
by #NULL
why does ChangeCurrentElement() not return something usefull, like the former element.
then instead of that

Code: Select all

*remember = @list()
  ChangeCurrentElement(list(),*parent)
  ;...do something at another position
ChangeCurrentElement(list(),*remember)
you could write

Code: Select all

*remember = ChangeCurrentElement(list(),*parent) ; returns the address of the former element
  ;...do something at another position
ChangeCurrentElement(list(),*remember)

Posted: Thu Oct 25, 2007 5:36 pm
by nco2k
> ResetList(list(),-1)
well, it would be usefull if PreviousElement() would automatically jump to the last element if there is no current element selected (-1). no need for an extra flag in ResetList() imo.

> ChangeCurrentElement()
yes, thats something i also noticed. would be cool if it would return the pointer of the former element, but only if the change was successfull, otherwise return 0.

and also a #True/#False for SwapElements() maybe? in case of an invalid pointer, instead of an invalid memory access error. just an idea.

c ya,
nco2k

Posted: Wed Jan 16, 2008 10:11 am
by Hurga
I think it qould be very useful to have a way to check if there was a invalid pointer given.

maxbe with a returnvalue of changecurrentelement
I can think as an other way to set Listindex(<Listname>) to -1. (currently it keeps the last element AFAIK)
This would prevent an IMA.

Posted: Wed Jan 16, 2008 4:11 pm
by DoubleDutch
why does ChangeCurrentElement() not return something usefull, like the former element.
I think this is a great idea. :)