Forums before death by AOL, social media and spammers... "We can't have nice things"
|    alt.msdos.batch.nt    |    Fun with Windows NT batch files    |    68,980 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 67,346 of 68,980    |
|    JJ to Batchman    |
|    Re: GOTO and non existant label    |
|    05 Dec 18 16:01:21    |
      From: jj4public@vfemail.net              On Tue, 4 Dec 2018 23:25:47 -0000 (UTC), Batchman wrote:       > You need to test that the `value' being returned in the num variable is       > acceptable to your program.       >       > set ok=       > for %%n in (1 2 3 4 5) do if (%%n)==(%num%) set ok=!       > if not (%ok%)==() goto task%num%       > REM drops down for incorrect input       > echo Invalid input, dummy!       >       > NOTE haven't tested this, leaving that for you to complete.              Well, that's the same as refactoring which I'm trying to avoid. The question       is how to prevent the abrupt batch termination, if it's even possible. It's       not how to prevent the GOTO command to be called with non existing label.              --- SoupGate-Win32 v1.05        * Origin: you cannot sedate... all the things you hate (1:229/2)    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca