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.

Dark GDK / DarkGDK/C++ Question

Author
Message
Dragon slayer
13
Years of Service
User Offline
Joined: 3rd Nov 2006
Location: Bourbonnais Illinois
Posted: 1st Apr 2014 02:15
I don't know if I am having a brain cramp or what but I can't remember how to do this, print user input at the end of a line instead of below it

dbPrint("Enter whatever number you want x to be: ");
x = atoi( (dbInput() ));

This way when you type the number in and hit enter it prints on the next line. How do you get it to print on the same line as you are typing it in?
The Tall Man
6
Years of Service
User Offline
Joined: 16th Nov 2013
Location: Earth
Posted: 1st Apr 2014 02:53 Edited at: 1st Apr 2014 02:55
This is from the documentation:

This command will print text, numbers, variables and strings to the screen. You can position where the text will print using the dbSetCursor command. You can separate items you wish to print on the same line by using either a semi-colon or a comma. If you add a semi-colon at the end of your print list, the next dbPrint command will add to the end of the last print line.

Syntax
void dbPrint ( char* szStatement )
Rudolpho
13
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 1st Apr 2014 15:00
Try dbPrintC() if that exists in GDK. Otherwise, does the dbInput() function not take an optional prompt string that will be displayed before the input text?


"Why do programmers get Halloween and Christmas mixed up?"
Dragon slayer
13
Years of Service
User Offline
Joined: 3rd Nov 2006
Location: Bourbonnais Illinois
Posted: 1st Apr 2014 23:29
That's what I was looking for Rudolpho, I don;t think Tall man understood what I was looking for.

If you have a print statement dbPrint("Type in a number: ");

when I run it it will print the line

Type in a number://When they type in the number this is where you would expect it to be typed, right behind the statement but it is not in DarkGDK it drops down to the next line and that is where they type in the number.

dbPrintC() does it the way it should be.

Login to post a reply

Server time is: 2019-12-15 07:14:09
Your offset time is: 2019-12-15 07:14:09