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.

Newcomers DBPro Corner / (DBP) letting the program read a text file and then use the commands in the TXT file.

Author
Message
Silvester
18
Years of Service
User Offline
Joined: 7th Dec 2005
Location: Netherlands
Posted: 6th Jun 2006 22:54
Now the title explains alot,but now my "Sample codes"

If i type this in a .*TXT file:



How do i let it run inside the DBP program WITHOUT typing it into DBP?

i need to know it for an unlimited amount of lines.Since the project where it is for needs that...

Thanks for your time,
Master Mind.

NEW e-Drome Productions site!!!
http://e-dromeproductions.cv.vc/
D Ogre
20
Years of Service
User Offline
Joined: 19th Nov 2003
Location:
Posted: 7th Jun 2006 01:10
You will have to write a text parsing program. I don't know why you would want to do this, but it could be done. It would take a lot of coding to do it.

You would need to load the text file either with a lot of read commands or make a memblock from a file. I would use the later. Then you would have to parse thru all the data checking for syntax and errors along the way. Take all the data collected and store it as an array or arrays. Compare all that info with a known data set (probably data statements or another file) and then execute that command or commands with the parameters given.

Very Generic Example:


I'm not about to write it for you. I'll help with certain problem issues, but basically you're on your own.
boymonkey 130
18
Years of Service
User Offline
Joined: 16th Oct 2005
Location:
Posted: 7th Jun 2006 02:36
you could just copy and paste the text. Doesn't that work?
Slayer93
20
Years of Service
User Offline
Joined: 5th Aug 2004
Location: I wish I knew
Posted: 7th Jun 2006 03:41
You would have a problem with if/endif, do/loop, repeat/until,ect becuase you have to close them when you open them.

You could always use the #include command but that only includes functions. Or just add a dba to the main source to seperate it

Quote: "you could just copy and paste the text. Doesn't that work?"


No because if you made an exe you wouldn't include the whole compiler.

NARUTO IS THE NINJA.....not really
[url=http://forum.openmmo.co.uk/index.php?topic=328.0]
WIP...4 Elements
Silvester
18
Years of Service
User Offline
Joined: 7th Dec 2005
Location: Netherlands
Posted: 7th Jun 2006 04:37 Edited at: 7th Jun 2006 07:52
Uhh,my program IS the compiler for my program.

And i just started development on it,for now i can make a cube in it on 3000 different lines...

NEW e-Drome Productions site!!!
http://e-dromeproductions.cv.vc/
X Trade
20
Years of Service
User Offline
Joined: 19th Feb 2004
Location: near bristol, UK
Posted: 7th Jun 2006 14:25
the easiest way to do it would be to have each arguemjent on a different line. but it gets complicated when you want variables. i wrote a basic scripting system that uses variables and the lot in DBP called 'ALscript' but it was very slow.

www.AoFP.co.uk
D Ogre
20
Years of Service
User Offline
Joined: 19th Nov 2003
Location:
Posted: 7th Jun 2006 15:02
Slayer93 and X trade have very valid points. Logic and loop commands would be a tricky and complicated issue. Depending on what you have your script interpreter do, it would be very slow. If you want the program to recognize everything that the actual DBPro compiler does, this would mean that your program has to account for all the errors, syntax, variables, logics, commands and functions. Not to mention the text and file handling portion. You would basically have to write a script interpreter that emulates DBPro exactly. Like I said it would take a lot of code to do it. Good luck!
Silvester
18
Years of Service
User Offline
Joined: 7th Dec 2005
Location: Netherlands
Posted: 7th Jun 2006 16:52
UUH...

now i made myself a way to let it do the codes,(It reads all lines to check for a code type) but it wont check the lines with the "Read String 1,Line1$" command

NEW e-Drome Productions site!!!
http://e-dromeproductions.cv.vc/
Getix Interactive
18
Years of Service
User Offline
Joined: 4th Nov 2005
Location: US
Posted: 8th Jun 2006 04:02
Master Mind,
try using a .ini file for this.


Getix Interactive and Nanovision. Good Combo.
www.getixinteractive.com
Silvester
18
Years of Service
User Offline
Joined: 7th Dec 2005
Location: Netherlands
Posted: 8th Jun 2006 07:00
then ir reads the file to print it in text,but it has to read it and then do something i give it orders to trough DBP.

NEW e-Drome Productions site!!!
http://e-dromeproductions.cv.vc/

Login to post a reply

Server time is: 2024-09-25 01:32:49
Your offset time is: 2024-09-25 01:32:49