home *** CD-ROM | disk | FTP | other *** search
- 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
-