Setting Input string limitations
Blitz3D Forums/Blitz3D Beginners Area/Setting Input string limitations
| ||
Say like I want to limit the input of a name to 10 characters (to fit the input field) what would I need to do? |
| ||
Name$=Trim(Lset(Name$,10)) |
| ||
Perhaps I should have been a bit more specific on this (though your help is greatly appreciated, thanks, Matty :) ) I wish to limit the amount of text that can be typed. The problem is, is that I cant seem to put a stopper on the input text while the input is active. I hope that makes sense... |
| ||
You could write your own "input" function rather than using the 'default' input function? If you are using some kind of external gui lib I cannot offer any other advice. However by combining http://blitzbasic.com/codearcs/codearcs.php?code=207 with the line "if length>10 then return astring$" in the relevant spot in that function linked it should work. |
| ||
Thanks :) I'll certainly study that code |