validate input?
Blitz3D Forums/Blitz3D Beginners Area/validate input?
| ||
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! |
| ||
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. |
| ||
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 |
| ||
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. |