I haven't seen the discussion on loops, but they are fundamental to
programming. These goto's are worst than the loops. Here's how I would
have it:

Dim strLineToBeChanged As String

    While Len(strLineToBeChanged) < 1

        strLineToBeChanged = Trim$(InputBox("Which line to change?"))
        'code to check whether a number was entered and convert it to integer
    Wend


On Thu, 10 Feb 2005 19:37:07 -0000, HouseDad <[EMAIL PROTECTED]> wrote:
> 
> 
> Private Sub EditHeader()
> 
> ReDoHeaderEdit:
> 
> iSelection = 0
> 
> On Error GoTo reporterror
> 
> iselection=0
> 
> iSelection = InputBox("Which line to change?")
> 
> reporterror:
> If Err = 13 Then MsgBox "Please don't press CANCEL"
> 
> GoTo ReDoHeaderEdit
> 
> End Sub
> =================================
> 
> This is basically what I am dealing with.  When the user first
> presses cancel, the get the message in the reporterror area.  The
> second time, there's a type mismatch on the input box line.  Why?
> 
> Is there another way to disable or ignore the cancel button on an
> input box?  usually I have them in a do loop which ignores it fine
> but with all the discussion about loops on here lately I thought I
> would just try trapping the error.
> 
> '// =======================================================
>    Rules : http://ReliableAnswers.com/List/Rules.asp
>    Home  : http://groups.yahoo.com/group/vbHelp/
>    =======================================================
>    Post  : [email protected]
>    Join  : [EMAIL PROTECTED]
>    Leave : [EMAIL PROTECTED]
> '// =======================================================
> 
> Yahoo! Groups Links
> 
> 
> 
> 
> 


-- 
---
Don Roberts - [EMAIL PROTECTED]
http://www.drscripting.com
http://www.freakingidiot.com



'// =======================================================
    Rules : http://ReliableAnswers.com/List/Rules.asp
    Home  : http://groups.yahoo.com/group/vbHelp/
    =======================================================
    Post  : [email protected]
    Join  : [EMAIL PROTECTED]
    Leave : [EMAIL PROTECTED]
'// =======================================================
 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/vbhelp/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to