Public Sub VBObjectBrowserInfoRemoveSample() 'See also: ' VBObjectBrowserInfoRemove Function ' VBUtilitiesSample Subroutine Const strFn = "VBObjectBrowserInfoRemoveSample" Dim strInFiles As String strInFiles = InputBox("Read Visual Basic 4.0 Modules: (Wildcards allowed; {Esc} cancels.)", strFn, "\Entisoft\Tools\*.Cls") If Len(strInFiles) = 0 Then Exit Sub Dim strToDirectory As String strToDirectory = GetTempFileName(Null, strFn) strToDirectory = InputBox("Destination directory: (ANY FILE WITH THIS NAME WILL BE DELETED; FILES IN THIS DIRECTORY WITH THE SAME NAMES AS INPUT FILES WILL BE OVERWRITTEN AND/OR REPLACED; {Esc} cancels.)", strFn, strToDirectory) If Len(strToDirectory) = 0 Then Exit Sub If Len(Dir$(strToDirectory)) Then Kill strToDirectory Dim intKeepBackup As Integer Select Case MsgBox("Retain backup of any overwritten files within the Windows Temporary directory?", vbQuestion + vbYesNoCancel + vbDefaultButton1, strFn) Case vbYes intKeepBackup = True Case vbNo intKeepBackup = False Case vbCancel Exit Sub Case Else Stop End Select Dim intRemoveDescriptions As Integer Select Case MsgBox("Remove Object Browser Descriptions?", vbQuestion + vbYesNoCancel + vbDefaultButton1, strFn) Case vbYes intRemoveDescriptions = True Case vbNo intRemoveDescriptions = False Case vbCancel Exit Sub Case Else Stop End Select Dim intRemoveHelpIDs As Integer Select Case MsgBox("Remove Object Browser Help Context IDs?", vbQuestion + vbYesNoCancel + vbDefaultButton1, strFn) Case vbYes intRemoveHelpIDs = True Case vbNo intRemoveHelpIDs = False Case vbCancel Exit Sub Case Else Stop End Select Dim intStripComments As Integer Select Case MsgBox("Remove Comments from the Visual Basic Code?", vbQuestion + vbYesNoCancel + vbDefaultButton1, strFn) Case vbYes intStripComments = True Case vbNo intStripComments = False Case vbCancel Exit Sub Case Else Stop End Select If intStripComments Then Dim intKeepFlagsAndCoprs As Integer Select Case MsgBox("Retain Comments containing flags and copyright notices?", vbQuestion + vbYesNoCancel + vbDefaultButton1, strFn) Case vbYes intKeepFlagsAndCoprs = True Case vbNo intKeepFlagsAndCoprs = False Case vbCancel Exit Sub Case Else Stop End Select End If Dim intTrimLines As Integer Select Case MsgBox("Remove leading spaces from program lines?", vbQuestion + vbYesNoCancel + vbDefaultButton1, strFn) Case vbYes intTrimLines = True Case vbNo intTrimLines = False Case vbCancel Exit Sub Case Else Stop End Select Dim intRemoveBlankLines As Integer Select Case MsgBox("Remove blank lines?", vbQuestion + vbYesNoCancel + vbDefaultButton1, strFn) Case vbYes intRemoveBlankLines = True Case vbNo intRemoveBlankLines = False Case vbCancel Exit Sub Case Else Stop End Select MsgBox "Return = " & VBObjectBrowserInfoRemove( _ vInFiles:=strInFiles, _ vOutDirectory:=strToDirectory, _ vKeepBackup:=intKeepBackup, _ vRemoveDescriptions:=intRemoveDescriptions, _ vRemoveHelpIDs:=intRemoveHelpIDs, _ vStripComments:=intStripComments, _ vKeepFlagsAndCoprs:=intKeepFlagsAndCoprs, _ vTrimLines:=intTrimLines, _ vRemoveBlankLines:=intRemoveBlankLines _ ) & " (True means success; False means failure.)", vbInformation, strFn End Sub
Copyright 1996-1999 Entisoft
Entisoft Tools is a trademark of Entisoft.