Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Grid content diont oprder correctly
Message
De
15/03/2024 09:09:03
Luis Santos
Biglevel-Soluções Informáticas, Lda
Portugal
 
 
À
15/03/2024 08:56:04
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Allemagne
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01687690
Message ID:
01687731
Vues:
21
Luis,

TAG / TAGNO

I dislike the mixture of TAG / TAGNO, and for me the TAGNO, is outdated XBASE from the days of yore. Just do all from a TAG perspective, this is well defined.

DESCENDING

Something is wrong here, the help states
DESCENDING([CDXFileName[, nIndexNumber [, nWorkArea | cTableAlias]]])

If I try on a table like
CREATE CURSOR curTest (i1 I)
INDEX ON i1 TAG _i1
?DESCENDING(_i1,'curTest')
SET ORDER TO _I1 descending
?DESCENDING(_i1,'curTest')
it fails on the first DESCENDING

So, if it runs for your code, i_nm must be a var or a field with a number.

I would rather do ("if .. else" swapped for faster expression and TAG generalized)
Select crMonitorFacturas
lcTag = "I_NM"
If Sys(22,SELECT("crMonitorFacturas")) == m.lcTag  && current index tag
	If Descending(TAGNO(m.lcTag),"crMonitorFacturas")
		Set Order To (m.lcTag) In crMonitorFacturas Ascending
	Else
		Set Order To (m.lcTag) In crMonitorFacturas Descending
	Endif
Else
	Set Order To (m.lcTag) In crMonitorFacturas
Endif
At least this switches for me.

Now you need this as a proc with the TAG as parameter and you are done for any TAG.

Lutz

Aunt Edit says:
Added SELECT() to SYS(22), so you have all commands with the alias/workarea fitting.

Hi Lutz,

Many thanks again for you help and support.

Best regards,
Luis
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform