BBS: Inland Empire Archive Date: 12-12-92 (17:41) Number: 343 From: BILL CAMPBELL Refer#: NONE To: ALL Recvd: NO Subj: batch errorlevels Conf: (2) Quik_Bas
Was wonderring what all the fuss was about. Have used batch files to call qb programs and got around the problem easily enough. The only time my batch file cared what happened in the qb program was when it had to branch either within itself to another label or to another batch program. Why not just open and close a file in qb such as : OPEN "err_levl.1" FOR OUTPUT AS #1 CLOSE #1 You end up with a zero-byte file but the batch file can branch with: IF EXIST ERR_LEVL.1 GOTO :LABEL IF EXIST ERR_LEVL.x GOTO :ANOTHERLABEL :LABEL .... (you get the picture) This has always got me where I was trying to get to. Just remember to IF EXIST ERR_LEVL.? DELETE ERR_LEVL.? at the beginning of the batch file. Might not be fancy, but then again, the best solution to a problem is often right in front of us. Don't always try to make things so difficult! Regards, THE Bill Campbell (of Ajax, Ont) (I've been getting another BC's mail so I guess there is another. <yikes>) --- Maximus 2.00 * Origin: Durham Systems (ONLINE!) (1:229/110)
Books at Amazon:
Back to BASIC: The History, Corruption, and Future of the Language
Hackers: Heroes of the Computer Revolution (including Tiny BASIC)
Go to: The Story of the Math Majors, Bridge Players, Engineers, Chess Wizards, Scientists and Iconoclasts who were the Hero Programmers of the Software Revolution
The Advent of the Algorithm: The Idea that Rules the World
Moths in the Machine: The Power and Perils of Programming
Mastering Visual Basic .NET