Discover our Clipsal Smart Home packages as seen on The Block 2018

in location

OR

I'm looking for

  • Wholesalers
    • Uncheck All Check All
  • EXPERTISE
    • Expand
    • Expand
    • Expand
    • Uncheck All Check All
  • Switchboard Manufacturers
    • Uncheck All Check All
OR

The best way to see what Clipsal electric products can do for your home is seeing them in action at a Clipsal Display Centre.

Product stock may vary according to location. If you're after a specific product range, please check with your chosen location before visiting.

10 Results
    Load More Load Complete
    Change Location

    Example of mimic script that populates a Combo Box

    This sample program is intended to demonstrate one or more programming functions or methods and is presented as programming example only. Schneider Electric assumes no liability for the use or application of this example program or any portion thereof.


    This example shows how a ComboBox may be populated in ClearSCADA. The example also shows how a selection can be made from the populated ComboBox. It is done by populating an array at the same time as populating the ComboBox where the entires in the ComboBox match those of the array. When an entry is selected from the ComboBox the same entry is referenced to in the array and a variable is set.

    Sub ShowForm

    Dim frmComboBox, frmOKButton
    Dim sqlUserLookupRows, sqlUserLookupRowsCount
    Dim oSelectedUser, oComboArray()
    Dim c,r

    'Get a list of users from the database.
    Set sqlUserLookup = Server.Query("SELECT FullName FROM CDBUSER")
    sqlUserLookupRowsCount = sqlUserLookup.RowCount

    'Set size of the array to match the number of users returned by the above SQL query
    ReDim oComboArray(sqlUserLookupRowsCount)

    'Build a VB form
    Form.Init "Please make a selection"
    Form.AddGroupBox 0,0,100,8,""
    Set frmComboBox = Form.AddComboBox(10,1)

    'Populate the ComboBox with the list of users retrieved
    If Not(sqlUserLookup.Error) Then

        sqlUserLookupRows = sqlUserLookup.Rows
        sqlUserLookupColumns = sqlUserLookup.ColumnNames

        For r = 0 To (sqlUserLookup.RowCount - 1)
            For c = 0 To (sqlUserLookup.ColumnCount - 1)
                frmComboBox.Add(sqlUserLookupRows(r,0))        
                oComboArray(r) = sqlUserLookupRows(r,0)
            Next
        Next
    Else
        Msgbox sqlUserLookup.ErrorMessage, vbCritical + vbOKOnly, "Error in SQL Command"
    End If

    frmComboBox.Selection = 1
    Set frmOKButton = Form.AddPushButton(40,5,"OK")
    frmOKButton.Default = True
    Form.Show

    'Store the selected user in oSelectedUser and display it in a message
    oSelectedUser = oComboArray(frmComboBox.Selection)
    msgbox "The selected user is: " + oSelectedUser 

    End Sub

    Didn’t find what you were looking for?

    Try Searching Again View Our Categories

    Need further assistance?

    Our Customer Care department provides total customer service solutions for our residential, industrial and commercial applications.

    Get Assistance