cancel
Showing results for 
Search instead for 
Did you mean: 
EN
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Array arrangement method?

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

Didn't find the answer?

Check other topics in this Forum

Back to Forum

Read the latest accepted solutions!

Accepted Solutions

Start a new conversation!