Hello Reuben,
as an alternative to RUN I'm using the following code:
define l_result integer,
l_error boolean = false,
l_channel base.channel
if ((l_channel := base.channel.create()) is not null)
then
try
call l_channel.openpipe("ls; echo $?", "r") # $? contains the return value of the previous command
if not l_channel.read([l_result])
then let l_error = true
else let l_error = (l_result <> 0) # if return value <> 0, an error occured
end if
catch
error "exception caught"
end try
call l_channel.close()
end if
The main advantage is that I can check whether the command was executed successfully because I evaluate the return value. By using RUN this can become tricky (see
https://4js.com/online_documentation/fjs-fgl-manual-html/#fgl-topics/c_fgl_programs_RUN.html#c_fgl_programs_RUN__CATCH_EXECUTION_STATUS).
Kind regards
Roland