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 Professional Discussion / Converting QBasic to DarkBasic

Author
Message
hank
13
Years of Service
User Offline
Joined: 10th Feb 2013
Location: Kentucky, USA
Posted: 27th Jun 2013 15:08
Here is the Qbasic code



So far this is what I have in DBpro



I can't figure out what to do with this line
CurrentContext$ = STRING$(ContextLength, EndOfResponseCharacter$)

I figure that CurrentContext$ equals EndOfResponseCharacter$ multiplied by ContextLength$ but when I try that, I don't get any result as in QBasic.

Any help is appreciated.
Phaelax
DBPro Master
23
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 27th Jun 2013 16:25
String$() function:
http://www.angelfire.com/scifi/nightcode/prglang/qbasic/function/strings/string.html

This will give the same functionality.


Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 27th Jun 2013 16:28 Edited at: 27th Jun 2013 16:30
Nevermind somebody has already replied.

hank
13
Years of Service
User Offline
Joined: 10th Feb 2013
Location: Kentucky, USA
Posted: 27th Jun 2013 17:38
Thank you, that's what I was looking for. For some reason now nothing gets saved to the text file and the computer responses with nothing or either just some random letters. I'll go back through the code and see if I converted it over to DB correctly.

Here is the link to the original QBasic code.
http://en.literateprograms.org/Chatterbot_(QBASIC)
hank
13
Years of Service
User Offline
Joined: 10th Feb 2013
Location: Kentucky, USA
Posted: 27th Jun 2013 17:49 Edited at: 28th Jun 2013 15:49
And here is the code I have so far.


*EDIT*

Silly me, the CLOSE FILE 1 in Storedata should be CLOSE DATAFILE 1. Now it saves to the text file. I still don't get the same results as in qbasic though. In qbasic a string of 6 characters gets saved to the text and the following line is 1 character and this is repeated over again: 6 chars, 1 chars, 6 chars, 1 char and so on.

The new dbpro code

Login to post a reply

Server time is: 2026-07-06 20:29:57
Your offset time is: 2026-07-06 20:29:57