HP Forums

Full Version: arg() crashes the emulator
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Good You Pointed that out! Totally my fault I was mislead by the exact. Problem solved. Thanks
(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 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
exit with 12...

So, return (lowercase) pass a value to the rest of the program, isn't it?
Pages: 1 2
Reference URL's