Array of "peak_area"-s

Hi!

Is it possible to create a function (in report editor) to collect peak areas of one(or more) injection into an array? I need an array of unknow peak areas for searching peak pairs in parallel injections. (like area diff is less than 10% -> same unknown)

(OpenLab 2.4)

Thx,

Peter

  • Hello,

    You can see below a simple example using the custom code section of the IR report where I use an array to store and retrieve peak results in tables. This allows with one hidden table at the top to call back into table multiple compound results in a table row. This is a simple array created for the custom code, but if this was created as a custom dll in VB.NET or C# you would have more tools.

    Marty

    'Dimension Variables 
    Public Dim MyArray(5,1) as Object
    Public Dim rows as Integer = 0
    Public Dim test as Integer = 0

    'Naming Function and sending values to fill array by injection id and compound name
    Public Function FillArray(ByVal InjIdCompName As String,ByVal Value1 as Double, ByVal Value2 As Double, ByVal Value3 As Double,Optional ByVal Value4 as Double = 0) As String
    'Filling Array
        rows = Ubound(MyArray,2) + 1
        Redim Preserve MyArray(5,rows)
        MyArray(1,rows) = InjIdCompName
        MyArray(2,rows) = Value1
        MyArray(3,rows) = Value2
        MyArray(4,rows) = Value3
        MyArray(5,rows) = Value4
            
        Return "Complete"
        
    End Function

    'Function to call back value from array
    Public Function UseArray(ByVal InjIdCompName As String, ByVal DataCol as Integer) As Double
        Dim Value as Double = 0
        Dim rowcount as Integer
        rowcount = Ubound(MyArray,2)
            For index As Integer = 1 To rowcount
                 If MyArray(1,index) = InjIdCompName
                    Value = MyArray(DataCol,index)
                 End If
            Next
       
        Return Value
        
    End Function

    'Function to clear array in case of repeating tables
    Public Function ClearArray() As String

        Redim MyArray(0,0)
        Return "Sucessfull"
        
    End Function

Was this helpful?