Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VFP 8: Got questions? Got answers.
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00707667
Message ID:
00708391
Vues:
12
>Hi John
>
>Do you know if private data sessions now remember to maintain the ascending/descending order of index tags. Previous version do not so forms with private data sessions can have the ascending/decending order changed by forms in another data session.

This looks like it has been addressed. Here is code. In VFP7 and prior, order is descending in both datasessions. In my testing, order is Ascending in Form1 in VFP8.

#define TABNAME 'testtab1'

CLEAR
CLOSE DATABASES ALL

DELETE FILE TABNAME+'.dbf'
DELETE FILE TABNAME+'.cdx'
CREATE TABLE TABNAME (F1 C(5), ;
F2 C(15))
INDEX ON f1 TAG f1

FOR lni = 1 TO 5
INSERT INTO TABNAME (f1) VALUES (ALLTRIM(STR(lni)))
ENDFOR

USE

PUBLIC oform1, oform2

oform1 = CREATEOBJECT('form1x')
oform1.Caption = '1st Form:'
oform1.show
oform2 = CREATEOBJECT('form1x')
oform2.Caption = '2nd Form:'
oform2.show
oform2.setorder('desc')
ACTIVATE SCREEN
?oform1.caption,oform1.getorder()
?oform2.caption,oform2.getorder()


DEFINE CLASS form1x AS form
datasession = 2
autocenter = .t.
PROCEDURE load
USE TABNAME SHARED order 1
ENDPROC

PROCEDURE setorder(tcAscOrDesc)
IF PARAMETERS() > 0
SET ORDER TO 1 &tcAscOrDesc
ENDIF
ENDPROC

PROCEDURE getorder()
RETURN IIF(DESCENDING(), 'Descending', 'Ascending')
ENDPROC

ENDDEFINE
Jim Saunders
Microsoft
This posting is provided “AS IS”, with no warranties, and confers no rights.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform