🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.msdos.programmer
Article #1274

Re: Another MsDos batch programming challenge

#1274
From: Yossi Gil
Date: Fri, 04 Sep 1992 03:28
30 lines
1750 bytes
ts@uwasa.fi (Timo Salmi) writes:

>In article <israel.715477510@unixg.ubc.ca> israel@unixg.ubc.ca (Robert B. Israel) writes:
>>BTW, Yossi's solution should work if you run it as "FOO.BAT" rather than as
>>"FOO".  

As I have said, it is fairly easy to make it work even if invoked as
FOO as opposed to FOO.BAT. It is perhaps slightly more difficult to make it
work if invoked as FOO.EXE, as (I think) was possible in some early
dos versions.

>Allow me a quick check question.  Have you actually tested this on
>your PC.  Gotcha or vice versa? :-) :-)

Yes, I tested it. It works. It relies on the way DOS does batch file:
	
	1. Open file.
	2. Seek in file to current statement. 
	3. Interpret statement. 
	4. Close file.
	5. Execute statement
	6. Goto 1 if not done.

This is why Batch Programming is so inefficient.

--
Joseph (Yossi) Gil                 {alberta,uw-beaver,uunet}!ubc-cs!yogi
Dept. of Computer Science          yogi@cs.ubc.ca (cs.ubc.ca=137.82.8.5)
6356 Agricultural Road., Univ. of B.C.,             Tel: +1-604-822-8175
Vancouver, British Columbia, V6T 1Z2, Canada.       Fax: +1-604-822-5485
Technical Details
Message-ID: <1992Sep4.032836.7299@cs.ubc.ca>
Path: arc1-ca.pugleaf.net!sparky!uunet!wupost!sdd.hp.com!uakari.primate.wisc.edu!usenet.coe.montana.edu!news.u.washington.edu!uw-beaver!ubc-cs!yogi
References: <qzhn!6f.resnicks@netcom.com> <92246.142230F13@psuvm.psu.edu> <israel.715477510@unixg.ubc.ca> <1992Sep3.214401.5000@uwasa.fi>

Show Full Headers
Complete Article Headers
Newsgroups: comp.os.msdos.programmer
Path: arc1-ca.pugleaf.net!sparky!uunet!wupost!sdd.hp.com!uakari.primate.wisc.edu!usenet.coe.montana.edu!news.u.washington.edu!uw-beaver!ubc-cs!yogi
From: yogi@cs.ubc.ca (Yossi Gil)
Subject: Re: Another MsDos batch programming challenge
Message-ID: <1992Sep4.032836.7299@cs.ubc.ca>
Sender: usenet@cs.ubc.ca (Usenet News)
Organization: Computer Science, University of B.C., Vancouver, B.C., Canada
References: <qzhn!6f.resnicks@netcom.com> <92246.142230F13@psuvm.psu.edu> <israel.715477510@unixg.ubc.ca> <1992Sep3.214401.5000@uwasa.fi>
Date: Fri, 4 Sep 92 03:28:36 GMT
Lines: 30