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 / executing files

Author
Message
pictionaryjr
15
Years of Service
User Offline
Joined: 12th Mar 2009
Location:
Posted: 24th Dec 2009 08:37
alright im just working on a little thing and was wondering how i could go about executing a dba file i've already created. like if i had "sync on" written as a command in the dba file. how would i make it execute the dba file and then perform that command and stuff?
Caleb1994
15
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 27th Dec 2009 08:30
you need dbc installed, but there is a way. You need to call db.exe using execute file. make the command line like this:

-c path/to/your/file.dba

If i remember correctly -c is compile and run. there is also different ones to build executables and just compile not run.

New Site! Check it out \/
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 29th Dec 2009 00:24
@pictionary
Do you mean executing a dba script by shell or commandline like Caleb1994 is suggesting? If so, take a look in the help folder of your DarkBASIC installation directory. There should be a file labeled compiler.html . This file describes how to run .dba scripts from a shell or a command line. You could, for example, write a .dba script in notepad and then run it, compile it, even make it into an executable from the command line, a batch file, or from the shell.

But, if your intention is to distribute an executable and have a user run new .dba code from it, you can't really do that directly. You would have to read lines in from the .dba file, parse out the commands, and then run the equivalent code in the exe.

So if you had the command sync on in a .dba file, you'd have to read that line in as a string, parse it out (separate it into identifyable pieces) , and then call the appropriate DBC command(s). For example:



Enjoy your day.

Login to post a reply

Server time is: 2024-04-25 08:02:22
Your offset time is: 2024-04-25 08:02:22