if use_arqex5("ARQAUD01","AUDITOR",,"DBFCDX","1") == .f.
AUD->( __DBpack() )
Ferase('IAUDIT01.CDX')
Index on descend(dtos(DATA)+HORA) tag TAG1 to IAUDIT01
AUDITOR->(Dbclosearea())
endif
pelo sistema reorganizo assim e não fica em ordem, mas no dbu32 sim!
segue em anexo o arquivo e o índice gerado por minha aplicação e o índice gerado pelo dbu32!
xharbour 1.2.3!
Se fosse Windows estariam falando muito mal disso.
Opção 1: Considere bug no Harbour, por manter compatibilidade com Clipper
Opção 2: Considere uso errado
Soluções:
a) use a cláusula DESCEND, NÃO a função Descend():
INDEX ON Dtos(DATA) + HORA DESCEND
Desta forma, nada precisa ser convertido
b) Crie uma função cpDescend() alternativa pra respeitar a codepage
Aonde a opção anterior não puder resolver
José M. C. Quintas
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2) "The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell" https://github.com/JoseQuintas/
José M. C. Quintas
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2) "The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell" https://github.com/JoseQuintas/
/*
<alias>->( OrdDescend( ,,.T. ) ) //<- DESCENDING
<alias>->( OrdDescend( ,,.F. ) ) //<- sem DESCENDING
*/
EXTERNAL DESCEND
FUNCTION Main()
FIELD LAST, First
USE Customer
INDEX ON Upper( Last + First ) TO Cust01
GO TOP
? LAST // result: Alberts
GO BOTTOM
? LAST // result: Waters
OrdDescend( , , .T. ) // change navigational order
SKIP - 1 // skipping backwards from the last
// record hits begin of file.
? Bof() // result: .T.
GO BOTTOM
? Eof() // result: .F.
? LAST // result: Alberts
SKIP
? Eof() // Result: .T.
GO TOP
? LAST // result: Waters
BROWSE()
USE
RETURN NIL
// ISTO NAO FUNCIONA EM XHARBOUR
/*
SET DESCENDING
Change the descending flag of the controlling order
Syntax
SET DESCENDING ON | OFF | (<lToggle>)
Arguments
ON enables the descending flag.
OFF disables the descending flag.
<lToggle> is a logical expression that must be enclosed in parentheses. A value of true (.T.) is the same as ON, and a value of false (.F.) is the same as OFF.
Note
The initial default of this setting depends on whether the controlling order was created with DESCENDING as an attribute.
Description
SET DESCENDING is functionally equivalent to ORDDESCEND(). Refer to this function for more information.
Examples
. The following example illustrates SET DESCENDING. every order
can be both ascending and descending:
USE Customer VIA "DBFCDX"
INDEX ON LastName TAG Last
INDEX ON FirstName TAG First DESCENDING
SET ORDER TO TAG Last
// last was originally created in ascending order
// Swap it to descending
SET DESCENDING ON
// Last will now be processed in descending order
SET ORDER TO TAG First
// First was originally created in descending order
// Swap it to ascending
SET DESCENDING OFF
// First will now be processed in ascending order
Sealso
ORDDESCEND()
*/
om dia, João na tela abaixo queria que a ordem do numero da proposta fosse alterada para decrescente, ou seja que na primeira tela fique sempre o ultimo cadastro feito.
OrdDescend( ,, .T. ) // indice em ordem crescente
OrdDescend( ,, .F. ) // indice em ordem decrescente
USE Customer VIA "DBFCDX"
INDEX ON LastName TAG Last
INDEX ON FirstName TAG First DESCENDING
SET ORDER TO TAG Last
// last was originally created in ascending order
// Swap it to descending
SET DESCENDING ON
// Last will now be processed in descending order
SET ORDER TO TAG First
// First was originally created in descending order
// Swap it to ascending
SET DESCENDING OFF
// First will now be processed in ascending order
USE o cliente VIA "DBFCDX"
INDEX ON LastName TAG Last
INDEX ON FirstName TAG First DESCENDING
SET ORDER TO TAG Último
// last foi originalmente criado em ordem crescente
// Troque para descendente
SET DESCENDING ON
// A última será processada agora em ordem descendente
SET ORDER TO TAG Primeiro
// Primeiro foi originalmente criado em ordem decrescente
// Troque para ascendente
SET DESCENDING OFF
// Primeiro será processado em ordem crescente