1

Тема: Сортировка массива в LotusScript

Пример кода для сортировки массивов на LotusScript-е

    Dim myarrr(5) As String
        Dim tempc As String
        Dim t As Boolean
        myarrr(0)=1
        myarrr(1)=5
        myarrr(2)=3
        myarrr(3)=8
        myarrr(4)=2
        
        t = True
        Do While t
            t = False
            For x = 1 To Ubound (myarrr)
                If myarrr(x-1) > myarrr(x)   Then
                    tempc =    myarrr(x)    
                    myarrr(x) = myarrr(x-1)
                    myarrr(x-1) = tempc
                    t = True
                End If
            Next
        Loop
        
        For x = 0 To 5
            Print myarrr(x)
        Next

Поделиться