mead@uxh.cso.uiuc.edu (05/09/90)
I would like to author some batch extentions (never mind that some packages of these exist already) in Turbo Pasdcal (V55). One thing I'd like to be able to do is prompt the user for a Y/N response to some arbitrary question and to communicate this to the batch file. I believe the way one does this is to force a MS-DOS exit code of (say) 1 for yes and (say) 2 for no - then use a line like: if errorlevel=1 goto yesresp so my question is: How do you force a particular exit code? Alternative schemes also welcome, email is prefered. Thanks in advance. Also, should I succeed, would the package be of interest to (and appropriate for) this group (I'd post the TP sources)? 'Course, I could always email them to interested parties as well. -alan mead
timk@xenitec.on.ca (Tim Kuehn) (05/09/90)
In article <13000005@uxh.cso.uiuc.edu> mead@uxh.cso.uiuc.edu writes: >I believe the way one does this is to force a MS-DOS exit code of >(say) 1 for yes and (say) 2 for no - then use a line like: > if errorlevel=1 goto yesresp >so my question is: How do you force a particular exit code? (Minor flamethrower on....) 1) You get your TP 5.5 Reference guide. 2) You look in the index on pg 454 under "exit" 3) You refer to the various references under that entry. 4) Read said references, study them, figure them out. 5) Write code applicable to your project. >-alan mead Sorry for the sarcastic nature of this response, but if people would spend a *little* bit of time looking in the index then net.bandwidth wouldn't be wasted by questions that could *easily* be answered if you took a few minutes to look at the bloody reference guide! That's what it's there for! So use it! (End of minor flame here...) ------------------------------------------------------------------------------ Timothy D. Kuehn TDK Consulting Services 871 Victoria St. North, Kitchener, voice: (519)-741-3623 Ontario, Canada N2B 3S4 DOS/Xenix - SW/HW. uC uP RDBMS !watmath!maytag!xenitec!timk timk@xenitec.on.ca ------------------------------------------------------------------------------
mead@uxh.cso.uiuc.edu (05/09/90)
I **KNEW** I'd seen the answer in the manual before. Yup - I need to use HALT. THanks to Kevin Lowey and this year's Shortest Reply award goes to Jeff Davis' "Halt(x)". -alan