02-25-2015, 04:25 PM
Pages: 1 2
02-25-2015, 07:01 PM
(02-25-2015 02:54 PM)Han Wrote: [ -> ]Based on what I can observe, both return and RETURN are used to return a value; however, RETURN will also exit the current function/procedure whereas return does not. As for return 0 vs. return(0), I believe this is the same.
...
Now I understand because a program of mine didn't work: with return it didn't exit...
Thank you, Han.
I'll amend it with uppercase.
02-25-2015, 07:22 PM
(02-25-2015 02:54 PM)Han Wrote: [ -> ]Code:
#cas
RETEXAMPLE():=
BEGIN
IF 1>0 THEN
return("Yes!");
END;
return("Reached end of program");
END;
#end
Also:
Code:
#cas
RETEXAMPLE():=
BEGIN
IF 1>0 THEN
return rr:=12;
END;
return(rr-2);
END;
#end
end with 10
but
Code:
#cas
RETEXAMPLE():=
BEGIN
IF 1>0 THEN
RETURN rr:=12;
END;
return(rr-2);
END;
#end
So, return (lowercase) pass a value to the rest of the program, isn't it?
Pages: 1 2