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 / Command Line Compiler

Author
Message
pictionaryjr
15
Years of Service
User Offline
Joined: 12th Mar 2009
Location:
Posted: 10th Jul 2009 18:48 Edited at: 11th Jul 2009 07:59
I was looking through the help files on Dark Basic and pulled up this web page [href]C:\Program Files\The Game Creators\Dark Basic\help\compiler.html[/href] What I'm not sure about is how to use them. They don't look like commands in DarkBASIC, but I'm interested in them in the fact, and tell me if I'm wrong, that they can be used to create DarkBASIC executables outside of the darkbasic program. Any help is appreciated.
Grog Grueslayer
Valued Member
18
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 10th Jul 2009 20:05 Edited at: 10th Jul 2009 20:08
Yes, that help file is to show people how to compile programs outside of the editor but it's not like you want. It's so people can create their own editors and be able to access the Darkbasic compiler.

You can't use the info in that help file to make an .exe in Darkbasic to make .exe files unless you include Darkbasic with your program... which you can if you buy a new Darkbasic for every program you sell. Or if your program is simply an IDE that requires Darkbasic that you don't provide.

pictionaryjr
15
Years of Service
User Offline
Joined: 12th Mar 2009
Location:
Posted: 11th Jul 2009 00:40 Edited at: 11th Jul 2009 08:00
I'm not planning to sell anything was just messing around with it. So, basically this is just a way to make something like DarkEDIT? How would I use it then?
Grog Grueslayer
Valued Member
18
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 11th Jul 2009 08:14
Yup. Are you going to make your own IDE?

pictionaryjr
15
Years of Service
User Offline
Joined: 12th Mar 2009
Location:
Posted: 11th Jul 2009 08:16 Edited at: 11th Jul 2009 08:29
Before I do anything, I have to figure out how to use the commands.

Here's a list of them:



EDIT:
What I'm really trying to do is see if I can figure out a way to make a standalone executable that would be able to make other standalone executables.
Grog Grueslayer
Valued Member
18
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 11th Jul 2009 10:59
Quote: "What I'm really trying to do is see if I can figure out a way to make a standalone executable that would be able to make other standalone executables."


I know... re-read the second part of my first message.

Robert The Robot
17
Years of Service
User Offline
Joined: 8th Jan 2007
Location: Fireball XL5
Posted: 11th Jul 2009 16:58
@pictionaryjr
The commands you've found are indeed a way of making an IDE like DarkEdit. Whenever a program is run, you can pass additional information to the program as a string of text that comes after the exe's name. If you look up "Shell Execute" (might be "Execute File", I can never remeber ) in the help files, you'll see three parameters for it and the third is the optional info.

Now, when you press F4 in a program like DarkEdit, Dark Edit calls "Execute File" (whatever language it's in) but passes in the line "DB.EXE -c test.dba". DB.exe starts but DarkBasic can read the data that follows, and knows it has to open the file "test.dba" and compile it (the "-c" bit).

Quote: "What I'm really trying to do is see if I can figure out a way to make a standalone executable that would be able to make other standalone executables."

I'm afraid the answer is no. This came up not long ago in DBPro, and it couldn't be done - you'd have to work out how to write machine code that the processor could understand an it is a nightmare. That's not to say you can't make your own language - FPS Creator uses a scripting language that was written in DBPro.

Basically, you just write your language by giving each command a number, and then when you "Compile" your code, you convert all the user's written text into those numbers - like Java compiling to bytecode. You then have another program that reads those numbers from the data file, and then executes the relevant commands.

I'm not sure what the point of all this would be, but certainly parts of what you're asking for are possible, although it would take a lot of work.

Hope this helps!

"I wish I was a spaceman, the fastest guy alive. I'd fly you round the universe, in Fireball XL5..."
Caleb1994
15
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 18th Jul 2009 01:22
go to start>All Programs>Accessories>Command Prompt


Type this:

CD C:/Program Files/Dark basic software/dark basic/

then press enter. make a new file like this

C:/Test.dba

and type "Print "Hello World"" in it.

go back to command prompt and type this

DB.exe -x C:/Test.dba

the screen will flicker and run your Test.dba file.

when you did CD it set the Current Directory(Just like db) then when you typed db.exe it ran that exe(Like typing Execute file in db) and the -x c:/test.dba is the command line that is passed to the program. (the second parameter of the Execute file Command in db)

that executes a file. those command line things are meant to be used with other languages to create ide's. so in c++ you could use the ShellExecute function and execute db.exe for a ide and pass the command line to db to run the dba file.

if you try and run a fullscreen db file from a fullscreen db exe then you will get a DirectX error. it is possible to make a ide in db for db but it would be difficult. and it could not be full screen.

New Site! Check it out \/

Login to post a reply

Server time is: 2024-05-20 10:12:04
Your offset time is: 2024-05-20 10:12:04