Results 1 to 3 of 3

Thread: loop through the structure values

Threaded View

  1. #1

    Thread Starter
    Fanatic Member karthikeyan's Avatar
    Join Date
    Oct 2005
    Location
    inside .net
    Posts
    919

    loop through the structure values

    hi, here is my class:

    Code:
    Partial Public Class MainForm
        'FFT core Dat
        Public Structure FFTcoreTypeA
            <VBFixedArrayAttribute(899)> Public fft125() As Single   'FFT Data 1.25Hz pitch
            <VBFixedArrayAttribute(21)> Public fftoct3() As Single  'FFT 1/3oct Data
            Public fft_all As Single    'FFT 全域値
            Public fft_high As Single   'FFT 高域値
        End Structure
    
        'FFT scan Dat
        Public Structure FFTscanTypeA
            Public fft_dat As FFTcoreTypeA
            Public use_rate As Single   'use rate 1.0 or 0.0
        End Structure
    
        'FFT hour Dat
        Public Structure FFThourTypeA
            Public fft_mean As FFTcoreTypeA
            Public fft_max As FFTcoreTypeA
            Public fft_min As FFTcoreTypeA
            Public use_rate As Single   'use rate 0.0 to 1.0
        End Structure
    
        Public VELscanA As FFTscanTypeA
        Public ACCscanA As FFTscanTypeA
    
        Public VELhourA As FFThourTypeA
        Public ACChourA As FFThourTypeA
    
    
        Sub ACC(ByVal strDatFile As String)
            Dim length As Integer
    
            length = Len(VELscanA)
            FileOpen(1, strDatFile, OpenMode.Random, , , length)
            FileGet(1, VELscanA, 1)
            FileClose(1)
        End Sub
    
        Sub VEL(ByVal strDatFile As String)
            Dim length As Integer
    
            length = Len(VELhourA)
            FileOpen(2, strDatFile, OpenMode.Random, , , length)
            FileGet(2, VELhourA, 1)
            FileClose(2)
        End Sub
    End Class
    so now i need call the "VEL" method and to loop through the "VELhourA" values .

    here i have tried like as as follows:
    Code:
     Dim struFFThourTypeA(0) As MainForm.FFThourTypeA
      struFFThourTypeA(0) = clsMainForm.VELhourA
       For Each fft_mean As MainForm.FFTcoreTypeA In struFFThourTypeA(0)
    
      Next
    so i am getting compilation error. so please help me to loop through the values in "VELhourA"
    Last edited by karthikeyan; Mar 5th, 2008 at 02:19 AM. Reason: to correct the code tag
    Loving dotnet

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width