Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Do .. with... endwith
Message
De
30/06/1998 12:43:44
 
 
À
30/06/1998 11:23:48
Koos Veel
Gamma Research
Aruba
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00112459
Message ID:
00112990
Vues:
20
>I have read it several time's, but for me it is not totally clear what
>with..endwith does. Maybee you can give me a small example in which I
>can see the meaning of with..endwith.
>

WITH ... ENDWITH example

WITH this.really.long.object.reference
.name = 'ABC'
.left = 10
.top = 10
.visible = .t.
ENDWITH


The object "this.really.long.object.reference" has properties (.name, .left,.top,.visible) and can be referenced without specifying the entire object reference for each property. WITH/ENDWITH can be nested, too.

WITH object.outer.reference
.name = 'outer' && same as "object.outer.reference.name"
WITH otherobject.ref
.name = 'inner' && same as "otherobject.ref.name"
&& other 'inner' object references can go here
ENDWITH
.left = 100 && other 'outer' references can go here
ENDWITH

I hope the last part did not confuse you more than it helped.

WITH/ENDWITH is really just a shorthand method to eliminate some typing while you're coding.
Fred
Microsoft Visual FoxPro MVP

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

Click here to load this message in the networking platform