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
[Done] Return value for ChangeCurrentElement()
-
- Addict
- Posts: 4527
- Joined: Thu Jun 07, 2007 3:25 pm
- Location: Berlin, Germany
[Done] Return value for ChangeCurrentElement()
Last edited by Little John on Sat Aug 03, 2019 12:51 pm, edited 1 time in total.
Re: Return value for ChangeCurrentElement()
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.
You must pass a valid pointer. There is no "error" case for this function.
quidquid Latine dictum sit altum videtur
-
- Addict
- Posts: 4527
- Joined: Thu Jun 07, 2007 3:25 pm
- Location: Berlin, Germany
Re: Return value for ChangeCurrentElement()
I see. Thank you for the explanation!