Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
WITH This ... ENDWITH
Message
De
24/09/2007 10:03:25
 
 
À
24/09/2007 09:51:42
Jay Johengen
Altamahaw-Ossipee, Caroline du Nord, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 8 SP1
Divers
Thread ID:
01256274
Message ID:
01256280
Vues:
10
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform