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

If you like it as a general proc: (I'm procrastinating)
?Set_Order(cTag, cAlias)

PROCEDURE Set_Order
*call like Set_Order(cTag[, cAlias])
	LPARAMETERS;
		tcTag,;
		tcAlias

	LOCAL;
		lnOldSelect,;
		llReturn

	lnOldSelect = SELECT()

	IF EMPTY(m.tcAlias)
		tcAlias = ALIAS()
	ELSE
		Select (m.tcAlias)
	ENDIF

	IF !EMPTY(TAGNO(m.tcTag,CDX(1,m.tcAlias)))
*only if tag exists
		If Sys(22,SELECT(m.tcAlias)) == UPPER(m.lcTag)  && current index tag
			If Descending(TAGNO(m.tcTag,CDX(1,m.tcAlias)),m.tcAlias)
				Set Order To (m.tcTag) In (m.tcAlias) Ascending
			Else
				Set Order To (m.tcTag) In (m.tcAlias) Descending
			Endif
		Else
			Set Order To (m.tcTag) In (m.tcAlias)
		Endif
		llReturn = .T.
	Endif

	SELECT (m.lnOldSelect)

	RETURN m.llReturn
endproc
Words are given to man to enable him to conceal his true feelings.
Charles Maurice de Talleyrand-Périgord

Weeks of programming can save you hours of planning.

Off

There is no place like [::1]
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform