News:

Welcome to RetroCoders Community

Main Menu

Input command

Started by johnno56, Mar 28, 2023, 07:30 PM

Previous topic - Next topic

johnno56

I am working my way through a vocabulary quiz and have come up against a bit of an obstacle...

A simple input statement: eg: INPUT "How many questions shall we do ", L

The text of the input is displayed with an unblinking solid square prompt at the end of the line but that is as far as it goes. No response from the keyboard. I have tried ", L" and "; L".  I even tried PRINT "How many questions shall we do ";: INPUT "" , L

Am I doing something wrong? (INPUT$(variable) did not work either...)

In the meantime, I will attempt to cobble together an 'inkey$' routine, as a work-a-round... lol

J

ps: Line Input does not work either....
May your journey be free of incident.  Live long and prosper.

johnno56

Update:

screen _newimage(640,480,16)
cls
color _rgb(255,255,255)
running = true
_KEYCLEAR
while running = true
locate 10,10: print"Press 'X' to exit"
locate 12,10: print"Running: "; running
if inkey$ = "X" or inkey$ = "x" then
	running = false
end if
_display
_limit 30
wend

Inkey$ does not seem to work as well...

As you can see 'running' does not change when either "x" or "X" is pressed...

Oh well... So much for the inkey$ workaround... lol

Are you sure that I am not doing something wrong? Going slightly bonkers over this... lol
May your journey be free of incident.  Live long and prosper.

CharlieJV

I'm going to write a blog article for anybody who may not be aware.

Keyboard input (and sound output) on a web page will not happen until the page has the "focus".

So click on the console with your mouse, and keyboard input should then work A-1.

Give it a spin.

In the meantime, I'm putting a detailed article together.

CharlieJV