Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Do .. with... endwith
Message
From
30/06/1998 12:43:44
 
 
To
30/06/1998 11:23:48
Koos Veel
Gamma Research
Aruba
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00112459
Message ID:
00112990
Views:
19
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform