1 2 ÛßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßÛ 3 Û ADDNUM.EXE Û±± 4 Û Û±± 5 Û PURPOSE: Add lines to *.BAS Files Û±± 6 Û Û±± 7 Û Û±± 8 Û WHY: To Debug Run Time Errors Û±± 9 Û Û±± 10 Û Û±± 11 Û WARNING: Makes a file with same Û±± 12 Û name but with the extension Û±± 13 Û *.LIN; don't forget that... Û±± 14 ÛÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÛ±± 15 ±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±± 16 17 Sun 04-03-1994 14:33:45 18 19 Version 2.1 20 ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ 21 ³Why, oh why dooooo this???³ 22 ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ 23 This program does one simple thing... add numbers to your 24 QuickBASIC source code. I know, I know.... how =DUMB= can you get. 25 You don't need line numbers with QuickBASIC. 26 27 Oh Yeah? Are you sure about that? Well when you need this program, 28 you REALLY need it. For unless you have line numbers in your source 29 code, when you get a "Run Time Error" you will have a dickens of a 30 time finding that error without these line numbers. 31 32 ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ 33 ³Run Time Errors!³ 34 ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ 35 Yes... this -should- help you to debug a program that gives you Run 36 Time Errors. Remember, you have to use the "/D" switch when you 37 compile with BC.EXE so that the error message includes the line 38 number. The next is the format of the BC.EXE error message: 39 ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ 40 41 Error 'n' in line 'linenumber' of module 'module-name' at address 42 'segment:offset' 43 44 ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ 45 46 Just in case you want to be a real Debug Meister, you should try 47 debugging your programs with numbered lines (using this program) 48 and the nearly obsolete command ERL. ERL only works with programs 49 with line numbers so that you can find out the exact (sort of) line 50 where the error happened. Actually even that is not true, ERL gives 51 you the line and command just BEFORE the error. 52 53 ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ 54 ³This is a ** FRIENDLY ** Program³ 55 ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ 56 ADDNUM.EXE is "user friendly." If you can type in the correct name, 57 then you don't need to enter anything else, just hit {Enter} to get 58 the default number modes of "one." 59 60 Decided not to prompt for a new file name but to use the file name 61 you entered, remove the extension, and tack on the extension ".LIN" 62 Felt pretty sure that you didn't have that extension in your 63 directory. 64 65 Put in error checking for a valid file name, and threw in a bunch 66 of colored shadow boxes. 67 68 As I ran the program being delighted with the colors and stuff, I 69 realized that I have always wanted a "file progress" bar that 70 filled as your program progresses. So... I went back and 71 laboriously added it. Not easy; and the code is klutzy; but no 72 apologies as I can't find this kind of stuff anywhere. 73 74 ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ 75 ³This is NOT Rocket Science!³ 76 ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ 77 Actually I didn't want to make this program. But I couldn't find 78 one on CompuServe that did this simple thing well. Yes... I found 79 one but -that- one would only let you use the command line to enter 80 variables, DIDN'T COME WITH THE SOURCE CODE, and asked for money if 81 you used it. So... you see, I was forced to make this for myself. 82 Since all my stuff is "LearnWare," am passing it on to you. 83 84 ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ 85 ³ADDNUM.EXE is =NOT= for Bozos³ 86 ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ 87 Line numbers futz up TYPE.... END TYPE and SELECT.... END SELECT 88 code. Putting line numbers in those code blocks will give you RUN 89 TIME ERRORS (just what I always wanted, a program to insert stuff 90 into another program and give me more errors...). 91 92 So I wrote code to leave out the line numbers for: 93 TYPE .... .... .... END TYPE 100 and... 101 SELECT CASE .... .... .... END SELECT 107 ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ 108 ³Bullet Proof it's NOT!³ 109 ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ 110 But... ADDNUM.EXE =AIN'T= perfect. The code to do the above is 111 tricker than it looks primarily because everyone writes code in 112 their own weird way. So I settled for what you see. 113 114 ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ 115 ³Better be careful...³ 116 ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ 117 RUN the line number converted file with QB.EXE (in the 118 environment). If it works there, compile it with the "/D"switch 119 Better check to see if you also need the "/E" and "/W" switches 120 too!) 121 122 If you make ADDNUM.BAS better, drop me a copy. 123 124 John De Palma on CompuServe 76076,571