<-- Previous || Up || Next -->

VB Preprocessor Sample Sub
VB Utilities Class

Public Sub VBPreprocessorSample()

    'See also:
    '  VBPreprocessor Function
    '  VBUtilitiesSample Subroutine

    Const strFn = "VBPreprocessorSample"

    Dim strFlagPrefix As String
    strFlagPrefix = InputBox("Prefix for VB preprocessor flags: ({Esc} cancels.)", strFn, "'#")
    If Len(strFlagPrefix) = 0 Then Exit Sub

    Dim strVersion As String
    strVersion = InputBox("Preprocess version: ({Esc} cancels.)", strFn, "VB3")
    If Len(strVersion) = 0 Then Exit Sub

    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 strOutFile As String
    strOutFile = GetTempFileName(Null, strFn)
    strOutFile = InputBox("Write VBA Module: (FILE WILL BE OVERWRITTEN; {Esc} cancels.)", strFn, strOutFile)
    If Len(strOutFile) = 0 Then Exit Sub

    Dim strModuleHeader As String
    strModuleHeader = "Attribute VB_Name = ""Library""" & vbCrLf & "Attribute VB_Description = ""Entisoft Tools Object Library"""
    strModuleHeader = InputBox("Module header?", strFn, strModuleHeader)
    If Len(strModuleHeader) = 0 Then Exit Sub

    Dim intSuppressAttributes As Integer
    Select Case MsgBox("Suppress Attribute statements?", vbQuestion + vbYesNoCancel + vbDefaultButton2, strFn)
        Case vbYes
            intSuppressAttributes = True
        Case vbNo
            intSuppressAttributes = False
        Case vbCancel
            Exit Sub
        Case Else
            Stop
    End Select

    MsgBox "Return = " & VBPreprocessor( _
        vFlagPrefix:=strFlagPrefix, _
        vVersion:=strVersion, _
        vInFiles:=strInFiles, _
        vOutFile:=strOutFile, _
        vModuleHeader:=strModuleHeader, _
        vSuppressAttributes:=intSuppressAttributes _
        ) & " (True means success; False means failure.)", vbInformation, strFn
End Sub

Copyright 1996-1999 Entisoft
Entisoft Tools is a trademark of Entisoft.