Highlighting and Compiling QCs with ConTEXT
For help, see the VDC Editing Help and Wikipedia cleanup process. Also, remember to check for any notes left by the tagger at this article's talk page.
What you need
How and what
ConTEXT is a beefed up notepad useful to programmers. One of the handy things it has built-in is a batch system that can be set up to compile files depending on their endings. I told ConTEXT that whenever i have a .qc file open and press F9, it should execute studiomdl.exe
and the path to the qc file. This compiles the model for you while you are in the editor, and it saves the hassle of keeping a shortcut of studiomdl around. I also prefer it over custom compile tools because of its simplicity, and after writing 50+ qc's I got used to the whole qc format, so I don't really need a tool to make a qc for me.
Another advantage with ConTEXT is it's ability to color code functions and values, witch makes it a lot easier to read the file.
How to set it up
First install ConText, then after that is done, open it and go to the Options->Environment Options on the menu bar.
At the top, go to the Execute Keys tab and press Add on the left side.
Type in the QC file ending (no period)
Select one of the 4 F# functions, I use F9. You can basically have 4 different batches done on one format.
Execute: This is the path to your studiomdl.exe.
Parameters: The other important one, this gives the path of the .qc file. Use %n.
Capture Console: This just echoes the output of studiomdl at the bottom of context instead of a cmd or dos window, handy for spotting errors.
Next download the qc highlighter and put it in the highlighter folder where you installed ConText. Now ConText will color the functions, values and operators in the QC. This helps a lot when bug fixing and trying to understanding the QC format.
Thats pretty much it, now all you do is open any QC file and press F9, and it will compile it for you, easy stuff.