Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
WITH This ... ENDWITH
Message
From
24/09/2007 10:03:25
 
 
To
24/09/2007 09:51:42
Jay Johengen
Altamahaw-Ossipee, North Carolina, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8 SP1
Miscellaneous
Thread ID:
01256274
Message ID:
01256280
Views:
9
This message has been marked as the solution to the initial question of the thread.
>I want to use "WITH THIS.EventType" but how do I handle the CASE .EventType? >Something like .Value? Or can I not have an object.object this way?
>
> WITH THIS
> DO CASE
> CASE .EventType = 'A'
> .EventType.Code = 'S12'

The WITH - ENDWITH command/clause set is for referencing objects. In your example above, .EventType is both a property and an object, which cannot happen as you have above. You can have a custom property called EventType that can be assigned to both, but it cannot have it at the same time:
this.EventType = 'A'  && Somewhere in code...  Now a property with a char value
...
WITH this
  IF VARTYPE(.EventType) = "C"         && Check that char value is assigned
    DO CASE
      CASE .EventType = 'A'
         .EventType = oMyObjectRef     && Now assigned to an object value
         .EventType.Code = 'S12'
      CASE .EventType = 'B'    && etc.
    ENDCASE
  ELSE
  ENDIF
ENDWITH
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform