Libraries & objects
About Archicad and BIMcloud libraries, their management and migration, objects and other library parts, etc.

Array arrangement method?

Anonymous
Not applicable
HI!
How to arrange arrays in GDL? Python is very simple


I want to print such a result:
1 REPLY 1
Anonymous
Not applicable

    dim test[],st[]
    test[1]=2.2
    test[2]=1
    test[3]=3.5
    test[4]=4
    test[5]=5.3

    for i = 1 to 5
        sl=1
        for i2= 1 to 5
            if test>test[i2] then sl=sl+1
        next i2
        st[sl]=test
    next i
	print st
If it is an integer, you can use this simple way of writing.
    dim test[],st[]
    test[1]=2
    test[2]=1
    test[3]=4
    test[4]=5
    test[5]=3
	for i = 1 to 5
        st[test] = test
    next i
    print st