Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Create a Custom Class Programmatically?
Message
De
29/07/1999 03:22:00
 
 
À
29/07/1999 00:20:04
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00247522
Message ID:
00247545
Vues:
31
>Is there any way to use structured programming commands within a class definition?
>
>What I'd like to do is something like:
>
>********************
>LOCAL liPropertyCount, lcPropertyName
>
>DEFINE CLASS SARTest AS Custom
> FOR liPropertyCount = 1 TO 5 STEP 1
> lcPropertyName = "nProperty" + LTRIM(STR(liPropertyCount))
>
> &lcPropertyName = 0
>
> ENDFOR
>
>ENDDEFINE
>***********************
>
>but, of course, VFP5 complains on the FOR line.
>
>Any ideas, anyone?
Al,


Your code needs to be in a method - the INIT for example?

add the line

PROCEDURE Init

above the FOR line and,

ENDPROC

before the ENDDEFINE.

Also, your LOCAL declaration will also need to be within the PROCEDURE

HTH
regards

Ian
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform