Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Array Scoping for Display
Message
De
01/07/2002 16:01:13
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Titre:
Array Scoping for Display
Divers
Thread ID:
00674117
Message ID:
00674117
Vues:
64
Hello,
Quick question, sorry if it's basic but, starting to learn.

I need to display two arrays in two list boxes on a form. Currently I am trying to use the following code inside of either the load or init event of the form, it doesn't seem to matter on use, neither way works.

m.temp=cgdrive+oform.cbssrchordno
IF DIRECTORY(temp)
IF FILE(temp+'seller')
DIMENSION aseller[10,1]
m.lcPath=cgdrive+oform.cbssrchordno+'seller'
FOR i=1 TO 10
aseller(i,1)=""
next
USE(m.lcPath)
COPY TO ARRAY aseller
ELSE
DIMENSION aseller[10,1]
FOR i=1 TO 10
aseller(i,1)=""
next
ENDIF
IF FILE(temp+'buyer')
DIMENSION abuyer[10,1]
m.lcPath=cgdrive+oform.cbssrchordno+'buyer'
FOR i=1 TO 10
abuyer(i,1)=""
next
USE(m.lcPath)
COPY TO ARRAY abuyer
ELSE
DIMENSION abuyer[10,1]
FOR i=1 TO 10
abuyer(i,1)=""
next
ENDIF
ELSE
MD &temp
DIMENSION aseller[10,1]
DIMENSION abuyer[10,1]
FOR i=1 TO 10
aseller(i,1)=""
next
FOR i=1 TO 10
abuyer(i,1)=""
next
ENDIF

After reaching the last ENDIF the arrays disappear. I know that the arrays would be scoped as private but, because they are in the form itself wouldn't it work? I can only get this to work if I declare the arrays public. Could someone explain this to me please?

Thank you,

Troy
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform