⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cinputidentification.cls

📁 Data monkey是一个强大的是数据传输和转换应用程序。使用DataMonkey用户可以把复杂的文本文件格式
💻 CLS
字号:
VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "CInputIdentification"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Attribute VB_Ext_KEY = "SavedWithClassBuilder" ,"Yes"
Attribute VB_Ext_KEY = "Top_Level" ,"Yes"
Attribute VB_Ext_KEY = "SavedWithClassBuilder6" ,"Yes"
' DataMonkey Data Conversion Application. Written by Theodore L. Ward
' Copyright (C) 2002 AstroComma Incorporated.
'
' This program is free software; you can redistribute it and/or
' modify it under the terms of the GNU General Public License
' as published by the Free Software Foundation; either version 2
' of the License, or (at your option) any later version.
'
' This program is distributed in the hope that it will be useful,
' but WITHOUT ANY WARRANTY; without even the implied warranty of
' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
' GNU General Public License for more details.
'
' You should have received a copy of the GNU General Public License
' along with this program; if not, write to the Free Software
' Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
' The author may be contacted at:
' TheodoreWard@Hotmail.com or TheodoreWard@Yahoo.com

Public Enum eInputType
    ASCII
    DB
    SQLDB
    OTHER
    none    ' Always last due to the line below.
End Enum

' Describe the different types of input.
Private eInputTypeDescription(eInputType.none) As String

Private Const NUM_DATA_IDENTIFIERS = 3
Public Enum HowToIdentifyData
    PositionOnLine = 1
    RelativeToOtherItem
    TypeOfData
End Enum

Private Const NUM_LINE_IDENTIFIERS = 7
Public Enum HowToIdentifyLine
    AllAlike = 1
    Identifier
    PositionInFile
    RelativeToOtherItem
    TypeOfDataContained
    BeginsInPosition
    ContainsNCharacters
End Enum

Private mHowToIdentifyData(NUM_DATA_IDENTIFIERS) As String
Private mHowToIdentifyLine(NUM_LINE_IDENTIFIERS) As String
Private mHowToIdentifyLineCount As Integer
Private mHowToIdentifyDataCount As Integer

Private Sub Class_Initialize()

    '************************************************
    ' Manually set the string arrays with descriptive
    ' messages telling of how data may be identified.
    '************************************************
    
    DefineStringArrays
    FillInInputTypeArray
End Sub

Private Sub FillInInputTypeArray()

    ' Describe the different types of input.
    eInputTypeDescription(eInputType.ASCII) = "ASCII File"
    eInputTypeDescription(eInputType.DB) = "ODBC Database"
    eInputTypeDescription(eInputType.SQLDB) = "SQL Query"
    eInputTypeDescription(eInputType.OTHER) = "User Defined Input Reader"
    eInputTypeDescription(eInputType.none) = "None"

End Sub

Public Function GetInputTypeDescription(pos As Long) As String
    On Error GoTo eHandler
    GetInputTypeDescription = eInputTypeDescription(pos)
    Exit Function
eHandler:
    GetInputTypeDescription = ""
End Function
Public Function GetNumInputTypes() As Integer
    GetNumInputTypes = eInputType.none + 1
End Function

Private Sub DefineStringArrays()
    
    mHowToIdentifyData(HowToIdentifyData.PositionOnLine) = _
        "Position on the line"
    mHowToIdentifyData(HowToIdentifyData.RelativeToOtherItem) = _
        "Relative to something else"
    mHowToIdentifyData(HowToIdentifyData.TypeOfData) = _
        "Contains a certain type of data"

    mHowToIdentifyLine(HowToIdentifyLine.Identifier) = _
        "Look for an identifier on the line"
    mHowToIdentifyLine(HowToIdentifyLine.AllAlike) = _
        "All the lines are the same"
    mHowToIdentifyLine(HowToIdentifyLine.PositionInFile) = _
        "By counting line numbers"
    mHowToIdentifyLine(HowToIdentifyLine.RelativeToOtherItem) = _
        "Relative to something else"
    mHowToIdentifyLine(HowToIdentifyLine.TypeOfDataContained) = _
        "Contains certain type of data"
    mHowToIdentifyLine(HowToIdentifyLine.BeginsInPosition) = _
        "The first character is in a certain position"
    mHowToIdentifyLine(HowToIdentifyLine.ContainsNCharacters) = _
        "Contains a certain number of characters"
End Sub

Public Function GetHowToIdentifyDataStrings(ByRef arr As Variant) As Integer

    arr = mHowToIdentifyData
    GetHowToIdentifyDataStrings = mHowToIdentifyDataCount
    
End Function

Public Function GetHowToIdentifyLineStrings(ByRef arr As Variant) As Integer

    arr = mHowToIdentifyLine
    GetHowToIdentifyLineStrings = mHowToIdentifyLineCount
    
End Function

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -