home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / basic / tools / numadd / addnum.txt < prev    next >
Text File  |  1994-04-03  |  6KB  |  125 lines

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