Just to be different... Why not add a new label called Check.2 put it right before the label Check.B
Then the code would look like: > > begin case > case Ans = 'A' ; gosub Check.A > case Ans = 'B' ; gosub Check.B > case Ans = '2' ; gosub Check.2 > case 1 ; gosub error.condition or null > end case This would help from a maintenance standpoint, if later on Check.2 needed it's own code differing than Check.B -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Dave Davis Sent: Wednesday, July 25, 2007 1:22 PM To: u2-users@listserver.u2ug.org Subject: RE: [U2] [u2] : Cleaner Case Statement Not good if answer is not limited to one character wide. Isn't ON .... GOSUB out of style? -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Manu Fernandes Sent: Wednesday, July 25, 2007 12:44 PM To: u2-users@listserver.u2ug.org Subject: Re: [U2] [u2] : Cleaner Case Statement Try this ON index('AB2',Ans,1) GOSUB Check.A, Check.B, Check.B Manu ----- Original Message ----- From: "Brutzman, Bill" <[EMAIL PROTECTED]> To: <u2-users@listserver.u2ug.org> Sent: Wednesday, July 25, 2007 5:48 PM Subject: [U2] [u2] : Cleaner Case Statement > How can this structure be cleaned-up? > > begin case > case Ans = 'A' ; gosub Check.A > case Ans = 'B' ; gosub Check.B > case Ans = '2' ; gosub Check.B > end case > > The following is more difficult to read. > > begin case > case Ans = 'A' ; gosub Check.A > case Ans = 'B' or Ans = '2' ; gosub Check.B > end case > > I would like something like... > > begin case > case Ans = 'A' ; gosub Check.A > case Ans = 'B' > case Ans = '2' ; gosub Check.B > end case > > so that the "gosub Check.B" command is not repeated. I have tried a > few alternatives without a victory. > > Suggestions would be appreciated. > > --Bill > ------- > u2-users mailing list > u2-users@listserver.u2ug.org > To unsubscribe please visit http://listserver.u2ug.org/ ------- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/ ------- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/ ------- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/