Descend function

77 views
Skip to first unread message

p_uc...@poczta.onet.pl

unread,
May 6, 2016, 4:13:44 PM5/6/16
to Harbour Users
Friends,

What is wrong in this code:

   aStr := {{'F1', 'C', 1, 0}}
   DbCreate('MEM:TEST', aStr,, .T., 'TEST')
   test->(OrdCreate('MEM:TEST', 'TEST', 'DESCEND(F1)', {|| DESCEND(F1)})) // with or without codeblock
   For i := 0 TO 9
       test->(DbAppend())
       test->f1 := AllTrim(Str(i))
   Next
   test->(DbGoTop())
   While !test->(Eof())
      ? f1, Asc(f1)
      test->(DbSkip())
   End

Result:
6         54 <-- ???
9         57
8         56
7         55
5         53
4         52
3         51
2         50
1         49
0         48

Thanks for reply
Pawel

descend.jpg

Paola Bruccoleri

unread,
May 6, 2016, 4:25:02 PM5/6/16
to harbou...@googlegroups.com
El 06/05/2016 a las 17:13, p_uc...@poczta.onet.pl escribió:
> Friends,
>
> What is wrong in this code:
>
> aStr := {{'F1', 'C', 1, 0}}
only sorted by the first character .. enlarges the size of the field
aStr := {{'F1', 'C', 2, 0}}
byeee

Message has been deleted

p_uc...@poczta.onet.pl

unread,
May 6, 2016, 4:33:30 PM5/6/16
to Harbour Users
Paola,
 
Field size := value size.
 
Thanks
Pawel
 
 

Klas Engwall

unread,
May 6, 2016, 4:45:26 PM5/6/16
to harbou...@googlegroups.com
Hi Pawel,
There is nothing wrong except that you forgot to post the beginning and
the end to make it self contained :-). Here is the result I get:

9 57
8 56
7 55
6 54
5 53
4 52
3 51
2 50
1 49
0 48

Regards,
Klas

Paola Bruccoleri

unread,
May 6, 2016, 5:44:40 PM5/6/16
to harbou...@googlegroups.com
El 06/05/2016 a las 17:33, p_uc...@poczta.onet.pl escribió:
> Paola,
> Field size := value size.
yes, i look this very fast! :)

JoséQuintas

unread,
May 6, 2016, 5:52:15 PM5/6/16
to harbou...@googlegroups.com
Codepage?

José M. C. Quintas
--
--
You received this message because you are subscribed to the Google
Groups "Harbour Users" group.
Unsubscribe: harbour-user...@googlegroups.com
Web: http://groups.google.com/group/harbour-users

---
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbour-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages