Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

War isn't a good life, but it's life. -- Kirk, "A Private Little War", stardate 4211.8


devel / comp.lang.xharbour / Re: ASORT not sorting

SubjectAuthor
* ASORT not sortingClaudio H
`* Re: ASORT not sortingClaudio H
 +- Re: ASORT not sortingEnrico Maria Giordano
 `* Re: ASORT not sortingElla Stern
  `* Re: ASORT not sortingClaudio H
   `* Re: ASORT not sortingEnrico Maria Giordano
    `* Re: ASORT not sortingClaudio H
     `* Re: ASORT not sortingEnrico Maria Giordano
      `* Re: ASORT not sortingEnrico Maria Giordano
       `* Re: ASORT not sortingCV
        `- Re: ASORT not sortingEnrico Maria Giordano

1
ASORT not sorting

<8782b5fa-8171-444d-a4ae-6ae0284156dbn@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=17718&group=comp.lang.xharbour#17718

  copy link   Newsgroups: comp.lang.xharbour
X-Received: by 2002:a0c:e648:0:b0:646:eace:a17d with SMTP id c8-20020a0ce648000000b00646eacea17dmr114158qvn.1.1694125585700;
Thu, 07 Sep 2023 15:26:25 -0700 (PDT)
X-Received: by 2002:a63:3dcc:0:b0:573:f863:1d17 with SMTP id
k195-20020a633dcc000000b00573f8631d17mr113926pga.6.1694125585133; Thu, 07 Sep
2023 15:26:25 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.xharbour
Date: Thu, 7 Sep 2023 15:26:24 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=181.47.6.188; posting-account=aFBEXgoAAAB4yn7v61tkTYKSn_hA4pNO
NNTP-Posting-Host: 181.47.6.188
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <8782b5fa-8171-444d-a4ae-6ae0284156dbn@googlegroups.com>
Subject: ASORT not sorting
From: cherszage@gmail.com (Claudio H)
Injection-Date: Thu, 07 Sep 2023 22:26:25 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2129
 by: Claudio H - Thu, 7 Sep 2023 22:26 UTC

Hi
I have a multidimensional array (4 rows, 6 elements each, 5 string and a numeric value) and after ASORTing it I still have all the elements in the same positions and can't find the reason.

Array aDatos BEFORE sorting (the pipe separator was just for logging):
1-> TC|##|####|####|1,3| 0.00
2-> TC|##|####|####|1,3,6| 100000.00
3-> TC|##|####|1036|1,3,12| 0.00
4-> TC|VI|STDR|####|1,6| 0.00

azz:=ASORT(aDatos,,,{ |x,y| x[4]>y[4].AND.x[3]>y[3].AND.x[2]>y[2].AND.x[6]>y[6] })

Array aDatos AFTER sorting:
1-> TC|##|####|####|1,3| 0.00
2-> TC|##|####|####|1,3,6| 100000.00
3-> TC|##|####|1036|1,3,12| 0.00
4-> TC|VI|STDR|####|1,6| 0.00

Array azz AFTER sorting (just checking if returned array is different):
1-> TC|##|####|####|1,3| 0.00
2-> TC|##|####|####|1,3,6| 100000.00
3-> TC|##|####|1036|1,3,12| 0.00
4-> TC|VI|STDR|####|1,6| 0.00

Array as EXPECTED after sorting:
1-> TC|##|####|1036|1,3,12| 0.00
2-> TC|VI|STDR|####|1,6| 0.00
3-> TC|##|####|####|1,3,6| 100000.00
4-> TC|##|####|####|1,3| 0.00

Any clue?
Regards
Claudio H

Re: ASORT not sorting

<08ab99bf-4b2f-40af-93ab-4f1e745977can@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=17719&group=comp.lang.xharbour#17719

  copy link   Newsgroups: comp.lang.xharbour
X-Received: by 2002:a05:6214:aa3:b0:640:5bf2:f7d1 with SMTP id ew3-20020a0562140aa300b006405bf2f7d1mr15425qvb.1.1694127266715;
Thu, 07 Sep 2023 15:54:26 -0700 (PDT)
X-Received: by 2002:a17:902:e750:b0:1bc:1866:fd0f with SMTP id
p16-20020a170902e75000b001bc1866fd0fmr338025plf.9.1694127265955; Thu, 07 Sep
2023 15:54:25 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.xharbour
Date: Thu, 7 Sep 2023 15:54:25 -0700 (PDT)
In-Reply-To: <8782b5fa-8171-444d-a4ae-6ae0284156dbn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=181.47.6.188; posting-account=aFBEXgoAAAB4yn7v61tkTYKSn_hA4pNO
NNTP-Posting-Host: 181.47.6.188
References: <8782b5fa-8171-444d-a4ae-6ae0284156dbn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <08ab99bf-4b2f-40af-93ab-4f1e745977can@googlegroups.com>
Subject: Re: ASORT not sorting
From: cherszage@gmail.com (Claudio H)
Injection-Date: Thu, 07 Sep 2023 22:54:26 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1434
 by: Claudio H - Thu, 7 Sep 2023 22:54 UTC

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

Re: ASORT not sorting

<udejrr$3cial$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=17720&group=comp.lang.xharbour#17720

  copy link   Newsgroups: comp.lang.xharbour
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: e.m.giordano@emagsoftware.it (Enrico Maria Giordano)
Newsgroups: comp.lang.xharbour
Subject: Re: ASORT not sorting
Date: Fri, 8 Sep 2023 09:52:28 +0200
Organization: A noiseless patient Spider
Lines: 22
Message-ID: <udejrr$3cial$1@dont-email.me>
References: <8782b5fa-8171-444d-a4ae-6ae0284156dbn@googlegroups.com>
<08ab99bf-4b2f-40af-93ab-4f1e745977can@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 8 Sep 2023 07:52:27 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="c34a33d1976185bc1359d2c8c2f82f2f";
logging-data="3557717"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+a11nHsBFkq6ONVYoov0ZB"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:jiG5NizH2oOK+0yP0rq8pzUxheA=
In-Reply-To: <08ab99bf-4b2f-40af-93ab-4f1e745977can@googlegroups.com>
Content-Language: it
 by: Enrico Maria Giordan - Fri, 8 Sep 2023 07:52 UTC

Il 08/09/2023 00:54, Claudio H ha scritto:

> 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?

Please write here a reduced example showing the problem.

--
Enrico Maria Giordano

http://www.emagsoftware.it
http://www.emagsoftware.it/emgmusic
http://www.emagsoftware.it/spectrum
http://www.emagsoftware.it/tbosg

Re: ASORT not sorting

<2127072a-6d4d-4df1-8f6d-e0a6859488can@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=17722&group=comp.lang.xharbour#17722

  copy link   Newsgroups: comp.lang.xharbour
X-Received: by 2002:ac8:6c3:0:b0:411:fc62:8592 with SMTP id j3-20020ac806c3000000b00411fc628592mr170444qth.4.1694200285178;
Fri, 08 Sep 2023 12:11:25 -0700 (PDT)
X-Received: by 2002:a63:724e:0:b0:573:ff6d:d463 with SMTP id
c14-20020a63724e000000b00573ff6dd463mr604024pgn.8.1694200284882; Fri, 08 Sep
2023 12:11:24 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.xharbour
Date: Fri, 8 Sep 2023 12:11:24 -0700 (PDT)
In-Reply-To: <08ab99bf-4b2f-40af-93ab-4f1e745977can@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=82.78.49.114; posting-account=H3ofRwoAAADbRxQ3Wi989fFKCMQ4Av_J
NNTP-Posting-Host: 82.78.49.114
References: <8782b5fa-8171-444d-a4ae-6ae0284156dbn@googlegroups.com> <08ab99bf-4b2f-40af-93ab-4f1e745977can@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <2127072a-6d4d-4df1-8f6d-e0a6859488can@googlegroups.com>
Subject: Re: ASORT not sorting
From: ellailona@gmail.com (Ella Stern)
Injection-Date: Fri, 08 Sep 2023 19:11:25 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 1944
 by: Ella Stern - Fri, 8 Sep 2023 19:11 UTC

On Friday, September 8, 2023 at 1:54:27 AM UTC+3, Claudio H wrote:
> 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

What if you set the order of operations?

{ |x,y| (x[4]>=y[4]).AND.(x[3]>=y[3]).AND.(x[2]>=y[2]).AND.(x[6]>=y[6]) }

I don't have the docs at hand, but here is the theory (scroll down for the table)
https://en.wikipedia.org/wiki/Order_of_operations

Re: ASORT not sorting

<59139f98-0c78-49ef-8475-7119c429e754n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=17723&group=comp.lang.xharbour#17723

  copy link   Newsgroups: comp.lang.xharbour
X-Received: by 2002:a05:620a:628d:b0:770:7460:c3f6 with SMTP id ov13-20020a05620a628d00b007707460c3f6mr65453qkn.6.1694210572215;
Fri, 08 Sep 2023 15:02:52 -0700 (PDT)
X-Received: by 2002:a17:902:c950:b0:1c2:b50:c91d with SMTP id
i16-20020a170902c95000b001c20b50c91dmr1478228pla.10.1694210571998; Fri, 08
Sep 2023 15:02:51 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.xharbour
Date: Fri, 8 Sep 2023 15:02:51 -0700 (PDT)
In-Reply-To: <2127072a-6d4d-4df1-8f6d-e0a6859488can@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=181.47.6.188; posting-account=aFBEXgoAAAB4yn7v61tkTYKSn_hA4pNO
NNTP-Posting-Host: 181.47.6.188
References: <8782b5fa-8171-444d-a4ae-6ae0284156dbn@googlegroups.com>
<08ab99bf-4b2f-40af-93ab-4f1e745977can@googlegroups.com> <2127072a-6d4d-4df1-8f6d-e0a6859488can@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <59139f98-0c78-49ef-8475-7119c429e754n@googlegroups.com>
Subject: Re: ASORT not sorting
From: cherszage@gmail.com (Claudio H)
Injection-Date: Fri, 08 Sep 2023 22:02:52 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 4696
 by: Claudio H - Fri, 8 Sep 2023 22:02 UTC

Hi Ella

Leaving ASORT aside, within a simple IF/ENDIF structure the precedence of the operations involved would not require grouping with ()s like in
IF a>b .AND. x==0

Anyway I tested your suggestion but didn't solve the issue.

Here a reduced self contained example and below the content of the log file generated.

FUNCTION Main ()

LOCAL aDatos, aCopia
LOCAL nHandle, n

aDatos:=ARRAY(0)
AADD(aDatos,{"TC","##","####","####","1,3",0.00})
AADD(aDatos,{"TC","##","####","####","1,3,6",100000.00})
AADD(aDatos,{"TC","##","####","1036","1,3,12",0.00})
AADD(aDatos,{"TC","VI","STDR","####","1,6",0.00})

aCopia:=ACLONE(aDatos)

nHandle:=HB_FCreate("ASORT.LOG")

FWRITE(nHandle,"original array"+CHR(13)+CHR(10))
FOR n:=1 TO LEN(aDatos)
FWRITE(nHandle,STR(n,2)+"-> "+aDatos[n][1]+"|"+aDatos[n][2]+"|"+aDatos[n][3]+"|"+aDatos[n][4]+"|"+aDatos[n][5]+"|"+STR(aDatos[n][6],15,2)+CHR(13)+CHR(10))
NEXT n
FWRITE(nHandle,""+CHR(13)+CHR(10))

ASORT(aDatos,,,{ |x,y| x[4]>y[4].AND.x[3]>y[3].AND.x[2]>y[2].AND.x[6]>y[6] })

FWRITE(nHandle,"sorted with { |x,y| x[4]>y[4].AND.x[3]>y[3].AND.x[2]>y[2].AND.x[6]>y[6] }"+CHR(13)+CHR(10))
FOR n:=1 TO LEN(aDatos)
FWRITE(nHandle,STR(n,2)+"-> "+aDatos[n][1]+"|"+aDatos[n][2]+"|"+aDatos[n][3]+"|"+aDatos[n][4]+"|"+aDatos[n][5]+"|"+STR(aDatos[n][6],15,2)+CHR(13)+CHR(10))
NEXT n
FWRITE(nHandle,""+CHR(13)+CHR(10))

aDatos:=ACLONE(aCopia)
ASORT(aDatos,,,{ |x,y| x[4]+x[3]+x[2]+STR(x[6],15,2)>=y[4]+y[3]+y[2]+STR(y[6],15,2) })

FWRITE(nHandle,"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) }"+CHR(13)+CHR(10))
FOR n:=1 TO LEN(aDatos)
FWRITE(nHandle,STR(n,2)+"-> "+aDatos[n][1]+"|"+aDatos[n][2]+"|"+aDatos[n][3]+"|"+aDatos[n][4]+"|"+aDatos[n][5]+"|"+STR(aDatos[n][6],15,2)+CHR(13)+CHR(10))
NEXT n
FWRITE(nHandle,""+CHR(13)+CHR(10))

aDatos:=ACLONE(aCopia)
ASORT(aDatos,,,{ |x,y| (x[4]>y[4]).AND.(x[3]>y[3]).AND.(x[2]>y[2]).AND.(x[6]>y[6]) })

FWRITE(nHandle,"sorted with { |x,y| (x[4]>y[4]).AND.(x[3]>y[3]).AND.(x[2]>y[2]).AND.(x[6]>y[6]) } [Ella's suggestion]"+CHR(13)+CHR(10))
FOR n:=1 TO LEN(aDatos)
FWRITE(nHandle,STR(n,2)+"-> "+aDatos[n][1]+"|"+aDatos[n][2]+"|"+aDatos[n][3]+"|"+aDatos[n][4]+"|"+aDatos[n][5]+"|"+STR(aDatos[n][6],15,2)+CHR(13)+CHR(10))
NEXT n

FCLOSE(nHandle)
quit

//--------------------------------------------------------------------

original array
1-> TC|##|####|####|1,3| 0.00
2-> TC|##|####|####|1,3,6| 100000.00
3-> TC|##|####|1036|1,3,12| 0.00
4-> TC|VI|STDR|####|1,6| 0.00

sorted with { |x,y| x[4]>y[4].AND.x[3]>y[3].AND.x[2]>y[2].AND.x[6]>y[6] }
1-> TC|##|####|####|1,3| 0.00
2-> TC|##|####|####|1,3,6| 100000.00
3-> TC|##|####|1036|1,3,12| 0.00
4-> TC|VI|STDR|####|1,6| 0.00

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) }
1-> TC|##|####|1036|1,3,12| 0.00
2-> TC|VI|STDR|####|1,6| 0.00
3-> TC|##|####|####|1,3,6| 100000.00
4-> TC|##|####|####|1,3| 0.00

sorted with { |x,y| (x[4]>y[4]).AND.(x[3]>y[3]).AND.(x[2]>y[2]).AND.(x[6]>y[6]) } [Ella's suggestion]
1-> TC|##|####|####|1,3| 0.00
2-> TC|##|####|####|1,3,6| 100000.00
3-> TC|##|####|1036|1,3,12| 0.00
4-> TC|VI|STDR|####|1,6| 0.00

Re: ASORT not sorting

<udh81a$3vlba$2@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=17726&group=comp.lang.xharbour#17726

  copy link   Newsgroups: comp.lang.xharbour
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: e.m.giordano@emagsoftware.it (Enrico Maria Giordano)
Newsgroups: comp.lang.xharbour
Subject: Re: ASORT not sorting
Date: Sat, 9 Sep 2023 09:48:59 +0200
Organization: A noiseless patient Spider
Lines: 16
Message-ID: <udh81a$3vlba$2@dont-email.me>
References: <8782b5fa-8171-444d-a4ae-6ae0284156dbn@googlegroups.com>
<08ab99bf-4b2f-40af-93ab-4f1e745977can@googlegroups.com>
<2127072a-6d4d-4df1-8f6d-e0a6859488can@googlegroups.com>
<59139f98-0c78-49ef-8475-7119c429e754n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 9 Sep 2023 07:48:58 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="e7eee37d003b4f97f4e2e0168c9d3544";
logging-data="4183402"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/e+8n1jwMng+Sby/9MF9UX"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:llSPMcmp3ywL1N6Ygh3a0Mh1SGI=
Content-Language: it
In-Reply-To: <59139f98-0c78-49ef-8475-7119c429e754n@googlegroups.com>
 by: Enrico Maria Giordan - Sat, 9 Sep 2023 07:48 UTC

Il 09/09/2023 00:02, Claudio H ha scritto:

> Here a reduced self contained example and below the content of the log file generated.

Thank you. Can you show me what is the output you want, please?

--
Enrico Maria Giordano

http://www.emagsoftware.it
http://www.emagsoftware.it/emgmusic
http://www.emagsoftware.it/spectrum
http://www.emagsoftware.it/tbosg

Re: ASORT not sorting

<f82b8f3d-078d-4765-9937-215f7fa8f28dn@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=17755&group=comp.lang.xharbour#17755

  copy link   Newsgroups: comp.lang.xharbour
X-Received: by 2002:a05:620a:3888:b0:76f:cd2:5d10 with SMTP id qp8-20020a05620a388800b0076f0cd25d10mr1200qkn.5.1694448705973;
Mon, 11 Sep 2023 09:11:45 -0700 (PDT)
X-Received: by 2002:a63:3542:0:b0:564:8375:d238 with SMTP id
c63-20020a633542000000b005648375d238mr2137939pga.4.1694448705512; Mon, 11 Sep
2023 09:11:45 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.xharbour
Date: Mon, 11 Sep 2023 09:11:45 -0700 (PDT)
In-Reply-To: <udh81a$3vlba$2@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=181.47.6.188; posting-account=aFBEXgoAAAB4yn7v61tkTYKSn_hA4pNO
NNTP-Posting-Host: 181.47.6.188
References: <8782b5fa-8171-444d-a4ae-6ae0284156dbn@googlegroups.com>
<08ab99bf-4b2f-40af-93ab-4f1e745977can@googlegroups.com> <2127072a-6d4d-4df1-8f6d-e0a6859488can@googlegroups.com>
<59139f98-0c78-49ef-8475-7119c429e754n@googlegroups.com> <udh81a$3vlba$2@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <f82b8f3d-078d-4765-9937-215f7fa8f28dn@googlegroups.com>
Subject: Re: ASORT not sorting
From: cherszage@gmail.com (Claudio H)
Injection-Date: Mon, 11 Sep 2023 16:11:45 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1562
 by: Claudio H - Mon, 11 Sep 2023 16:11 UTC

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) }
1-> TC|##|####|1036|1,3,12| 0.00
2-> TC|VI|STDR|####|1,6| 0.00
3-> TC|##|####|####|1,3,6| 100000.00
4-> TC|##|####|####|1,3| 0.00

Thanks!
Claudio H

Re: ASORT not sorting

<udnoqr$15rkh$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=17757&group=comp.lang.xharbour#17757

  copy link   Newsgroups: comp.lang.xharbour
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: e.m.giordano@emagsoftware.it (Enrico Maria Giordano)
Newsgroups: comp.lang.xharbour
Subject: Re: ASORT not sorting
Date: Mon, 11 Sep 2023 21:12:28 +0200
Organization: A noiseless patient Spider
Lines: 28
Message-ID: <udnoqr$15rkh$1@dont-email.me>
References: <8782b5fa-8171-444d-a4ae-6ae0284156dbn@googlegroups.com>
<08ab99bf-4b2f-40af-93ab-4f1e745977can@googlegroups.com>
<2127072a-6d4d-4df1-8f6d-e0a6859488can@googlegroups.com>
<59139f98-0c78-49ef-8475-7119c429e754n@googlegroups.com>
<udh81a$3vlba$2@dont-email.me>
<f82b8f3d-078d-4765-9937-215f7fa8f28dn@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 11 Sep 2023 19:12:28 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="ee2cbc85694f630367924d0c9d89326a";
logging-data="1240721"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18O48K/c0OXKa/7WHtcP9a5"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:eK0ZQP17ntSnkTbDb6gm7zQnab4=
Content-Language: it
In-Reply-To: <f82b8f3d-078d-4765-9937-215f7fa8f28dn@googlegroups.com>
 by: Enrico Maria Giordan - Mon, 11 Sep 2023 19:12 UTC

Il 11/09/2023 18:11, Claudio H ha scritto:

> 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) }
> 1-> TC|##|####|1036|1,3,12| 0.00
> 2-> TC|VI|STDR|####|1,6| 0.00
> 3-> TC|##|####|####|1,3,6| 100000.00
> 4-> 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 ] ) }

--
Enrico Maria Giordano

http://www.emagsoftware.it
http://www.emagsoftware.it/emgmusic
http://www.emagsoftware.it/spectrum
http://www.emagsoftware.it/tbosg

Re: ASORT not sorting

<udut0c$2k4n7$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=17805&group=comp.lang.xharbour#17805

  copy link   Newsgroups: comp.lang.xharbour
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: e.m.giordano@emagsoftware.it (Enrico Maria Giordano)
Newsgroups: comp.lang.xharbour
Subject: Re: ASORT not sorting
Date: Thu, 14 Sep 2023 14:06:37 +0200
Organization: A noiseless patient Spider
Lines: 20
Message-ID: <udut0c$2k4n7$1@dont-email.me>
References: <8782b5fa-8171-444d-a4ae-6ae0284156dbn@googlegroups.com>
<08ab99bf-4b2f-40af-93ab-4f1e745977can@googlegroups.com>
<2127072a-6d4d-4df1-8f6d-e0a6859488can@googlegroups.com>
<59139f98-0c78-49ef-8475-7119c429e754n@googlegroups.com>
<udh81a$3vlba$2@dont-email.me>
<f82b8f3d-078d-4765-9937-215f7fa8f28dn@googlegroups.com>
<udnoqr$15rkh$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 14 Sep 2023 12:06:36 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="baea2df14c2c1f199c5dd5c1fd7b3e42";
logging-data="2757351"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19BVNefYjW92yrxq5RlSuk0"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:sMYADyxGO7LGf/wwRegXfT8qzzQ=
In-Reply-To: <udnoqr$15rkh$1@dont-email.me>
Content-Language: it
 by: Enrico Maria Giordan - Thu, 14 Sep 2023 12:06 UTC

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 ]
> ) .OR. ( x[ 3 ] = y[ 3 ] .AND. x[ 2 ] > y[ 2 ] ) .OR. ( x[ 2 ] = y[ 2 ]
> .AND. x[ 6 ] > y[ 6 ] ) }

Claudio, did you try it? Let me know if it works for you.

--
Enrico Maria Giordano

http://www.emagsoftware.it
http://www.emagsoftware.it/emgmusic
http://www.emagsoftware.it/spectrum
http://www.emagsoftware.it/tbosg

Re: ASORT not sorting

<26d1366c-81b2-4ee9-b93f-c1f79c999623n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=17818&group=comp.lang.xharbour#17818

  copy link   Newsgroups: comp.lang.xharbour
X-Received: by 2002:a05:6214:a0e:b0:655:d387:cbd8 with SMTP id dw14-20020a0562140a0e00b00655d387cbd8mr135671qvb.3.1694717209973;
Thu, 14 Sep 2023 11:46:49 -0700 (PDT)
X-Received: by 2002:a05:6871:6ba3:b0:1d5:98bd:ef3e with SMTP id
zh35-20020a0568716ba300b001d598bdef3emr2061636oab.0.1694717209676; Thu, 14
Sep 2023 11:46:49 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.xharbour
Date: Thu, 14 Sep 2023 11:46:49 -0700 (PDT)
In-Reply-To: <udut0c$2k4n7$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=181.165.243.127; posting-account=PzJOtwoAAAB-nLPGTsEPjzvj-I7nsyBK
NNTP-Posting-Host: 181.165.243.127
References: <8782b5fa-8171-444d-a4ae-6ae0284156dbn@googlegroups.com>
<08ab99bf-4b2f-40af-93ab-4f1e745977can@googlegroups.com> <2127072a-6d4d-4df1-8f6d-e0a6859488can@googlegroups.com>
<59139f98-0c78-49ef-8475-7119c429e754n@googlegroups.com> <udh81a$3vlba$2@dont-email.me>
<f82b8f3d-078d-4765-9937-215f7fa8f28dn@googlegroups.com> <udnoqr$15rkh$1@dont-email.me>
<udut0c$2k4n7$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <26d1366c-81b2-4ee9-b93f-c1f79c999623n@googlegroups.com>
Subject: Re: ASORT not sorting
From: cvoskian@gmail.com (CV)
Injection-Date: Thu, 14 Sep 2023 18:46:49 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 2575
 by: CV - Thu, 14 Sep 2023 18:46 UTC

El jueves, 14 de septiembre de 2023 a la(s) 09:06:39 UTC-3, Enrico Maria Giordano escribió:
> 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 ]
> > ) .OR. ( x[ 3 ] = y[ 3 ] .AND. x[ 2 ] > y[ 2 ] ) .OR. ( x[ 2 ] = y[ 2 ]
> > .AND. x[ 6 ] > y[ 6 ] ) }
> Claudio, did you try it? Let me know if it works for you.
> --
> Enrico Maria Giordano
>
> http://www.emagsoftware.it
> http://www.emagsoftware.it/emgmusic
> http://www.emagsoftware.it/spectrum
> http://www.emagsoftware.it/tbosg

Hi Enrico

I tested the snippet with your solution, and it works fine, but... it is noisy.

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).

Regards
--
Claudio Voskian
Buenos Aires - Argentina

Re: ASORT not sorting

<udvvte$2q66m$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=17821&group=comp.lang.xharbour#17821

  copy link   Newsgroups: comp.lang.xharbour
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: e.m.giordano@emagsoftware.it (Enrico Maria Giordano)
Newsgroups: comp.lang.xharbour
Subject: Re: ASORT not sorting
Date: Fri, 15 Sep 2023 00:02:21 +0200
Organization: A noiseless patient Spider
Lines: 26
Message-ID: <udvvte$2q66m$1@dont-email.me>
References: <8782b5fa-8171-444d-a4ae-6ae0284156dbn@googlegroups.com>
<08ab99bf-4b2f-40af-93ab-4f1e745977can@googlegroups.com>
<2127072a-6d4d-4df1-8f6d-e0a6859488can@googlegroups.com>
<59139f98-0c78-49ef-8475-7119c429e754n@googlegroups.com>
<udh81a$3vlba$2@dont-email.me>
<f82b8f3d-078d-4765-9937-215f7fa8f28dn@googlegroups.com>
<udnoqr$15rkh$1@dont-email.me> <udut0c$2k4n7$1@dont-email.me>
<26d1366c-81b2-4ee9-b93f-c1f79c999623n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 14 Sep 2023 22:02:22 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="eb5d691163344de5c7ab0c2dc93bba09";
logging-data="2955478"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/j0Ftz0+yYPMN/13Q8bU4c"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:E1cs9UyMjVtksJ3PxMi1MLdL3LU=
Content-Language: it
In-Reply-To: <26d1366c-81b2-4ee9-b93f-c1f79c999623n@googlegroups.com>
 by: Enrico Maria Giordan - Thu, 14 Sep 2023 22:02 UTC

Il 14/09/2023 20:46, CV ha scritto:

> Don't you think it is an error in the expression's evaluator inside the codeblock?

No, I don't think so.

> 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).

Are you referring to this codeblock?

{ | x, y | x[ 4 ] > y[ 4 ] .AND. x[ 3 ] > y[ 3 ] .AND. x[ 2 ] > y[ 2 ]
..AND. x[ 6 ] > y[ 6 ] }

If yes, it is just wrong. Please examine the expression carefully and
you'll see yourself the problem.

--
Enrico Maria Giordano

http://www.emagsoftware.it
http://www.emagsoftware.it/emgmusic
http://www.emagsoftware.it/spectrum
http://www.emagsoftware.it/tbosg

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor