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.

AppGameKit Classic Chat / Multiple text Inputs

Author
Message
TonytheTiger
12
Years of Service
User Offline
Joined: 14th May 2012
Location:
Posted: 18th May 2012 16:08
I am trying to get multiple items enter into variables. Things like Name, Age, Location. I can't seem to able to get more than one value inputted in a program at a time. I have try many different methods, see below, none are even close to working.
I need to be able to do something like a
INPUT A$
INPUT B$
INPUT C$

Thanks



// set text string to blank
text1$ = ""
text2$ = ""
t1 =1
t2 =2
createtext(t1,"")
settextposition(t1,50,50)
settextsize(t1,30)

createtext(t2,"")
settextposition(t2,70,70)
settextsize(t2,30)

StartTextInput ( )
do
// once input has finished store the text
if GetTextInputCompleted ( ) = 1
text1$ = GetTextInput ( )
settextstring(t1,text1$)
endif
Printc ("Loop1")
// print text input on screen
Print ( text1$ )


loop
stoptextinput ()

StartTextInput ( )

do

if GetTextInputCompleted ( ) = 1
text2$ = GetTextInput ( )
settextstring(t2,text2$)
endif
Printc ("Loop2")
// print text input on screen
Print ( text1$ )
Print ( text2$ )

// update the screen
Sync ( )

loop

stoptextinput ()
Funnell7
13
Years of Service
User Offline
Joined: 8th Sep 2011
Location: UK, England
Posted: 18th May 2012 16:49
TonytheTiger, you have already posted this question under the below thread, to which I have provided a solution (if it meets your needs)...

http://forum.thegamecreators.com/?m=forum_view&t=196879&b=41

Please refrain from multi-posting as you wouldn't want to make the mods angry
TonytheTiger
12
Years of Service
User Offline
Joined: 14th May 2012
Location:
Posted: 18th May 2012 16:59
Sorry miss it. Thanks. Seems to be really complicated for just some data value entry. I understand the problem now. I got to something I can understand. Wish it was a one command. It builds the string and you have to start and end each one. Also got to have sync in there or you may not see what is happening. Also seems other parts program halt while in this loop. Hope they improve this in future. Now I have to figure how create edit field. LOL



global text$

gosub input1
a$=text$

gosub input1
b$=text$

gosub input1
c$=text$

// print text input on screen
Print ( a$ )
print (b$)
print (c$)

sync()

sleep(2000)

end

input1:
starttextinput ()
while GetTextInputCompleted ( ) = 0
sync()
endwhile
text$ = GetTextInput ( )
stoptextinput ()

return

Login to post a reply

Server time is: 2024-11-23 11:39:58
Your offset time is: 2024-11-23 11:39:58