validate input?

Blitz3D Forums/Blitz3D Beginners Area/validate input?

Jaydubeww(Posted 2010) [#1]
Not sure if its possible to do in blitz3d, but, is there a way to make sure the user inputs only numbers? The user will be inputting his desired fps which, then saves that to a ini.

Thanks!


Matty(Posted 2010) [#2]
Yes - but don't use the standard "input" command use something like rinput (see codearchives) and all you need to do is only poll the numeric keys, and disregard other keypresses.

http://blitzbasic.com/codearcs/codearcs.php?code=207

A few changes to the above code archives entry shouldn't be too difficult.


Jaydubeww(Posted 2010) [#3]
Thanks! Just what I was looking for. On a side note, what does the ":" mean in the example? Is it equivalent of hitting enter? I've used it before, but with little knowledge of what it actually does.

Thanks again


Matty(Posted 2010) [#4]
The ":" character simply lets you write multiple lines in a single line, although has no impact on processing performance - ie no gain/loss for using it, but it can make code harder to read.