Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / source edit????

Author
Message
Caleb1994
16
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 11th Mar 2009 02:57
ok well i came across one of the ide threads and latch said it was good and i did what he said but i can't get it to work ah any help?
Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 11th Mar 2009 04:11
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.
Caleb1994
16
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 11th Mar 2009 04:21 Edited at: 11th Mar 2009 04:29
thank you so much i saw your post in the other one and this looked very but i couldn't get it to work yay! lol


it worked just the syntax highlighting isn't working i added the language like the help said and added keywords.txt for the keywords from darkedit but it doesn't highlight. any ideas? although it does compile so thats all that really matters
Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 11th Mar 2009 05:14 Edited at: 11th Mar 2009 05:19
hmmm... Well here's the general setup:
In the Language editor make sure you've created a new language called DarkBASIC. Once you have, make sure you've selected it at the top so all the changes you make to the language apply to DarkBASIC.

Under Misc Settings, the only thing there should be is a double quote in the left column
"

Under Keywords, in Scope Keywords section the following should be in the left and right columns respectively:



For the other keywords, use the attached text file (use the import button under other keywords). This file should be formated specifically for use with Source Edit. Source Edit delimits keywords with a white space so it's not possible to a single keyword like SET OBJECT COLLISION ON . Each word is treated as a keyword or unpredictable results can occur. This file is setup with this in mind.

For Operators, use


For Comments:
Multiline

Single Line
`
REM

For the remaing language definition headings, make sure they are empty.

Click on the save icon at the top.

Click on Tools > Options:
Under Colors/Fonts, set them up how you want them for the different highlighting. The way I setup the keywords is such that the operators should be the same color and style as keywords. This is so keywords that contain things in () will look like the parenthesis belong to the keywords. And it makes the operators stand out.

Still in Tools > Options, under the subheading Files, use the Language drop down to select DarkBASIC. Under Maps to file, type *.dba
Under File in Open/Save dialog box
DarkBASIC in the left text box
*.dba in the right text box
Then click on [ADD]
The selection will be at the bottom. Use the second set of arrows to change it's location in the list.

When finished click on [APPLY] then [OK]

[EDIT]
There's an error in the keywords file. Erase the line NET GAME. These words are already covered in the file and this repeat can cause problems.

Enjoy your day.

Attachments

Login to view attachments
Caleb1994
16
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 11th Mar 2009 06:01 Edited at: 11th Mar 2009 06:03
thank you but sorry. i didn't realize that at the top of the page you had to pick you language i thought you picked it from the language editor so it was on the wrong one :/ thanks though lol

i will use your keywords though since there made for this

Login to post a reply

Server time is: 2025-06-08 02:12:29
Your offset time is: 2025-06-08 02:12:29