INKEY$ in RunBASIC

new BookmarkLockedFalling
JackWebb
Junior Member
**

JackWebb Avatar

Posts: 69

Post by JackWebb on Jan 15, 2009 9:21:54 GMT -5

Is there any way to grab a single character from the keyboard and display it, or not display it at the programmers discretion? What I'm trying to do is this.

textbox #handle, "Hello "

while inkey$ <> chr$(27)
#handle PRINT(inkey$)
wend

end

any chance this keyword/function will be in a future version perhaps? :)

Last Edit: Jan 15, 2009 9:27:28 GMT -5 by JackWebb
Live to code, code to live!
Carl Gundel - admin
Administrator
*****

Carl Gundel - admin Avatar

Posts: 550

Post by Carl Gundel - admin on Jan 15, 2009 10:36:01 GMT -5

JackWebb Avatar
Is there any way to grab a single character from the keyboard and display it, or not display it at the programmers discretion? What I'm trying to do is this.

textbox #handle, "Hello "

while inkey$ <> chr$(27)
#handle PRINT(inkey$)
wend

end

any chance this keyword/function will be in a future version perhaps? :)


Run BASIC is a web programming system. Web apps typically do not process single character inputs.

What problem are you trying to solve?

-Carl
JackWebb
Junior Member
**

JackWebb Avatar

Posts: 69

Post by JackWebb on Jan 15, 2009 11:00:59 GMT -5

Well for one, it would help to partailly solve the problem of filtering user input beforehand instead of filtering it on the backend (less coding). Restricting length of input and so on.. The specific problem i'm trying to solve is that I want for the user to type something and have something totally different come out in the textbox.. Similar conceptually to the password box.

It's for a gag program I'm attempting. I saw it on another website, thought it was pretty neat and want to reverse engineer it. What is needed is something sililar to the input keyword, but instead of displaying the character box along with the accept button. It would just pass the input from the keyboard to the application 1 character at a time. I know that's over simplifying it but could it be that difficult to impliment? I realize that your plate is full , but this would be a great addition to RunBASIC and would add backward compatabilty for legacy code.

Run BASIC is a web programming system. Web apps typically do not process single character inputs.


On that note, RunBASIC is anything but typical. And rightly so.. ;)


Last Edit: Jan 15, 2009 11:10:00 GMT -5 by JackWebb
Live to code, code to live!
kokenge
Senior Member
****

kokenge Avatar

Posts: 261

Post by kokenge on Jan 15, 2009 11:24:09 GMT -5

When you want round trips on each key it could be slow. Web languages usually try to eliminate that by sending the complete screen data with one [submit] button.

However what you want to do is done all the time. I have a calculator program that does a round trip on each key. Not a practical application, but demonstrates what you want to do..
Go to www.dkokenge.com/rbp/ftp/ and download the calculator.zip. It sends back each key entered, but you can change it to do exactly what you want...

Hope this helps.
Carl Gundel - admin
Administrator
*****

Carl Gundel - admin Avatar

Posts: 550

Post by Carl Gundel - admin on Jan 15, 2009 11:24:55 GMT -5

I'm currently teaching myself Javascript, and I hope that this will result in more sophisticated user interface support that includes client-side validation, etc. So the future is bright. 8-)

In the meantime you may be able to do something by injecting Javascript directly into the page.

-Carl
kokenge
Senior Member
****

kokenge Avatar

Posts: 261

Post by kokenge on Jan 15, 2009 11:46:55 GMT -5

Yep! It is javascript. And is in the calculator program. It's a generalized JavaScript that lets you run it on any html trigger. Right now RB dose not have a trigger so you need HTML. It will run a RB program (or anything) on the server simply by telling it the RB application to run in the trigger.

Passing stuff back to the client is as simple as a PRINT statement with the form id to print to.

It cannot do stuff like drag and drop or sliders. I looked at the Ajax stuff out there and it's big and complicated. But if you only need triggers this is simple.
Last Edit: Jan 15, 2009 15:10:54 GMT -5 by kokenge