HomeForumSourceResearchGuide
Sign in to reply to forum posts.
Dana commands (dnc, dana) returning success status

Hello,

How hard is it to make dana functions return success status, so that they could be used with bash logic? I.e. using the $? notation. So, that scripts stop executing if the compilation fails.

Many thanks, Sava

This is a bug, apparently from a recent re-architect of the compiler. You can expect a fix very soon; the behavior should be that the compiler returns a non-zero value for compilation failures, which is the general Linux convention. You can write your scripts as if this were the case.

For the runtime, the dana process returns to the OS whatever integer value is returned by your App:main function, so you're in control of this one. Note that not all OSs support the full range of possible int result values (some will only accept up to a value of 255, so be careful trying to return values above that).

Hello dcj,

Sounds great! I appreciate the quick response and the notes provided!

Many thanks,

Sava