search a big value on an array
Posted: Wed Nov 18, 2020 11:31 am
If I have this array
aData:= { {"B", 0.2, 0.1 ,3.6 ,0.7},;
{"T", 0.2, 0.75 ,3.6 ,0.5},;
{"T", 0.2, 1.2 ,3.6 ,0.4},;
{"T", 0.2, 1.6 ,3.8 ,0.4},;
{"T", 0.2, 1.6 ,3.6 ,0.4},;
{"T", 0.2, 1.6 ,3.6 ,0.4} }
I would like to find the largest number of the 4th array column ( adata[n][4])
how I must make ?
thanks
I made
nHeightold:= adata[1][4]
For n= 1 to Len(adata)
If adata[n][4]>nHeightold
nHeightBig:= adata[n][4]
nHeightold:= adata[n][4]
Endif
next
but I believe there is a better method
aData:= { {"B", 0.2, 0.1 ,3.6 ,0.7},;
{"T", 0.2, 0.75 ,3.6 ,0.5},;
{"T", 0.2, 1.2 ,3.6 ,0.4},;
{"T", 0.2, 1.6 ,3.8 ,0.4},;
{"T", 0.2, 1.6 ,3.6 ,0.4},;
{"T", 0.2, 1.6 ,3.6 ,0.4} }
I would like to find the largest number of the 4th array column ( adata[n][4])
how I must make ?
thanks
I made
nHeightold:= adata[1][4]
For n= 1 to Len(adata)
If adata[n][4]>nHeightold
nHeightBig:= adata[n][4]
nHeightold:= adata[n][4]
Endif
next
but I believe there is a better method