Page 1 of 1

Get the error msg and error line within a script?

Posted: Tue May 01, 2018 8:02 pm
by bitRocky
Is there a way to get the error msg and line (and script where it occurs) from within a script?

At the moment the error msg and line is only shown in a requester if an error occured while compiling/interpreting a script.

I would like to be able to jump to the error line in the script with FlowStudio (MorphOS) and show the message in the CompilerOutput tab.

I have made some FlowStudio scripts to complete the word under cursor, show a quickhelp, open MultiView with the AutoDoc etc, also
a HWStarter script to use as "BuildCommand", so I can press the "Hammer" in the toolbar to start a Hollywood script or compile for a specific target with rightmouse button.

Only missing thing is SyntaxHighlighting and jumping to the error line and showing the error msg;)

Re: Get the error msg and error line within a script?

Posted: Wed May 02, 2018 2:32 pm
by bitRocky
Just to clarify, with "script" I mean from a shell script not a Hollywood script!

Re: Get the error msg and error line within a script?

Posted: Sun May 06, 2018 12:08 am
by airsoftsoftwair
Yes, that's possible. You can do the following:

Code: Select all

1> Hollywood test.hws -debugdevice @stdout
If you use the special debug device @stdout, the error information will be printed to stdout so you can catch it from a script.

Btw, concerning syntax highlighting in Flow Studio... Nicolai might already be working on this. I talked to him a few months ago and provided him with a free copy of Hollywood so he could add support for it in Flow Studio but haven't heard from him since. So if you're in touch with him, maybe ask him about the status of Hollywood support in Flow Studio. He was definitely interested in supporting Hollywood.

Re: Get the error msg and error line within a script?

Posted: Sun May 06, 2018 12:31 am
by bitRocky
Hmm, could you maybe return WARN, if compiling failed due to an error?

So I could do "IF WARN" and then get the last line and extract the filename, line and msg.

Best would be if you could set some local env-vars: HWERR_File, HWERR_Line and HWERR_Msg for example;)

Nice to hear that about Hollywood support for FlowStudio, I will ask him about the current state!

Re: Get the error msg and error line within a script?

Posted: Sun May 06, 2018 9:44 pm
by airsoftsoftwair
Well, this would require some new options because the current implementation has to be kept because Cubic IDE needs it. But if Nicolai is completing Flow Studio support for Hollywood, I'll think about it :)