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.

Work in Progress / Dark Source-Replace, Globals and Tapes in one package that actually works

Author
Message
BearCDPOLD
21
Years of Service
User Offline
Joined: 16th Oct 2003
Location: AZ,USA
Posted: 30th Jul 2005 00:03 Edited at: 30th Jul 2005 20:17
I've been working on this for a few days, and finally have something good to show.

I started using CodeKeeper recently because it would use source replace to allow you to use both global variables, and that wonderful taping feature which would allow you to do use global variables and other non function related things in #include files. Unfortunately the editor isn't very stable, and it all of a sudden just stopped replacing things properly. I thought I must not be the only person to have experienced this problem, or if nobody else has then this at least gives you the opportunity to use globals and taping without having to deal with bugs.

The beauty of this is that it's a console application (yeah, I'm a C++ nub, it worked to my benefit anyway). Once I get command line compiling up and running you will be able to compile, run, and build your DBC programs from any text editor that allows you to run external exes or batch files.

My editor of choice from now on will be Crimson Editor, and I have provided darkbasic syntax definition files for you to stick in your Crimson Editor install directory in the "spec" and "link" directories. Once I get command line arguments all done I'll also release a user tool you can load into the program with 4 options for compile, run, build debug, and build final.

The current version will read in your main source file, check for TAPE statements, and inject code from the files specified in your TAPE statements into your main source file exactly where you put the TAPE. The limit, of course, is that you can only tape from the main source file.
It will also convert GLOBAL statements into DIMs and change the variables in 0-element arrays DarkEdit style.

Syntax for globals is exactly like DarkEdit:
"GLOBAL myvar# : myvar#=4.5" == "DIM myvar#(0) : myvar#=4.5(0)"

Syntax for TAPES works exactly like #include, except you would of course use TAPE and the code is injected into the point at which you typed the TAPE statement in your main source file.

Downloads:
DSR.exe - This is the current version of Dark Source-Replace. It will prompt you to enter a file name, then perform all the checks and replacements I mentioned above and tell you what the file is called that it wrote to, it does not alter your code, just copies it.

Below are the darkbasic syntax definition files that I whipped up real quick for Crimson Editor. This allows Crimson Editor to do syntax highlighting for DB commands and will automatically detect if you are using DB based on the extension of the file.

Keywords-Goes in the Crimson Editorspec directory.
Specification-Goes in the Crimson Editorspec directory.
Specification-Goes in teh Crimson Editorlink directory.


Planned Features:
Run as a command line tool with arguments defining specific file information, exe destination, compile/run/build options
User tool to integrate into Crimson Editor
DBCompile.log output


Please let me know of any bugs you find, any features you want, any useful console output you'd like when you run the program, or any old c&c you may have.


I'm going to eat you!
Robot
20
Years of Service
User Offline
Joined: 27th May 2004
Location:
Posted: 30th Jul 2005 13:22
Looking good

Quote: ""GLOBAL myvar# : myvar#=4.5" == "DIM myvar#(0) : myvar#=4.5""

Shouldn't that be "GLOBAL myvar# : myvar#=4.5" == "DIM myvar#(0) : myvar#(0)=4.5"?

The happenings of tommorow are behind us now
BearCDPOLD
21
Years of Service
User Offline
Joined: 16th Oct 2003
Location: AZ,USA
Posted: 30th Jul 2005 20:27 Edited at: 30th Jul 2005 21:15
Oops, you're right, . All fixed now.

Small update:

You can pass the following command line arguments to DSR:
-c
-x
-b
-f
-path

The first four, -c,-x, -b, and -f are the standard DB.exe arguments,
-c=compile
-x=run externally
-b=build debug
-f=build final

"-path" allows you to set the path to DB.exe. It's stored in a file in the same directory as DSR.exe called DSRconfig.cfg. If no path is derrived from the file then it uses the default, "Crogram FilesDark Basic SoftwareDarkBasic".

Todo:
Get some meaningful output out of DBCompile.log


[EDIT]
Fixed a couple bugs:
*DB needs spaces after REMs, forgot to do that when adding file separator levels into DSRPROCESSED file.
*Fixed bug where it wasn't writing the last line of the tape file to DSRPROCESSED.


I'm going to eat you!

Login to post a reply

Server time is: 2024-11-17 01:09:07
Your offset time is: 2024-11-17 01:09:07