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 / Conversion

Author
Message
alpha numeric characters
21
Years of Service
User Offline
Joined: 17th Jan 2004
Location:
Posted: 2nd Aug 2004 03:48
I want to convert my visual basic program to dark basic but i do not understand string parsing in dark basic. This is a snippet of code if you could help me translate the string parsing and the open files part. Thx.

alpha numeric characters
21
Years of Service
User Offline
Joined: 17th Jan 2004
Location:
Posted: 7th Aug 2004 07:12
I was looking through the darkbasic help files and it had examples of opening and editing files but is there a way to do string parsing in darkbasic?
Is it possible to convert my code to db?
Lzdude69
21
Years of Service
User Offline
Joined: 21st May 2004
Location: Indiana
Posted: 7th Aug 2004 12:27
<test>


hyrichter
21
Years of Service
User Offline
Joined: 15th Feb 2004
Location: Arizona
Posted: 7th Aug 2004 12:34
Why convert it from VB in the first place? DarkBASIC is much better suited for games, and unless your VB project is a game, I see no reason to convert it to DB. Visual Basic has much better string commands. The ones with DB are quite pathetic, actually. Plus in DarkBASIC, it's very, very hard to create windows command buttons, text boxes, etc. If you're still determined with converting this, I'll see what I can do to help you out.

alpha numeric characters
21
Years of Service
User Offline
Joined: 17th Jan 2004
Location:
Posted: 8th Aug 2004 00:52
I don't want to worry about the text boxes and stuff, just seeing your input and parsing through the string comparing it to the file to make a graphical ai program. Here is the current VB source code(i know it isn't really great)

All i want to really do is go through the string and the files the same way using the same format

this is the second forms code but for this i can just make it open the dictionary file.
Thx for your help.
alpha numeric characters
21
Years of Service
User Offline
Joined: 17th Jan 2004
Location:
Posted: 8th Aug 2004 01:57
i changed the form2 code(like it matters) but if you want it to add to a program(asssuming you use visual basic)

WARNING:
you end up with the replace file alone and an error saying that file already exist when it does not.
I thought it might help if you had the dictionary file to see the format

on single word search the search word is right below the definer(base word) and it is to respond with the text right below the search word I'm going to make it like the questions so it can be multi worded
on the questions defined by [questions]
all the base words after the definer "Base Q" are searched for then the word after that is searched for to make sure it will say the right thing until the file scan string (filter) equals '. if all the words were found then the text after the , is displayed
that was a mouthful
alpha numeric characters
21
Years of Service
User Offline
Joined: 17th Jan 2004
Location:
Posted: 8th Aug 2004 02:00
yes i know i have an error in the file
also all the search word have to be lowercase because the strings are all lowercase to get an equivalent.
alpha numeric characters
21
Years of Service
User Offline
Joined: 17th Jan 2004
Location:
Posted: 9th Aug 2004 10:30
any one at all knows how to do string parsing?
hyrichter
21
Years of Service
User Offline
Joined: 15th Feb 2004
Location: Arizona
Posted: 10th Aug 2004 23:40
Here is a very simple example. I'll try to work up a little nicer one tonight. This one just checks to see if the word you entered matches any of the words in the dictionary.

Code:


And here is the dictionay file I made. Save this in a file called "dictionary.dct" in the same folder as the source code.


As I said, this is a very basic example. I'll work on doing more things like asking the computer question, etc. when I have a little more time.

alpha numeric characters
21
Years of Service
User Offline
Joined: 17th Jan 2004
Location:
Posted: 11th Aug 2004 10:12
Ok thx for using your time to help me. I have a dirt foundation to build off of(just hope it doesn't collapse)
Its like my VB AI program in its early early stage.
I'm rushing to finish the basic version of a game(meaning as simple as can be,easy for the programmer)
p.s. Dark basic does have the mid$ command after all!!! Does it show up on the help files?(if it does i feel really retarded because i got the unknown command screen)
Thanks alot.
hyrichter
21
Years of Service
User Offline
Joined: 15th Feb 2004
Location: Arizona
Posted: 11th Aug 2004 12:46
You probably used "mid" instead of "mid$" DB's mid$ command isn't very good, though. It only returns one letter from the position you specify in the string. Maybe I'll build me a mid$ function for DB that does all the stuff that VB's does. If you have msn, you can add me, [email protected] so we can communicate easier. This AI thing is starting to gain my interest.

Phaelax
DBPro Master
22
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 11th Aug 2004 14:29
Quote: "any one at all knows how to do string parsing? "


http://www.thegamecreators.com/?m=codebase_view&i=98fd69efed19f2e539dc1a1176789512

"eureka" - Archimedes
alpha numeric characters
21
Years of Service
User Offline
Joined: 17th Jan 2004
Location:
Posted: 12th Aug 2004 08:01
Ok i have the origanal code but i made a new file (edit.dba) and updated it a LITTLE

It was like talking to a phone with a computer on the other side"if you need help press 1, you have selected help press..."
So I went ahead and made it more life like. Also in doing that, I had to change the dictionary file.

It is not a defined fromat so if i type "I am" it says "say" because its the next line. My game still isn't finished . I have it posted before or after this post but its on the first page. I can't get the altimeter to work right( i know its not origanal but there are like only 2 games in that field makeing competition easier .
alpha numeric characters
21
Years of Service
User Offline
Joined: 17th Jan 2004
Location:
Posted: 16th Aug 2004 01:34
I really hadn't had much time to work on it

I decided to cap the rsearch and responce words so you can't type a responce word and get a search word. Also, If you don't add the goto it will also tell you that it hasn'r been programmed so If it does find it, it will go past that.
alpha numeric characters
21
Years of Service
User Offline
Joined: 17th Jan 2004
Location:
Posted: 16th Aug 2004 01:51
sorry i gave you some crappy code

That code isn't much better.
You can type only eat to get a responce.
See any thing wrong.

P.S.
for all you other 1xx people if you have any ideas please post them

Login to post a reply

Server time is: 2025-05-25 09:46:15
Your offset time is: 2025-05-25 09:46:15