首页->【软件工具包使用(SW/Software Tools Usage)】

6 1

Public Sub ExampleVBASyntx()
        ExampleBasicSyntx
End Sub

' Example of Basic Syntx
Public Function ExampleBasicSyntx()

   '''String here
   Dim stra As String, strb As String
   Dim resStr() As String
   
   '''Boolean here
   Dim res  As Boolean
   
   '''Integer here
   Dim start_point As Integer
   
   '''Type here
   Dim tyADCData As tyADCTestData

   stra = "my Name is SWinyoo"
   strb = "my "
   start_point = 1
   
   'example of Instr
   res = InStr(start_point, stra, strb)
   'example of Split
   resStr = Split(stra, " ")
   'example of Type data
   With tyADCData
        .dSNR = -20
        .bTestEnable = False
        .cTestName = "ADCTest"
        .dIMD2 = -30.13
        .dIMD3 = -42.15
        .dTHD = -55.23
        .dTsettle = 10.22 'ns
        .iTestNumber = 23000
        
   End With
   
End Function



Option Explicit
'这个是一个module 文件
'Public Sub TestDataSet()
    ' define the type data model adc
Public Type tyADCTestData

     dSNR   As Double
     dTHD  As Double
     
     dIMD2 As Double
     dIMD3 As Double
     
     dTsettle As Double
     
      cTestName As String
      
      bTestEnable As Boolean
      iTestNumber As Integer
     
End Type
' dac
Public Type tyDACTestData

     dSNR   As Double
     dTHD  As Double
     
     dIMD2 As Double
     dIMD3 As Double
     
     dTsettle As Double
     dSFDR  As Double
      
      cTestName As String
      bTestEnable As Boolean
      iTestNumber As Integer
          
End Type
'End Sub


楼主可见

  1. shwnyoo 1#

    VBA split Instr type 数据类型 例程