Page 1 of 1

How to halt compilation and execution after using a tool?

Posted: Fri Jul 27, 2012 8:30 pm
by itto
First and foremost hello to everybody and congratulations to the authors of this fantastic software! I'm coding in PureBasic since one week and I must say I immediately fell in love with it! :D

I wrote a tool which processes the source code which is about to be compiled, and checks whether a procedure contract has been respected or not. So far so good, the If there are one or more contracts not respected, the source should not compile the source at all, since something is not ok. The problem is I don't know a good way to stop that.

Right now I'm simply deleting the temp file which the compiler is expecting to compile, thus generating a compiler error (line not found), but effectively preventing the compilation. I was also thinking about inserting a new line in the code with some wrong statement.

Is there a command to tell the compiler to halt the compilation process? Or anyone has a better idea?

Thanks!

Re: How to halt compilation and execution after using a tool

Posted: Fri Jul 27, 2012 10:34 pm
by kenmo
Yes, insert this line:

Code: Select all

CompilerError "Invalid procedure found"
And welcome to PureBasic :)

Re: How to halt compilation and execution after using a tool

Posted: Sat Jul 28, 2012 7:42 am
by itto
Ah that really looks like the command I need! Thank you for your help! :D

Edit

That did the trick! The debugger now shows the right message error (instead of the tool), and it even color/focus the wrong line! 8)

Thank you so much! Now I will work on making contracts and coding conventions way more strict :twisted: