Post Reply 
arg() crashes the emulator
02-25-2015, 04:25 PM
Post: #21
RE: arg() crashes the emulator
Good You Pointed that out! Totally my fault I was mislead by the exact. Problem solved. Thanks
Find all posts by this user
Quote this message in a reply
02-25-2015, 07:01 PM
Post: #22
RE: arg() crashes the emulator
(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.

∫aL√0mic (IT9CLU), HP Prime 50g 41CX 71b 42s 12C 15C - DM42 WP34s :: Prime Soft. Lib
Visit this user's website Find all posts by this user
Quote this message in a reply
02-25-2015, 07:22 PM
Post: #23
RE: arg() crashes the emulator
(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?

∫aL√0mic (IT9CLU), HP Prime 50g 41CX 71b 42s 12C 15C - DM42 WP34s :: Prime Soft. Lib
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)