It's not easy to set it up. It takes a bit of work.
Did you setup DarkBASIC as a syntax highlighted language?
Tools > Language Editor...
Make sure you follow the instructions in the Help
Once the language is set up properly, you'll want to be able to add tools to compile your dbc script, to run it, to build a no media exe, and to build a final exe.
Refer to the DBC document in the DBC help labled
compiler.html for the syntax of running DB.exe from the command line.
Now, to add a tool, open a .dba document.
Click on Tools > Tools Configuration
For this example, we'll setup a tool to run DB code.
1) Under
Menu Item Text, type the name of the tool as it will appear in the Source Edit drop down: We'll call it
Run DBC Code
2) Under
Command Line click on the [...] box to the right of the text entry field. This should open up a browse dialog. look for the full path to DB.exe. When you find it, double click on DB.exe and the path should appear in the text entry box. It should look something like (replace C: with whatever drive DB is installed on):
C:\PROGRA~1\DARKBA~1\DARKBA~1\DB.EXE
If you can't see the full text, use the arrow keys left or right while the cursor is in the text field to scroll.
At the end of the path, type a space and then -x so the line will look like
C:\PROGRA~1\DARKBA~1\DARKBA~1\DB.EXE -x
Now click on the
> button and choose
Full Path and File Name
the line should look like
C:\PROGRA~1\DARKBA~1\DARKBA~1\DB.EXE -x $(FullName)
Make sure there is single space between -x and $(FullName)
3) Prompt for arguments should NOT be checked
4) Under
Working Directory, click on the folder icon button to the right (the second button, not the ... ).
$(FileFolder) should appear in the text field. Leave that as it is.
5) Leave
Don't save current file before running tool unchecked. If you check this box, then you will run whatever version of the file you had saved last and not the version you just edited. If you check it, then you just have to manage saving the file yourself before running it if you want to test your updated code. There is a way to run the updated code without saving your edits, but that involoves creating a temporary file which involves Source Edits scripting language BML. So the easiest thing to do is to leave the box unchecked.
6) Check or uncheck
Save all open files before running tool according to your own discretion.
7) Check Add to Toolbar to add an icon for this tool to the Source Edit toolbar. You can change the icon as you wish, but for now, just leave it as the hammer.
Make sure no other checkboxes are checked. Then click on the [Add] button on the top right of the dialog.
You can try out the new tool by clicking on the hammer on the Tools toolbar. If the Tools toolbar isn't visible, click on View > Toolbars and check it. You can also launch your tool from the menu by clicking Tools > User Tools and Add-Ins .
If everything went according to plan, your DB program should have launched. To get the Compilation status, you'll have to look at the contents of the file dbcompile.log This will contain the syntax errors and successful compilation messages.
You can build a tool to check that as well. If you want it to appear in a message box after you compile or run a program, you'd have to program the tool in BML using VBscript as an Add-In. But if you want to simply look at it, you could create a tool that launches notepad.exe and add dbcompile.log as it's argument just like we did when making the DB launch tool. You wouldn't have the -x in it though because that is a switch specific to DB.exe. Everything else in the tool would be pretty much the same.
So you can build as many tools as you want to do different things. If you really want to tailor Source Edit to do what you want, I highly recommend the BML scripting Add-In app.
Enjoy your day.