EXIT FUNCTION option

12 views
Skip to first unread message

flyway38

unread,
Jan 1, 2023, 1:22:21 PM1/1/23
to jallib
Hello to all,

Happy new year to all !!!

Is there anyways of use something like this: "Exit Function" to exit immediately a function ?
Thank you.

Kind regards,
Filipe Santos

vsurducan

unread,
Jan 2, 2023, 12:26:55 AM1/2/23
to jal...@googlegroups.com
The immediat exit from everything is if-end if. Avoiding loops in fast needed processes is healthy thinking. Each line means processing time.
The second is writting jal code for good hex result, not for short structure...

--
You received this message because you are subscribed to the Google Groups "jallib" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jallib+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jallib/67a3c8ae-31fc-4151-a289-d104b8160b31n%40googlegroups.com.

flyway38

unread,
Jan 2, 2023, 6:56:03 AM1/2/23
to jallib
Hi Vasile,

Am thinking of something that many other programming languages have.
"Exit Function" to exit immediately a function without running the rest of it's code.
Thank you anyways.

Cheers,
FS

vsurducan

unread,
Jan 2, 2023, 10:05:13 AM1/2/23
to jal...@googlegroups.com
Sorry Felipe, I was thinking of exiting from a loop, there are some options there (repeat and while) which look redundant.
Perhaps you can use a procedure instead of a function and just return from the procedure?

From Jal manual:
RETURN [ expr ]
When executed, the sub program immediately returns. If the sub program is a FUNCTION, expr is
required. If it is a PROCEDURE, expr is forbidden.


About other languages, each time I'm looking at Arduino examples I regret the missing of compatible math representation in Jal. Each time I'm struggling with Arduino IDE, I heavily appreciate Jal. 
I really don't want an IDE where I can't even look at the library's content. You need another editor to see Arduino library files. :)  However, all programmable components in this world have Arduino libraries. Weird.


Reply all
Reply to author
Forward
0 new messages