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 / TDK's IDE?

Author
Message
Libervurto
14
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 19th Jan 2012 12:08
Does anyone have it? The link no longer exists
I found a generic editor that could be used for DBC, it can compile the code with the DBC compiler but the problem is instead of running the code it opens the default editor and puts the code in the editor. Is there a command line variable or something to make the DBC.exe run the code instead of opening the default editor? How did DarkEdit do this?

Join DNG today! We are a game development team open to all. Visit our Headquarters to learn more.
Latch
14
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 19th Jan 2012 20:00
Quote: "Does anyone have it? The link no longer exists "

Was that editor ever finished?

Quote: "I found a generic editor that could be used for DBC"

What editor is that? I ask because depending on the editor, there could be different steps you may need to take. In general, to run DBC directly from an editor, the editor would have to have a function or menu item that can access the command line or the shell; either automatically or manually.

Also, if you wanted syntax highlighting, the editor would need to have some kind of language editor or manager.

If the editor has a shell function, you can usually assign a key combination or a function key to execute a specific commandline instruction. In the case of DBC, you would need to execute any of the following commands:



Substitute the names and paths for your files.

Quote: "How did DarkEdit do this?"

There's another layer to consider. Usually when an editor executes a shell command on a file you are working on, the editor needs to save the file first. This is good and bad. If you want to test changes on the fly, you may not want those changes saved in your true source. DarkEDIT creates a temp file to which it saves your current changes and the then shell executes db.exe and identifies the temp file. This allows you to test whatever you want without those changes being committed to your actual source. When you are satisified with your changes, you can then save youe source.

I've messed around with several different editors and very few have a simple means of saving a temp file and not the true source and then running commandline instructions (compiling) on that temp file. Most will save the current file and then run the shell on that. But it's not necessary to create the tempfile to get your code compiled and ran.

However, I prefer compiling a temp file so my original source isn't changed and saved until I want it to be so.

Do you not have DarkEDIT?

Quote: "Is there a command line variable or something to make the DBC.exe run the code instead "

You can also execute the command line instructions outside of the editor using the command console. That means you could basically use any text editor you want to write your code, then compile it at the DOS prompt.

Enjoy your day.
Libervurto
14
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 19th Jan 2012 20:07
Thanks Latch, the editor is called PSPad. The main reason I don't want to use darkedit is a very small issue, it's the image overlapping the titlebar. It's out of position with the title bar buttons and irritates me constantly

I'll have a go with what you suggested and post my results.

Join DNG today! We are a game development team open to all. Visit our Headquarters to learn more.
Latch
14
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 19th Jan 2012 22:41
I just remebered one other thing: the compiler messages (syntax errors and what not) is returned in a text file named:

DBCompile.LOG

This file is located in the working directory of your project. If your editor allows it, you may be able to add a command to automatically open this file after compiling.

Enjoy your day.
Libervurto
14
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 20th Jan 2012 12:37 Edited at: 20th Jan 2012 12:38
yeah this has a field for the log file
I couldn't get it to run from the editor which is a shame, the most it will do is open the file I'm working on into the default DBC editor. It will compile without opening the DBC editor though, which confuses me. I'm sure this would work if DBC.exe wasn't an executable.

Join DNG today! We are a game development team open to all. Visit our Headquarters to learn more.
Latch
14
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 21st Jan 2012 06:04
@OBese87
I downloaded PSpad so I could understand what you were seeing. It's possible to execute your file without loading the editor. You have to set up your syntax highlighting for DBC first.

Note: The keywords cannot have spaces in them or the highlighting won't work. At least that's how it seems (and seems to be the problem with many editors). If you break down all of the key words into their separate parts as individual keywords and skip any repeats, it should work:

MAKE OBJECT SPHERE

becomes

MAKE
OBJECT
SPHERE

each as a separate keyword. For MAKE OBJECT CUBE, you would only add CUBE as a new keyword etc.

click on:

Settings > HighLighter Settings

Once the highlighting is setup for DarkBASIC, assign it to one of the <not assigned> groups at the bottom of the highlight list.

While on this menu selection and dark basic is assigned to a group and selected, click on the Compiler tab at the top-right.

Under the Compiler: label , choose or type in the FULL path to the windows command console in the edit box. On early versions this would be:

C:\windows\command.com

On XP and above I think it's:

C:\windows\cmd.exe

In the next edit box under Parameters, type in or paste /C and the full path to the db.exe inside quotes followed by the -x switch and the %File% parameter to run the current file. For example:

/C "C:\Program Files\Dark Basic\db.exe" -x %File%

The /C is actually a siwtch that applies to cmd.exe and closes the console window after db.exe is run from the command line. This will run and compile your code but not initiate the built in editor.

Under the LOG File: label, type in

%Dir%\DBCompile.log

This will load the error log into the display box in PSPad. However, I noticed that it is always behind by one execution. You have to execute the program twice to get the last error message. It seems PSPad loads the log file BEFORE it runs the code, or it saves the source file AFTER it runs it so it's always out of sync with the log file.

Enjoy your day.
Libervurto
14
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 21st Jan 2012 13:01
Wow thanks latch!
I set it up exactly how you said and even the log file works properly for me. cmd.exe is in C:\Windows\System32 on windows 7.
My first task is to write a program to restructure the keywords as single words.

Join DNG today! We are a game development team open to all. Visit our Headquarters to learn more.
Libervurto
14
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 10th May 2012 03:40
Hey TDK if you are reading this I thought of a feature that is lacking from most IDE's: tab alignment. Could you make it so I could highlight a block of code and adjust the tab alignment of the entire block like the ruler in Word?

WARNING: The above comment may contain sarcasm.

Login to post a reply

Server time is: 2020-08-05 09:33:59
Your offset time is: 2020-08-05 09:33:59