reverse a value ?
Posted: 01 Dec 2013 18:04
HI
I search a away to reverse a value. I'm thinking "range" can do this but :
e = range(x, 0, 10) or e = range(x, 10, 0) back the same result.
How can I reverse a value ???
I have used this below whose run but I think there is more efficient for doing the same... and it's ok for a short list but if more longer °°°
-------
decl i;
if (e == 0) i = 10;
if (e == 1) i = 9;
if (e == 2) i = 8;
if (e == 3) i = 7;
if (e == 4) i = 6;
if (e == 5) i = 5;
if (e == 6) i = 4;
if (e == 7) i = 3;
if (e == 8) i = 2;
if (e == 9) i = 1;
if (e == 10) i = 0;
-------
thanks for your help
0-0
I search a away to reverse a value. I'm thinking "range" can do this but :
e = range(x, 0, 10) or e = range(x, 10, 0) back the same result.
How can I reverse a value ???
I have used this below whose run but I think there is more efficient for doing the same... and it's ok for a short list but if more longer °°°
-------
decl i;
if (e == 0) i = 10;
if (e == 1) i = 9;
if (e == 2) i = 8;
if (e == 3) i = 7;
if (e == 4) i = 6;
if (e == 5) i = 5;
if (e == 6) i = 4;
if (e == 7) i = 3;
if (e == 8) i = 2;
if (e == 9) i = 1;
if (e == 10) i = 0;
-------
thanks for your help
0-0