Re: Do Loop

From: MikeB (m.byerleyATVerizonDottieNettie)
Date: 02/01/05


Date: Tue, 1 Feb 2005 11:19:03 -0500


"Al Dunbar [MS-MVP]" <alan-no-drub-spam@hotmail.com> wrote in message
news:%23g3xJNBCFHA.244@TK2MSFTNGP10.phx.gbl...
> IMHO, you have NOT tried everything. Are you still getting the same error
> message? On which line? If not, instead of telling us what it is NOT doing
> (i.e. working) try telling us what it *is* doing.
>
> The script below, as I see it in my newsreader, seems to continue statements
> on subsequent lines without the trailing " _" continuation sequence.

Al,
  I had called the glaring errors to the OP attention in my post and provided
working script, exclusive of his Call Statements as I have no idea what is
going on in those statements...

>
>
> <topjimmy66@yahoo.com> wrote in message
> news:1107219553.495491.52710@f14g2000cwb.googlegroups.com...
> I have tried everything, can someone please help me and tell­ me why
> this won't work???
>
>
> Dim MyVar
> Dim response
> response = 2
> Do Until response = 1
>
>
>
> MyVar = "Is the data you entered correct?" & VbCrLf & "DOE #­" &
> Space(8) & strReturnVal1 & vbcrlf
> & "Building
> #" & Space
> (3
> ) &
> strReturnVal2
> & VbCrLf
> & "Room
> #" & Space
> (6
> ) & strReturnVal3
> MyVar = MsgBox(MyVar,vbQuestion+vbYesNo,"CMS ISTeam")
> If MyVar = vbYes Then
>
>
> response = 1
> If MyVar = vbNo Then
> response = 2
>
>
> - Hide quoted text -
> - Show quoted text -
>
> g_objShell.RegWrite strName & strKeyName, strReturnVal1,strT­ype
> Call GetUserInput
> g_objShell.RegWrite strName
> & strKeyName
> , strReturnVal2
> ,strType
> Call
> GetUserInputa
> g
> _objShell
> .RegWrite
> strName
> & strKeyName
> , strReturnVal3
> ,strType
> Call
> GetUserInputb
> End
> If
>
>
> End If
> Loop
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> topjimmy66@yahoo.com wrote:
> > Hey Mike, appreciate your input big time. Basically the script
> > functions correctly by populating creating a reg key and strings and
> > populating them based on the users input. What I was hoping to
> > accomplish at the bottom was to have the user verify that the info
> > entered was correct by clicking on the yes button and if it was wrong
> > and the user clicked on the no button that it would run the script
> from
> > the top again so they could re-enter the correct data. That is where
> > my shortcomings are.
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > MikeB wrote:
> > > Dim MyVar
> > >
> > > Do
> > > ' Here you assign MyVar to Text datatype and
> > > 'the Line Continuation Character is missing after the 1st and 2nd
> > line of
> > > MyVar
> > > 'And the Assignment of the Text Value to Myvar only happens once
> so
> > it should
> > > be
> > > 'before the DO
> > > MyVar = "Is the data you entered correct?" & VbCrLf & "DOE #" &
> > > Space(8) & strReturnVal1 & vbcrlf & "Building #" & Space(3) &
> > > strReturnVal2 & VbCrLf & "Room #" & Space(6) & strReturnVal3
> > > ' Here you try to use MyVar as an Integer Datatype
> > > MyVar = MsgBox(MyVar,vbQuestion+vbYesNo,"CMS ISTeam")
> > >
> > > If MyVar = vbYes Then Exit Do
> > > If MyVar = vbNo Then
> > > g_objShell.RegWrite strName & strKeyName, strReturnVal1,strType
> > > Call GetUserInput
> > > g_objShell.RegWrite strName & strKeyName, strReturnVal2,strType
> > > Call GetUserInputa
> > > g_objShell.RegWrite strName & strKeyName, strReturnVal3,strType
> > > Call GetUserInputb
> > > End If
> > > Loop Until MyVar = vbYes
> > >
> > > ' So this code was tested with you Call statements remmed out and
> > does work:
> > >
> > >
> > > Dim MyVarText
> > > Dim MyVarInt
> > > MyVarText = "Is the data you entered correct?" & VbCrLf & "DOE #"
> &
> > _
> > > Space(8) & strReturnVal1 & vbcrlf & "Building #" & Space(3) & _
> > > strReturnVal2 & VbCrLf & "Room #" & Space(6) & strReturnVal3
> > > Do
> > > MyVarInt = MsgBox(MyVarText,vbQuestion+vbYesNo,"CMS ISTeam")
> > >
> > > If MyVarInt = vbYes Then Exit Do
> > > If MyVarInt = vbNo Then
> > > 'g_objShell.RegWrite strName & strKeyName,
> strReturnVal1,strType
> > > 'Call GetUserInput
> > > 'g_objShell.RegWrite strName & strKeyName,
> strReturnVal2,strType
> > > 'Call GetUserInputa
> > > 'g_objShell.RegWrite strName & strKeyName,
> strReturnVal3,strType
> > > 'Call GetUserInputb
> > > End If
> > > Loop Until MyVarInt = vbYes>
>
>