Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Not an Array Error 1st Time
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00261208
Message ID:
00261215
Vues:
21
>Using VFP6/SP3.
>In my form's init method, I create a 4x3 array and fill it with values. The array is used to populate a combobox (boundto=.f., rowsource = arFillCombo, rowsourcetype = 5 - array, all these were defined visually in the form designer).
>
>The first time the thing is run I get an error 'arFillCombo' is not an array. I click [OK] and the combobox is not populated. I click my form's [EXIT] button and I get the error 3 more times.
>
>If I run the form again, the combobox is populated and the form works fine. I can't seem to trap this error.
>
>Any suggestions?

Make the array a form property. Add it as a new property by specifying its name and a dimension.

MyArray[1]

The array can be redimensioned in the Init method if it needs to be changed.

DIMENSION thisform.MyArray[5]
thisform.MyArray[1] = "whatever"
thisform.MyArray[2] = ...
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform