Re: Dan MoyerRe: return statement

new topic     » goto parent     » topic index » view thread      » older message » newer message

jvandal,

I'm not not *not* an expert, so it would generally be better to not address
questions to me individually, but rather address them to the list as a
whole, so you could get more than one person considering your question.

That said, it *looks* to me that what you have done could work, though I'm
not sure why not to use the simpler method I demo'd:  a button tests length
of input for all fields, show message "enter data into all fields" if any
field tests empty, instead of trying to tell the user to go to the specific
empty field & then to the next etc.  I would personally think your method is
unnecessary, and therefore "bad", but as I said, I'm *not* an expert, so if
what you really want to have happen is what you have provided for, and it
works, then go with it, unless someone else more knowledgeable than I gives
you a good reason not to.

As far as limiting the length of text entered into a edit box, v55 of
Win32Lib has it, in the form of "LimitText(object, size)", but it's broken
in 57.1 (ie, doesn't do anything).

Dan Moyer

----- Original Message -----
From: <sixs at ida.net>
To: "EUforum" <EUforum at topica.com>
Sent: Wednesday, April 17, 2002 4:46 PM
Subject: Dan MoyerRe: return statement


>
> Dan Moyer,
> This is the coding I'm doing . I set the number of edit fields to display,
> and edit and then compare. Is this good or bad ? I would like to have the
> choice to limit the text from 2 to 10 characters but ?
> jim smiley
>
> procedure onClick_startBtn()
>  if isChecked(try15RB)  or  isChecked(try12RB) or  isChecked(try9RB)
>   or  isChecked(try6RB)
>   then
>   setvisiblenumbers()
>   setText(ERROR,"Enter  Your numbers!!!!")
>      setVisible(ERROR, True)
>   setFocus(mfEditText1)
>  else
>   setText(ERROR,"Select number report!!!!")
>      setVisible(ERROR, True)
>   return
>  end if
> -- trace(1)
>  wmfEditText1 = getText(mfEditText1)
>  if length(wmfEditText1) = 0 then
>    setText(ERROR,"enter first number !!!!")
>        setVisible(ERROR, True)
>    setFocus(mfEditText1)
>   return
>   else
>     setText(ERROR,"Ok !!!!")
>        setVisible(ERROR, True)
>     end if
>
>  wmfEditText2 = getText(mfEditText2)
>  if length(wmfEditText2) = 0 then
>   setText(ERROR,"enter second number !!!!")
>       setVisible(ERROR, True)
>    setFocus(mfEditText2)
>   return
>  else
>   setText(ERROR,"Ok !!!!")
>      setVisible(ERROR, True)
>     end if
>
>   wmfEditText3 = getText(mfEditText3)
>  if length(wmfEditText3) = 0 then
>   setText(ERROR,"enter third number !!!!")
>      setVisible(ERROR, True)
>   setFocus(mfEditText3)
>   return
>  else
>   setText(ERROR,"Ok !!!!")
>      setVisible(ERROR, True)
>     end if
>  wmfEditText4 = getText(mfEditText4)
>  if length(wmfEditText4) = 0 then
>   setText(ERROR,"enter fourth number !!!!")
>      setVisible(ERROR, True)
>   setFocus(mfEditText4)
>   return
>  else
>   setText(ERROR,"Ok !!!!")
>      setVisible(ERROR, True)
>     end if
>  wmfEditText5 = getText(mfEditText5)
>  if length(wmfEditText5) = 0 then
>   setText(ERROR,"enter fifth number !!!!")
>      setVisible(ERROR, True)
>   setFocus(mfEditText5)
>   return
>  else
>   setText(ERROR,"Ok !!!!")
>     setVisible(ERROR, True)
>     end if
>  wmfEditText6 = getText(mfEditText6)
>  if length(wmfEditText6) = 0 then
>   setText(ERROR,"enter sixth number !!!!")
>      setVisible(ERROR, True)
>    setFocus(mfEditText6)
>   return
>  else
>   setText(ERROR,"Ok !!!!")
>      setVisible(ERROR, True)
>     end if
>  wmfEditText7 = getText(mfEditText7)
>  if isChecked(try15RB)  or  isChecked(try12RB) or  isChecked(try9RB)
>     then
>   if length(wmfEditText7) = 0 then
>    setText(ERROR,"enter seventh number !!!!")
>       setVisible(ERROR, True)
>    return
>   else
>    setText(ERROR,"Ok !!!!")
>        setVisible(ERROR, True)
>     setFocus(mfEditText7)
>   end if
>     end if
>   if isChecked(try15RB)  or  isChecked(try12RB) or  isChecked(try9RB)
>   then
>   wmfEditText8 = getText(mfEditText8)
>   if length(wmfEditText8) = 0 then
>    setText(ERROR,"enter eighth number !!!!")
<snip>

> 0,
> > 0, 0, 0 )
> > global constant EditText2 = create( EditText, "", Window1, 24, 20, 50,
20,
> > 0 )
> > global constant EditText3 = create( EditText, "", Window1, 120, 20, 50,
> 20,
> > 0 )
> > global constant EditText4 = create( EditText, "", Window1, 212, 20, 50,
> 20,
> > 0 )
> > global constant EditText5 = create( EditText, "", Window1, 28, 68, 50,
20,
> > 0 )
> > global constant EditText6 = create( EditText, "", Window1, 124, 68, 50,
> 20,
> > 0 )
> > global constant EditText7 = create( EditText, "", Window1, 216, 68, 50,
> 20,
> > 0 )
> > global constant PushButton8 = create( PushButton, "Finished", Window1,
> 104,
> > 116, 90, 30, 0 )
> > ----
> > procedure PushButton8_onClick ()
> > if length(getText(EditText2)) = 0 or
> >    length(getText(EditText3)) = 0 or
> >    length(getText(EditText4)) = 0 or
> >    length(getText(EditText5)) = 0 or
> >    length(getText(EditText6)) = 0 or
> >    length(getText(EditText7)) = 0 then
> >         setText(StatusBar9, "Please enter data into all fields")
> > else
> >   setText(StatusBar9, "ok")
> > end if
> > end procedure
> > onClick[PushButton8] = routine_id("PushButton8_onClick")
> >
> >
> > WinMain( Window1, Normal )
> >
> > -- CODE ENDS
> >
> > ----- Original Message -----
> > From: <sixs at ida.net>
> > To: "EUforum" <EUforum at topica.com>
> > Sent: Monday, April 15, 2002 11:15 PM
> > Subject: return statement
> >
> >
> > I have a Windows program where I am checking several fields and if the
> > fields are not entered, I want to tell the user to input the data in the
> > field and then proceed to the next field. If the user does not like what
> he
> > has entered he can change it and leave the other fields as entered. I
have
> > these several input statements in a procedure. If the field needs to be
> > entered the program seems to return to the starting point  at the
> beginning
> > of the procedure, and does not return just to the statement being
> executed.
> > Is this is what is happening, or is there a way to force it to return to
> the
> > statement?
> >
> > jvandal
> >
> >
>
>
>

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu