PDA

View Full Version : New RETURN keyword change



ErosOlmi
06-01-2008, 12:59
Current version of thinBasic (1.5.0.1) has RETURN keyword. RETURN [any value] is one of the possible ways to get back a value from a function.

Petr suggested to use RETURN keyword like in C where RETURN exits immediately from the currently executing function to the calling routine, optionally returning a value. So something like:


FUNCTION = [any value]
EXIT FUNCTION


I'm still considering if the return value will be mandatory and not optional so if


RETURN expression / value
or
RETURN [expression / value]


Ciao
Eros

ErosOlmi
06-01-2008, 13:43
OK, I have decided that optional value is better, so the power is to the programmer.
Next preview will have:


RETURN [OptionalReturnExpression]

Ciao
Eros

Petr Schreiber
06-01-2008, 18:13
That is perfect,

I appreciate it a lot!


Thanks,
Petr

kryton9
06-01-2008, 23:58
That is really nice along with so many things we take for granted in thinBasic. Eros, PowerBASIC should hire you and bring in all the cool things you have brought to BASIC that PowerBASIC lags way behind in.

Randall
08-01-2008, 04:51
Beautiful !

Great addition !

You are indeed a programmer's programmer !