You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
They only exist as keywords
The command to call the function should not be included
I don’t really agree with this form of returning value references, we only need to update the keyword file.
This very risky. The distinction between gosub's and CLEO's return should be obvious. Worst debugging sessions I had was caused by muscle memory and using return instead of cleo_return. Scripts crashes without obvious reason.
That's the idea. Just like end closes the innermost loop or if statement, return acts either as 0051 or 0AB2 depending on current scope. This resolution could be done in compile-time.
Hm, ok. Will it work with functions having multiple exit points? @MiranDMC
if you do a code pre-processing, i.e. a text scanner, which identifies the matches and replaces them with the necessary text, there should be no problems with anything.
in fact @x87, can't you include in SannyBuilder, a tool to create these auto-replaceable texts? This is something extremely easy to do in JavaScript, with a String.Replacer() with a RegularExpression in the first parameter and a STRING in the second.
Activity
XMDS commentedon Jul 4, 2021
They only exist as keywords
The command to call the function should not be included
I don’t really agree with this form of returning value references, we only need to update the keyword file.
XMDS commentedon Jul 4, 2021
About function commands:
#45
x87 commentedon Sep 2, 2023
what if I want to return zero from the cleo function?
in opcode form:
how do I write it using just
return?MatiDragon-YT commentedon Sep 3, 2023
oops sorry, I didn't notice that error, I corrected.
Yes and thank
x87 commentedon Sep 3, 2023
how would I write
0AB2: cleo_return 0then? justreturn?MiranDMC commentedon Sep 3, 2023
This very risky. The distinction between gosub's and CLEO's return should be obvious. Worst debugging sessions I had was caused by muscle memory and using return instead of cleo_return. Scripts crashes without obvious reason.
x87 commentedon Sep 3, 2023
That's the idea. Just like
endcloses the innermost loop or if statement,returnacts either as 0051 or 0AB2 depending on current scope. This resolution could be done in compile-time.MiranDMC commentedon Sep 4, 2023
Hm, ok. Will it work with functions having multiple exit points?
MatiDragon-YT commentedon Sep 5, 2023
return undefinedorreturn nullor!returnorreturn void(0)MatiDragon-YT commentedon Sep 5, 2023
if you do a code pre-processing, i.e. a text scanner, which identifies the matches and replaces them with the necessary text, there should be no problems with anything.
in fact @x87, can't you include in SannyBuilder, a tool to create these auto-replaceable texts? This is something extremely easy to do in JavaScript, with a
String.Replacer()with a RegularExpression in the first parameter and a STRING in the second.MiranDMC commentedon Jul 23, 2024
Already done.