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 / Text disappears when try to input

Author
Message
steampowered97
9
Years of Service
User Offline
Joined: 3rd Mar 2015
Location:
Posted: 28th Apr 2015 18:04
After I print a question on screen and then all the possible answers (on their own lines, its multiple choice), the user is supposed to input their answer. I tried to use the input function to do this but as soon as the program gets there, it removes the question and answers from sight. the question itself still works as it should though, I just can't see the question when I input the answer. Here's the code for this part:

I tried moving around/removing the 'do' loop, same thing happens, adding and subtracting 'sync's and using 'inkey$' instead of 'input' (which kept the question there but was not suitable for my program's purposes).
As always, any help is appreciated
Sasuke
18
Years of Service
User Offline
Joined: 2nd Dec 2005
Location: Milton Keynes UK
Posted: 29th Apr 2015 01:50
It must be something else in your code cause that by itself should work fine. Example, does this display everything:



"Get in the Van!" - Van B
WickedX
15
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 29th Apr 2015 03:05
You need to turn Sync Off before using the Input function.
steampowered97
9
Years of Service
User Offline
Joined: 3rd Mar 2015
Location:
Posted: 29th Apr 2015 16:43
Tried both of your suggested but they both do the same thing. Except when turning sync off the letter you input flickers a bit. The weirdest part is the input function not even displaying its own text. I guess I'm stuck with using inkey$?
And should I post my whole program?
MrValentine
AGK Backer
13
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 30th Apr 2015 12:17
Tae a look at the entry$() command

steampowered97
9
Years of Service
User Offline
Joined: 3rd Mar 2015
Location:
Posted: 30th Apr 2015 15:39
entry$() slashed my framerate in half and froze my computer when I tried to use it.
steampowered97
9
Years of Service
User Offline
Joined: 3rd Mar 2015
Location:
Posted: 30th Apr 2015 15:51
Ahhh... This is very frustrating. Here's my whole program:

Sasuke
18
Years of Service
User Offline
Joined: 2nd Dec 2005
Location: Milton Keynes UK
Posted: 1st May 2015 00:20 Edited at: 1st May 2015 00:24
Okay, you need to make a Sync call before using Input, example:



Note that using Input will stall your program and will be held at the input command until executed (return key pressed or something).

Entry$() won't stall your program and is better suited for this, example:



Just note that you will need to check when you've finished your entry, so when the return key is pressed, then make a condition to stop entry.

"Get in the Van!" - Van B
steampowered97
9
Years of Service
User Offline
Joined: 3rd Mar 2015
Location:
Posted: 1st May 2015 14:45
Same problem with the sync there and entry$() still froze the program.



The funny thing is, I copied that part to another program without anything else (just the question and answer) and it worked fine on that, but when I used the exact same code on the original, character for character, the text still disappeared. Leading me to believe that this part probably isn't causing it... but then I'd have no idea what else would be
Sasuke
18
Years of Service
User Offline
Joined: 2nd Dec 2005
Location: Milton Keynes UK
Posted: 1st May 2015 21:50
Something wrong with your DBP. I'd suggest reinstalling it and making sure it's up to date

"Get in the Van!" - Van B
WickedX
15
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 2nd May 2015 01:20
The problem is with your code. Remove the do/loop and make these changes to this section of your code.

steampowered97
9
Years of Service
User Offline
Joined: 3rd Mar 2015
Location:
Posted: 4th May 2015 18:03
Nope... text is still invisible. I don't think the sync or the loop is the problem. I'm going to download dbpro and try the program on another machine because I'm starting to think sasuke is right.
steampowered97
9
Years of Service
User Offline
Joined: 3rd Mar 2015
Location:
Posted: 7th May 2015 14:44
I decided to use the language Visual Basic to display the questions. It's easier and actually looks better than what I could do with DBP. The 2 processes pass data back and forth so the right questions are displayed. Thanks for all your help Sasuke and WickedX!

Login to post a reply

Server time is: 2024-11-27 05:52:57
Your offset time is: 2024-11-27 05:52:57