home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 10 / 10.iso / l / l408 / 2.img / EXAMPLES.EXE / EXAMPLES / INCLUTIL / MAINFORM.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1992-10-12  |  19.6 KB  |  398 lines

  1. Mainform
  2. MicroHelp $Include Utility
  3. System
  4. Form1
  5. Frame2
  6. Files to Process
  7. System
  8. Label1
  9. &Spec
  10. FileOpenSpec
  11. FileOpenList
  12. *.BAS
  13. FileOption
  14. Files &Matching Spec
  15. FileOption
  16. Se&lected File Only
  17. Frame2
  18. &Directories
  19. System
  20. FileOpenCurDir
  21. FileOpenCombo
  22. DirOptions
  23. Dir + &Below
  24. DirOptions
  25. &This Dir only
  26. DirOptions
  27. Entire Dr&ive
  28. Frame2
  29. Include Files
  30. System
  31. Label1
  32. S&pec
  33. IncFileSpec
  34. Label3
  35. I&ndent
  36. IndentSpacing
  37. HScroll1    
  38.     IncOption
  39. Forced &Update
  40.     IncOption
  41. Date/Time &Only
  42. MainOption
  43. &Add/Update Text
  44. MainOption
  45. &Remove Text
  46. OkButton
  47. System
  48. .    EndButton
  49. E&xit
  50. System
  51. SaveButton
  52. Sa&ve
  53. System
  54. ResetButton
  55. R&eset
  56. System
  57. Label2
  58. 7The two controls in this area are invisible at runtime.
  59. FileOpenDrive
  60. System
  61. FileOpenDirList
  62. MenuFile
  63. &File
  64. MenuExit
  65. E&xit
  66.     MenuAbout
  67. &About $Include Utility
  68. MenuHelp
  69. &Help
  70. MenuGeneral
  71. &General
  72.     MenuFiles
  73. &Files to Process
  74. MenuDirectories
  75. &Directories
  76. MenuInclude
  77. &Include Files
  78. MenuAdd
  79. &Add/Remove Text
  80. MenuButtons
  81. &Buttons
  82. Loading
  83. UpdateFileOpenList
  84. FileOpenList
  85. FormatPath
  86. MainForm
  87. Pattern
  88. FileOpenSpec
  89. FileOpenSpec_GotFocus
  90. SelStarti
  91.     SelLengthC
  92. FileOpenSpec_KeyPress
  93. KeyAsciiW
  94. FileOpenSpec_LostFocusu
  95. FileOpenDrive_Change
  96. FileOpenDrive<
  97. DriveH
  98. FileOpenCombo_DblClick
  99. SavePath
  100. FileOpenCombo
  101.     ListIndex
  102.     BadDrive2
  103. BadDir2y
  104.     BadDrive3I
  105. FileOpenDirList
  106. UpdateCombo5
  107. BadDriveMessage
  108. BadPathMessage
  109. @    Form_Load
  110. ReadIniFile
  111. OriginalSpecJ
  112. False
  113. IncludeV
  114. Remark1~
  115. Remark2
  116. Question0
  117. Apostrophe
  118. IncludePath
  119. DirLevel
  120. HScroll1
  121. Value
  122. IndentSpacing
  123. CaptionN
  124. EndButton_Click
  125. IncFileSpec_GotFocus
  126. IncfileSpecq
  127. FileOpenDrive_GotFocus0
  128. FileOpenDirList_GotFocus
  129. OkButton_Click
  130. FileOption
  131. DirOptions
  132. Enabled
  133. StatusForm
  134.     KickStart+
  135. FileOption_Click%
  136. Index
  137. HScroll1_Change1
  138. @    ResetSpec
  139.     ListCount
  140. FileOpenCombo_KeyPressi
  141. MenuExit_Click
  142.     AboutForm|
  143. MenuAbout_Click
  144. MenuGeneral_Click
  145. MenuFiles_Click
  146. MenuDirectories_Click
  147. MenuInclude_Click
  148. MenuAdd_Click
  149. MenuButtons_Click
  150. SaveButton_Click
  151. RememberDefaults
  152. SaveForm'
  153. AppName
  154.     PFileName
  155.     FileExist
  156. PrePend
  157. Default
  158. GetPrivateProfileString
  159. RestoreDefaults
  160.     IncOption
  161. MainOption
  162. ResetButton_Click
  163. DirOptions_Click
  164. Visible
  165. Active
  166. LastSpec
  167. BadDrive
  168. BadDir@
  169. TryDirG
  170. AfterTryDir
  171. MhFalse$
  172. UpdateFileOpenList
  173. FileOpenSpec_GotFocus
  174. FileOpenSpec_KeyPress
  175. FileOpenDrive_Change
  176. FileOpenCombo_DblClick
  177.  Save in case of error
  178.  Read your selection
  179.  Strip bracketse
  180.  Change drives
  181.  Change directories 
  182. There is a problem with that drive
  183.  Restore path/drive 
  184. Form_Load
  185.  For creating MsgBox statements
  186.  Suppress bad path error message
  187.  Breakdown drive/path/filename
  188. $INCLUDE:"
  189. '$BOF"
  190.  Include file markerse
  191. '$EOF"
  192. INCLUDE"
  193.  Keep track of directory levelse
  194. EndButton_Click
  195. IncFileSpec_GotFocus
  196. FileOpenDrive_GotFocus
  197. FileOpenDirList_GotFocus
  198. OkButton_Click
  199. Because you have selected 'Selected File Only', 
  200. you must select one file before processing can begin."
  201. Selection Error"
  202.  If you selected Entire Drivei
  203. This program cannot distinguish between programs "
  204. written for Visual Basic and programs written for 
  205. other versions of BASIC.
  206. If there are any programs on the selected disk "
  207. that contain '$INCLUDE statements, and those programs 
  208. were written for another version of BASIC, they 
  209. should not be processed by this program.
  210. Do you wish to continue?
  211. Warning"
  212.  If you didn't press Yes
  213.  Load status form
  214. FileOption_Click
  215.  If tagging files, then dir/drive choicesg
  216.  don't apply
  217.  Only this dir is valid
  218. HScroll1_Change
  219. ResetSpec
  220. UpdateCombo
  221.  This procedure updates the list box containing the
  222.  drives and directories 
  223.  Remove all items from the list boxx
  224. xxxFileOpenCombo.Visible = MhFalse
  225.  If we're in a subdirectorya
  226.  Add all subdirs
  227.  Add all subdirs
  228. xxxFileOpenCombo.Visible = True
  229. FileOpenCombo_KeyPress
  230.  If you pressed Enter
  231. MenuExit_Click
  232. MenuAbout_Click
  233.  Modal
  234. MenuGeneral_Click
  235.  Using MsgBox for Help is much, much faster than using WinHelp
  236.  or even a separate form (dialog box).
  237. This program is used to emulate the $INCLUDE "
  238. statement for Visual Basic programs. "
  239. You tell the program which VB source files "
  240. to process, which directories to search, "
  241. and which $INCLUDE files to process.
  242. As each $INCLUDE statement is encountered, "
  243. the text from the include file is embedded into your "
  244. source file. The text is surrounded by '$BOF and '$EOF "
  245. statements, so that future processing of the "
  246. program will be successful. (Otherwise, the 
  247. program could not tell where the $INCLUDE text "
  248. begins and ends.)"
  249. This program can process TEXT files only. It "
  250. cannot process source code saved in binary "
  251. format within a .FRM file.
  252. If a $INCLUDE statement contains a drive "
  253. or path, only the directory where the file "
  254. exists is searched. 
  255. Otherwise, that directory is searched first, "
  256. and if not found, the path specified "
  257. by the INCLUDE environment variable is searched. "
  258. Help - General Information
  259. MenuFiles_Click
  260.  Using MsgBox for Help is much, much faster than using WinHelp
  261.  or even a separate form (dialog box).
  262. In the textbox labeled 'Spec', enter a file 
  263. specification that tells the program "
  264. which of your source code files to process. 
  265. You may specify a drive and path in this "
  266. field, and you may also use the standard "
  267. DOS wildcard characters '?' and '*'.
  268. The option buttons tell the program whether to "
  269. process only the selected file, or all "
  270. files matching the specification you enter."
  271. Help - Files to Process"
  272. %H{down}
  273. MenuDirectories_Click
  274.  Using MsgBox for Help is much, much faster than using WinHelp
  275.  or even a separate form (dialog box).
  276. Use the Directories frame to tell this program "
  277. which directories on the selected disk should 
  278. be searched for files matching the specification "
  279. entered in the 'Spec' field of the 'Files to Process' 
  280. frame.
  281. The 'Dir + Below' option button tells the 
  282. program to process the selected files in this 
  283. directory, as well as all subdirectories "
  284. underneath it.
  285. Help - Directories to Process"
  286. %H{down}{down}
  287. MenuInclude_Click
  288.  Using MsgBox for Help is much, much faster than using WinHelp
  289.  or even a separate form (dialog box).
  290. To limit processing of $INCLUDE files 
  291. to either a single include file, or to "
  292. include files that match a specification "
  293. that includes wildcards, enter "
  294. the information in the 'Spec' textbox.
  295. 'Indent' value indicates how many 
  296. spaces to place in your source code 
  297. ahead of each line from 
  298. the include file. This is handy 
  299. when you have nested $INCLUDE files. "
  300. Use the scrollbar to change the value.
  301. The 'Forced Update' option button tells the 
  302. program that the text from all $INCLUDE files matching "
  303. 'Spec' should be updated, regardless of the 
  304. file dates and times."
  305. 'Date/Time Only' causes the text to be updated "
  306. only if the include file is newer than the "
  307. source file. (This applies "
  308. only to the include file named in your source, "
  309. and does not apply to $INCLUDE files that 
  310. may be embedded within include files.)
  311. Help - Include Files
  312. %H{down}{down}{down}
  313. MenuAdd_Click
  314.  Using MsgBox for Help is much, much faster than using WinHelp
  315.  or even a separate form (dialog box).
  316. Add/Update Text tells the program to embed text 
  317. from the include file into your source file. "
  318. After processing, your source file will have a "
  319. '$BOF statement immediately under the $INCLUDE "
  320. statement, with a '$EOF statement appearing 
  321. immediately after the embedded text. This is "
  322. done so we can tell which text came from the "
  323. include file if your source file is processed 
  324. more than once."
  325. The 'Remove Text' option is present so that if "
  326. true $INCLUDE support is added to a future "
  327. version of Visual Basic, you will be able 
  328. to remove the embedded text from your source "
  329. files. This results in only the $INCLUDE "
  330. statements themselves remaining in your source "
  331. code file.
  332. Help - Add/Remove"
  333. %H{down}{down}{down}{down}
  334. MenuButtons_Click
  335.  Using MsgBox for Help is much, much faster than using WinHelp
  336.  or even a separate form (dialog box).
  337. Clicking the OK button tells the program to 
  338. begin execution.
  339. The Exit button simply ENDs the program.
  340. The Save button saves your selections 
  341. to the INCLUTIL.INI file so that when you 
  342. next run the program, the same selections 
  343. will be loaded from INCLUTIL.INI and be put into effect.
  344. Clicking the Reset button causes all the "
  345. options to be restored to their defaults. 
  346. If you have previously used the Save button, "
  347. this results in the same options you had "
  348. specified at the time you saved them. 
  349. Otherwise, it results in the default settings 
  350. as specified in the main dialog box of this 
  351. program.
  352. Help - Buttons
  353. %H{down}{down}{down}{down}{down}
  354. SaveButton_Click
  355. ReadIniFile
  356.  Set up parameters for INI filew
  357. INCLUTIL
  358. INCLUTIL.INI
  359.  If file exists in current dir, prepend CurDir$i
  360.  Make it ASCIIZr
  361. filespec
  362. fileoption
  363. diroption"
  364. incspec"
  365. spacing"
  366. incoption"
  367. mainoption
  368.  keep defaults
  369.  Setup defaults from the form, in case there's no
  370.  INI file availablem
  371.  how many items to savee
  372.  Function returns length
  373.  No INI file
  374. RememberDefaults
  375.  how many items to saveh
  376. RestoreDefaults
  377. ResetButton_Click
  378. DirOptions_Click
  379.  This Dir Only
  380.  Do allow "selected file only"
  381.  Check Files Matching Spec button
  382.  Don't allow "selected file only"t
  383. FileOpenSpec_LostFocus
  384.  Avoid recursion
  385.  See if spec has \ or :a
  386.  Nope - use CurDir$ + spec
  387.  Avoid processing if same spec as before
  388.  if there is a colon
  389.  Attempt to change to that drive
  390.  New directory? 
  391.  if there is a new directory
  392.  Strip trailing backslashy
  393.  If we can CHDIR to Temp$, then it's a directory
  394.  If we got here, user entered a dir name
  395.  Now it's not a spec anymore
  396.  See if he specified a single file
  397.  Don't report an error
  398.