What I intended was to present an 8-choice menu (this problem occurs on
choice one) and return to that menu after the form closes.
I'm going to rewrite it with an explicit menu call.
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
> Behalf Of Jim Blackburn
> Sent: Friday, July 06, 2001 1:41 PM
> To: [EMAIL PROTECTED]
> Subject: Re: Switch..Endsw drop to R>
>
>
> David:
> There is no GOTO after the ENDSW; just RETURN. If you want it
> to return to the top of the loop and the line:
> ENTER USING YpMenu CAPTION ' '
>
> it needs GOTO TOPLOOP before the RETURN and a LABEL TOPLOOP line.
>
> Jim Blackburn
> Kodiak
>
> David Ebert wrote:
> >
> > I'm getting dropped to the R> prompt from a command file and
> can't figure
> > out why. The block that is dropping me is:
> >
> > ENTER USING YpMenu CAPTION ' '
> >
> > SWITCH (.vbutton)
> > CASE 1
> > QUIT TO chocli.rmd
> > BREAK
> >
> > chocli.rmd ends with a RETURN, but instead of returning to the form I'm
> > dropping to the R>. Even replacing "Quit To" with "Run" has the same
> > result.
> >
> > Below is the involved code:
> >
> > tia for any insight (I haven't done it this way for a while,
> but all of this
> > was based on earlier working examples).
> >
> > --BUTTON.EEP
> > SET VAR VButton = .%1
> > CLOSEWINDOW
> > RETURN
> >
> > --Mainmenu.rmd
> > CLS
> > MAXIMIZE
> > DISCONNECT
> > CONNECT hhs
> > SET SINGLE=_
> > SET MANY=%
> > SET QUOTES='
> > SET IDQUOTES=`
> > SET VAR RBTI_NOSTATUS = 1
> >
> > --SET RBGSIZE CENTER CENTER 800 600
> >
> > SET MESSAGES OFF
> > SET ERROR MESSAGES OFF
> > SET VAR vbutton INTEGER
> > --Set the vbutton variable for Button.EEP on form MainMenu
> > SET VAR vbutton = NULL
> >
> > SET CAPTION ' '
> > ENTER USING YpMenu CAPTION ' '
> >
> > SWITCH (.vbutton)
> > CASE 1
> > Run chocli.rmd
> > BREAK
> >
> > CASE 2
> > QUIT TO choeid.rmd
> > RETURN
> > BREAK
> >
> > CASE 3
> > ENTER USING evcontact
> > BREAK
> >
> > CASE 4
> > ENTER USING evdxnew
> > BREAK
> >
> > CASE 5
> > ENTER USING evispgoal
> > BREAK
> >
> > CASE 6
> > ENTER USING evlrnew
> > BREAK
> >
> > CASE 7
> > ENTER USING evterm
> > BREAK
> >
> > CASE 8
> > ENTER USING servent
> > BREAK
> >
> > CASE 77
> > PAUSE 3 USING 'You must make a selection.' AT CENTER CENTER
> > BREAK
> >
> > CASE 99
> > EXIT
> > BREAK
> >
> > ENDSW
> > RETURN
> >
> > --chocli.rmd
> > --SET VARIABLES
> > SET VAR vtask TEXT
> > SET VAR vtresp TEXT
> > SET VAR vtkey TEXT
> > SET VAR vthhn TEXT
> > SET VAR gvhhn INTEGER
> > SET VARIABLE vflast = (LASTKEY(0))
> >
> > LABEL start
> > CLS
> > --Get a last name to narrow the scope of the search
> > DIALOG 'Enter the last name: '=20 vtresp vtkey 1 AT 10, 10
> >
> > --Test for Escape response
> > IF vtkey = '[Esc]' THEN
> > DIALOG 'Exit function? ' vtresp vtend YES AT 5, 10
> > IF vtresp = 'YES' THEN
> > GOTO END
> > ENDIF
> > CLEAR VAR vtresp
> > CLEAR VAR vtend
> > ENDIF
> >
> > --Set variables for the CHOOSE appending a wildcard to the name
> > SET VAR vtask = .vtresp + '%'
> >
> > --Prompt for client name
> > CHOOSE tvhhn FROM #VALUES FOR (LJS((lname + ', ' + fname),
> 20)), hhn +
> > FROM yp WHERE lname LIKE .vtask UNION SELECT ' - New Client -' ,0 +
> > FROM yp WHERE LIMIT = 1 ORDER BY lname ASC +
> > AT CENTER, CENTER TITLE 'Select a Name ' CAPTION 'Clients'
> LINES 14 +
> > FORMATTED
> >
> > --Test for Escape response
> > IF vtkey = '[Esc]' THEN
> > DIALOG 'Exit function? ' vtresp vtend YES AT CENTER, CENTER
> > IF vtresp = 'YES' THEN
> > CLEAR VAR vt%
> > CLEAR VAR vtresp
> > CLEAR VAR vtend
> > GOTO END
> > ENDIF
> > ENDIF
> >
> > --Set the HHN Variable
> > SET VAR gvhhn = .tvhhn
> >
> > --Test for valid case, if not, enter one
> > IF gvhhn > 0 THEN
> > EDIT USING ypedit WHERE hhn = .gvhhn
> > ELSE
> > ENTER USING ypnew
> > GOTO END
> > ENDIF
> >
> > LABEL END
> > --Clear the temporary variables
> > CLEAR VAR tv%
> > CLEAR VAR vt%
> > CLEAR VAR vf%
> > CLEAR VAR vcount
> >
> > RETURN
>