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

📄 ccmdif.cls

📁 Data monkey是一个强大的是数据传输和转换应用程序。使用DataMonkey用户可以把复杂的文本文件格式
💻 CLS
📖 第 1 页 / 共 2 页
字号:
VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "CCmdIf"
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

Option Explicit

Enum eCmdValueTypes
    cvtNONE
    cvtConstant
    cvtDataItem
    cvtCheckPoint
    cvtMe
    cvtLineOfInput
    cvtNumeric
End Enum

Private mRHS As Variant
Private mRHSType As eCmdValueTypes
Private mRHSCheckPointName As String
Private mRHSDataItemName As String
Private mRHSGetValue As CCmdGetValue

Private mLHS As Variant
Private mLHSType As eCmdValueTypes
Private mLHSCheckPointName As String
Private mLHSDataItemName As String
Private mLHSGetValue As CCmdGetValue

Private mOperator As String
Private mIndex As Integer
Private mvarType As Integer 'local copy
Private mUniqueID As String
Private mCaseSensitive As Boolean

Public Function GetID() As String
    GetID = mUniqueID
End Function

Public Function Copy() As CCmdIf
    On Error GoTo eHandler
    Set Copy = Nothing

    Dim newObj As CCmdIf
    Set newObj = New CCmdIf

    newObj.LHS = Me.LHS
    newObj.LHSType = Me.LHSType
    newObj.LHSDelimited = Me.LHSDelimited
    newObj.LHSDelimiter = Me.LHSDelimiter
    newObj.LHSInputLinePosition = Me.LHSInputLinePosition

    newObj.RHS = Me.RHS
    newObj.RHSType = Me.RHSType
    newObj.RHSDelimited = Me.RHSDelimited
    newObj.RHSDelimiter = Me.RHSDelimiter
    newObj.RHSInputLinePosition = Me.RHSInputLinePosition
    
    newObj.Operator = Me.Operator
    newObj.CaseSensitive = Me.CaseSensitive

    Set Copy = newObj
    Set newObj = Nothing
    Exit Function

eHandler:
    LogError "CCmdIf", "Copy", Error(Err), False

End Function

Public Property Let RHSInputLinePosition(ByVal vData As Integer)
    mRHSGetValue.Position = vData
End Property
Public Property Get RHSInputLinePosition() As Integer
    RHSInputLinePosition = mRHSGetValue.Position
End Property

Public Property Let RHSLength(ByVal vData As Integer)
    mRHSGetValue.Length = vData
End Property
Public Property Get RHSLength() As Integer
    RHSLength = mRHSGetValue.Length
End Property

Public Property Let RHSDelimited(ByVal vData As Boolean)
    mRHSGetValue.Delimited = vData
End Property
Public Property Get RHSDelimited() As Boolean
    RHSDelimited = mRHSGetValue.Delimited
End Property

Public Property Let RHSDelimiter(vData As String)
    mRHSGetValue.Delimiter = vData
End Property
Public Property Get RHSDelimiter() As String
    RHSDelimiter = mRHSGetValue.Delimiter
End Property

Public Property Let LHSInputLinePosition(ByVal vData As Integer)
    mLHSGetValue.Position = vData
End Property
Public Property Get LHSInputLinePosition() As Integer
    LHSInputLinePosition = mLHSGetValue.Position
End Property

Public Property Let LHSDelimited(ByVal vData As Boolean)
    mLHSGetValue.Delimited = vData
End Property
Public Property Get LHSDelimited() As Boolean
    LHSDelimited = mLHSGetValue.Delimited
End Property

Public Property Let LHSDelimiter(vData As String)
    mLHSGetValue.Delimiter = vData
End Property
Public Property Get LHSDelimiter() As String
    LHSDelimiter = mLHSGetValue.Delimiter
End Property

Public Property Let LHSLength(ByVal vData As Integer)
    mLHSGetValue.Length = vData
End Property
Public Property Get LHSLength() As Integer
    LHSLength = mLHSGetValue.Length
End Property

Public Property Let CaseSensitive(ByVal vData As Boolean)
    mCaseSensitive = vData
End Property
Public Property Get CaseSensitive() As Boolean
    CaseSensitive = mCaseSensitive
End Property

Public Function EditProperties(NameForCaption As String, Optional ByRef Import As CImport = Nothing) As Integer
    Dim tImport As CImport
    Set tImport = Import
    If tImport Is Nothing Then Set tImport = GImport
    
    frmCMDIfProperties.Initialize Me, NameForCaption, tImport
    
    frmCMDIfProperties.left = Screen.Width / 2 - frmCMDIfProperties.Width / 2
    frmCMDIfProperties.top = Screen.Height / 2 - frmCMDIfProperties.Height / 2
    
    frmCMDIfProperties.Show vbModal
    EditProperties = GFormReturnValue
End Function

Public Function GetSpecificDescription() As String
    Dim x As String
    
    x = "If "

    Select Case mLHSType
        Case eCmdValueTypes.cvtCheckPoint
            x = x + "CheckPoint " + mLHS + " is located"
            GetSpecificDescription = x
            Exit Function
        Case eCmdValueTypes.cvtConstant
            x = x + " " + mLHS
        Case eCmdValueTypes.cvtDataItem
            x = x + mLHS
        Case eCmdValueTypes.cvtMe
            x = x + " this DataItem "
        Case eCmdValueTypes.cvtNONE
            x = x + " <undefined>"
        Case eCmdValueTypes.cvtLineOfInput
            x = x & "the value "
            If mLHSGetValue.Delimited Then
                x = x & "at position " + Trim(str(mLHSGetValue.Position))
            Else
                x = x & "FROM " & Trim(str(mLHSGetValue.Position))
                x = x & " TO " & Trim(str(mLHSGetValue.Position + mLHSGetValue.Length))
            End If
        
    End Select
    
    If mOperator = "=" Then
        x = x & " is "
    ElseIf mOperator = "<>" Then
        x = x & " is not "
    Else
        x = x & " " & mOperator & " "
    End If

    Select Case mRHSType
        Case eCmdValueTypes.cvtCheckPoint
            x = x + "I'm confused"
        Case eCmdValueTypes.cvtConstant
            If Len(mRHS) > 0 Then
                x = x + mRHS
            Else
                x = x & "Nothing"
            End If
            
        Case eCmdValueTypes.cvtDataItem
            x = x + mRHS
        Case eCmdValueTypes.cvtMe
            x = x + "this DataItem"
        Case eCmdValueTypes.cvtNumeric
            x = x & "any number"
        Case eCmdValueTypes.cvtNONE
            x = x + "<undefined>"
        Case eCmdValueTypes.cvtLineOfInput
            x = x & "the value "
            If mRHSGetValue.Delimited Then
                x = x & "at position " + Trim(str(mRHSGetValue.Position))
            Else
                x = x & "FROM " & Trim(str(mRHSGetValue.Position))
                x = x & " TO " & Trim(str(mRHSGetValue.Position + mRHSGetValue.Length))
            End If

    End Select
    
    GetSpecificDescription = x

End Function

Public Function GetApplications() As eCmdApplications
    GetApplications = GCmdHelper.CMDGetApplications(CmdType())
End Function

Public Property Let Operator(ByVal vData As String)
    mOperator = vData
End Property

Public Property Get Operator() As String
    Operator = mOperator
End Property

Public Property Let RHSType(ByVal vData As eCmdValueTypes)
    mRHSType = vData
    If mRHSType = cvtDataItem Or mRHSType = cvtCheckPoint Then
        ParseDataItemName CStr(mRHS), mRHSCheckPointName, mRHSDataItemName
    End If
End Property

Public Property Get RHSType() As eCmdValueTypes
    RHSType = mRHSType
End Property

Public Property Let LHSType(ByVal vData As eCmdValueTypes)
    mLHSType = vData
    If mLHSType = cvtDataItem Or mLHSType = cvtCheckPoint Then
        ParseDataItemName CStr(mLHS), mLHSCheckPointName, mLHSDataItemName
    End If
End Property

Public Property Get LHSType() As eCmdValueTypes
    LHSType = mLHSType
End Property

Public Property Let RHS(ByVal vData As Variant)
    mRHS = vData
    If mRHSType = cvtDataItem Or mRHSType = cvtCheckPoint Then
        ParseDataItemName CStr(mRHS), mRHSCheckPointName, mRHSDataItemName
    End If
End Property

Public Property Get RHS() As Variant
    RHS = mRHS
End Property

Public Property Let LHS(ByVal vData As Variant)
    mLHS = vData
    If mLHSType = cvtDataItem Or mLHSType = cvtCheckPoint Then
        ParseDataItemName CStr(mLHS), mLHSCheckPointName, mLHSDataItemName
    End If
End Property

Public Property Get LHS() As Variant
    LHS = mLHS
End Property

Public Function CmdType() As Integer
    CmdType = eCmdTypes.cmdif
End Function

Public Property Let index(ByVal vData As Integer)
    mIndex = vData
End Property

Public Property Get index() As Integer
    index = mIndex

⌨️ 快捷键说明

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