[Implemented] SelectElement() should have a return value

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
infratec
Always Here
Always Here
Posts: 7583
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

[Implemented] SelectElement() should have a return value

Post by infratec »

Hi PB Team,

at the moment I have a program, where it is possible that I call SelectElement() with an
invalid index.
At the moment I have to use

Code: Select all

if index < ListSize()
 SelectElement(Test(), index)
to check this before.
More elegant would be, if I can check the result of SelectElement() like

Code: Select all

if SelectElement(Test(), index)
Best regards,
Bernd
Fred
Administrator
Administrator
Posts: 18162
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: SelectElement() should have a return value

Post by Fred »

Actually it alreday does that as it returns the list item data adress if the element is found.
infratec
Always Here
Always Here
Posts: 7583
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: SelectElement() should have a return value

Post by infratec »

Thanks Fred for the fast response.

Than you have only to adjust the helpfile.
There is still written:
Rückgabewert:
Dieser Befehl hat keinen Rückgabewert.
in englsih:
Return value:
This function does not return any value.
Bernd
Post Reply