Get the error msg and error line within a script?

Feature requests for future versions of Hollywood can be voiced here
Post Reply
bitRocky
Posts: 80
Joined: Fri Nov 14, 2014 7:01 pm

Get the error msg and error line within a script?

Post by bitRocky » Tue May 01, 2018 8:02 pm

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;)

bitRocky
Posts: 80
Joined: Fri Nov 14, 2014 7:01 pm

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

Post by bitRocky » Wed May 02, 2018 2:32 pm

Just to clarify, with "script" I mean from a shell script not a Hollywood script!

User avatar
airsoftsoftwair
Posts: 2477
Joined: Fri Feb 12, 2010 3:33 pm
Location: Germany
Contact:

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

Post by airsoftsoftwair » Sun May 06, 2018 12:08 am

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.

bitRocky
Posts: 80
Joined: Fri Nov 14, 2014 7:01 pm

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

Post by bitRocky » Sun May 06, 2018 12:31 am

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!

User avatar
airsoftsoftwair
Posts: 2477
Joined: Fri Feb 12, 2010 3:33 pm
Location: Germany
Contact:

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

Post by airsoftsoftwair » Sun May 06, 2018 9:44 pm

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 :)

Post Reply