TC|##|####|####|1,3| 0.00
TC|##|####|####|1,3,6| 100000.00
TC|##|####|1036|1,3,12| 0.00
TC|VI|STDR|####|1,6| 0.00
TC|##|####|####|1,3| 0.00
TC|##|####|####|1,3,6| 100000.00
TC|##|####|1036|1,3,12| 0.00
TC|VI|STDR|####|1,6| 0.00
TC|##|####|####|1,3| 0.00
TC|##|####|####|1,3,6| 100000.00
TC|##|####|1036|1,3,12| 0.00
TC|VI|STDR|####|1,6| 0.00
TC|##|####|1036|1,3,12| 0.00
TC|VI|STDR|####|1,6| 0.00
TC|##|####|####|1,3,6| 100000.00
TC|##|####|####|1,3| 0.00
Changing the codeblock from:
{ |x,y| x[4]>=y[4].AND.x[3]>=y[3].AND.x[2]>=y[2].AND.x[6]>=y[6] }
to:
{ |x,y| x[4]+x[3]+x[2]+STR(x[6],15,2)>=y[4]+y[3]+y[2]+STR(y[6],15,2) }
solved the problem.
Why the first expresion which also returns .T. if the elements are in the proper positions, doesnt't work?
Changing the codeblock from:
{ |x,y| x[4]>=y[4].AND.x[3]>=y[3].AND.x[2]>=y[2].AND.x[6]>=y[6] }
to:
{ |x,y| x[4]+x[3]+x[2]+STR(x[6],15,2)>=y[4]+y[3]+y[2]+STR(y[6],15,2) } solved the problem.
Why the first expresion which also returns .T. if the elements are in the proper positions, doesnt't work?
Regards
Claudio H
TC|##|####|####|1,3| 0.00
TC|##|####|####|1,3,6| 100000.00
TC|##|####|1036|1,3,12| 0.00
TC|VI|STDR|####|1,6| 0.00
TC|##|####|####|1,3| 0.00
TC|##|####|####|1,3,6| 100000.00
TC|##|####|1036|1,3,12| 0.00
TC|VI|STDR|####|1,6| 0.00
TC|##|####|1036|1,3,12| 0.00
TC|VI|STDR|####|1,6| 0.00
TC|##|####|####|1,3,6| 100000.00
TC|##|####|####|1,3| 0.00
TC|##|####|####|1,3| 0.00
TC|##|####|####|1,3,6| 100000.00
TC|##|####|1036|1,3,12| 0.00
TC|VI|STDR|####|1,6| 0.00
Here a reduced self contained example and below the content of the log file generated.
TC|##|####|1036|1,3,12| 0.00
TC|VI|STDR|####|1,6| 0.00
TC|##|####|####|1,3,6| 100000.00
TC|##|####|####|1,3| 0.00
Enrico
This is the correct one:
sorted with { |x,y| x[4]+x[3]+x[2]+STR(x[6],15,2)>=y[4]+y[3]+y[2]+STR(y[6],15,2) }
TC|##|####|1036|1,3,12| 0.00
TC|VI|STDR|####|1,6| 0.00
TC|##|####|####|1,3,6| 100000.00
TC|##|####|####|1,3| 0.00
Here it is:
{ | x, y | x[ 4 ] > y[ 4 ] .OR. ( x[ 4 ] = y[ 4 ] .AND. x[ 3 ] > y[ 3 ]
) .OR. ( x[ 3 ] = y[ 3 ] .AND. x[ 2 ] > y[ 2 ] ) .OR. ( x[ 2 ] = y[ 2 ]
.AND. x[ 6 ] > y[ 6 ] ) }
Il 11/09/2023 21:12, Enrico Maria Giordano ha scritto:
Here it is:
{ | x, y | x[ 4 ] > y[ 4 ] .OR. ( x[ 4 ] = y[ 4 ] .AND. x[ 3 ] > y[ 3 ]Claudio, did you try it? Let me know if it works for you.
) .OR. ( x[ 3 ] = y[ 3 ] .AND. x[ 2 ] > y[ 2 ] ) .OR. ( x[ 2 ] = y[ 2 ] .AND. x[ 6 ] > y[ 6 ] ) }
--
Enrico Maria Giordano
http://www.emagsoftware.it
http://www.emagsoftware.it/emgmusic
http://www.emagsoftware.it/spectrum
http://www.emagsoftware.it/tbosg
Don't you think it is an error in the expression's evaluator inside the codeblock?
I used many complex expressions in my code inside codeblocks and I never tried to run a verification like this one (for sure I trusted the compiler in the way: "it SHOULD work" - but it is not the case).
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 546 |
Nodes: | 16 (2 / 14) |
Uptime: | 01:15:58 |
Calls: | 10,385 |
Calls today: | 2 |
Files: | 14,057 |
Messages: | 6,416,577 |