[Done] Return value for ChangeCurrentElement()

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
Little John
Addict
Addict
Posts: 4527
Joined: Thu Jun 07, 2007 3:25 pm
Location: Berlin, Germany

[Done] Return value for ChangeCurrentElement()

Post by Little John »

It would be helpful if ChangeCurrentElement() returned 0 on error, and non-zero on success (as it is the case for many other built-in PureBasic functions).

see viewtopic.php?f=13&t=73313
Last edited by Little John on Sat Aug 03, 2019 12:51 pm, edited 1 time in total.
freak
PureBasic Team
PureBasic Team
Posts: 5929
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Re: Return value for ChangeCurrentElement()

Post by freak »

The only way to know if the pointer you passed is valid is to do a ForEach through the entire list to check. That would defeat the purpose of the function.

You must pass a valid pointer. There is no "error" case for this function.
quidquid Latine dictum sit altum videtur
Little John
Addict
Addict
Posts: 4527
Joined: Thu Jun 07, 2007 3:25 pm
Location: Berlin, Germany

Re: Return value for ChangeCurrentElement()

Post by Little John »

I see. Thank you for the explanation!
Post Reply