Re: Ignoring/Detecting numbers in textbox
Thank you for your reply - it works a treat!
--- In firstname.lastname@example.org, Lorne Russell <lorneokb@...>
> get the contents of the textbox in a string (text$) then test each
>then nonalphaflag=1: exit for
> print #main.textbox, "!contents?"
> input #main.textbox, text$
> for x=1 to len(text$)
> if instr("abcdefghijklmnopqrstuvwxyz",lower$(mid$(text$,x,1)))=0
> next xgives user an error message and requests input again
> if nonalphaflag=1 then branch to routine that clears the textbox,
> ----- Original Message -----
> From: loudmarshall06
> To: email@example.com
> Sent: Saturday, February 16, 2008 9:07 AM
> Subject: [libertybasic] Ignoring/Detecting numbers in textbox
> Dear all,
> I am writing a program in which needs the user to enter a word
> textbox. Does anyone know how to make it either a) so that theuser
> cannot put numbers into the text box, or b) so that the programerror or
> recognises that numbers are in the textbox and gosubs to to an
> ignore message or something.
> Cheerie bye,
> [Non-text portions of this message have been removed]
- Hi there,
Many thanks for your response. This code almost worked, however it
doesn't detect that there is a number in the textbox if the number
happens to be 0.
--- In firstname.lastname@example.org, "psycho_bullet_stopper"
> There may be a more efficient way but the following works.
> (get the word from your textbox rather than my input statement)
> input "Type a word ";word$
> length = len(word$)
> for x = 1 to length
> if val(test$)<>0 then number = 1
> next x
> if number > 0 then
> print "You had a number in your entry."
> print "Your word was ";word$
> end if
- Trying to limit user destruction of anything, not just software, is a
real headache. They never use it in 'quite' the same way the
--- In email@example.com, "rod_bird001" <rodbird@...>
> Limiting user destruction of your carefully crafted program is an
> form. Do they have to be able to enter free text? can you not limitcomputing
> them to yes no, or better still ok? If it wasn't for humans,
> would be enjoyable. List boxes are your friend.into a
> --- In firstname.lastname@example.org, "loudmarshall06" <forums@>
> > Dear all,
> > I am writing a program in which needs the user to enter a word
> > textbox. Does anyone know how to make it either a) so that theuser
> > cannot put numbers into the text box, or b) so that the programerror
> > recognises that numbers are in the textbox and gosubs to to an
> > ignore message or something.
> > Cheerie bye,
> > Rob