Results 1 to 3 of 3

Thread: Flex Grid Extract

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2000
    Location
    Hong Kong
    Posts
    5

    Question

    Hi,

    I have added data to an MSFlexgrid using the "addrow" option and am now trying to extract that data, filter it and then stick it in another flexgrid, this is where I'm stumped, completely in fact and any assistance would be appreciated.

    My data is in the following format:

    C0 C1 C2 C3 C4
    R1 180 1.01 2.1 -1.5
    R2 180 0.99 2.0 -1.5
    R3 180 1.10 2.2 -1.5
    R4 180 0.87 1.9 -2.2
    R5 180 0.95 1.8 -2.2
    R6 180 1.20 1.9 -2.2


    what I'm trying to do is to run a query on the msflexgrid which will provide me with the average sqrt of (C2 sqr + C3 sqr) when the C4 values are the same and then dump this value out to another msflexgrid with the C4 value to which it applies ie

    Ave. squareroot of (C2 sq+c3 sq) = "2.34" where C4 = "-1.5"
    Ave. squareroot of (C2 sq+c3 sq) = "3.39" where C4 = "-2.2"
    and so on for whatever values of C4 occur within the msflexgrid.

    In addition to this I also want to display the C2, C3, C4 values from the msflexgrid on an xy scatter chart, the trouble is I may have up to 280,000 lines of input which seems to clog things up somewhat.

    Any help would be really appreciated as I'm stumped and my book doesn't help.

    Cheers

    Tee Jay

  2. #2
    Hyperactive Member Paul Warren's Avatar
    Join Date
    Jun 2000
    Location
    UK
    Posts
    282

    Any use to you ?

    Tee Jay - Is this any use to you :

    Code:
    Private GridData() As Single
    
    Private Sub Form_Load()
    
    Dim iTemp1 As Integer
    Dim iTemp2 As Integer
    
    ReDim GridData(MSFlexGrid1.Rows, MSFlexGrid1.Cols)
    
    For iTemp1 = 0 To MSFlexGrid1.Rows - 1
        For iTemp2 = 0 To MSFlexGrid1.Cols - 1
            GridData(iTemp1, iTemp2) = Val(MSFlexGrid1.TextMatrix(iTemp1, iTemp2)) ' Save the value for manipulation
        Next iTemp2
    Next iTemp1
    
    Do_Transformation
    
    For iTemp1 = 0 To MSFlexGrid1.Rows - 1
        For iTemp2 = 0 To MSFlexGrid1.Cols - 1
            MSFlexGrid2.TextMatrix(iTemp1, iTemp2) = GridData(iTemp1, iTemp2) ' Write the new value into the flexgrid
        Next iTemp2
    Next iTemp1
    
    End Sub
    
    Private Sub Do_Transformation()
    
    ' Do your calculations here
    
    End Sub
    That's Mr Mullet to you, you mulletless wonder.

  3. #3

    Thread Starter
    New Member
    Join Date
    Aug 2000
    Location
    Hong Kong
    Posts
    5

    Re: Any use to you ?

    Hi Paul,

    Thanks allot I'll give it a go

    Cheers

    Tee Jay

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