Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Mdot question
Message
De
07/04/2021 16:02:37
 
 
À
07/04/2021 15:32:27
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Allemagne
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
01679493
Message ID:
01679657
Vues:
49
>>Other than that this is right from the help in VFP6
>>
>>"To reference a property in an object that has the same name as an open table, preface the property name with the M. qualifier. For example:
>>
>>USE customer
>>SCATTER NAME customer
>>
>>? customer.company && Returns the table value
>>? M.customer.company && Returns the object property value"
>
>That's not the problem. It will fail if you have an object (variable) like the alias and no property is named like a field. Different, but it will fail. This is understood.
>
>It goes explicit for properties that are arrays and noted with braces or brackets. Or, for the braces, methods but this is the same notation. Properties or not the problem its only about stuff ending in ( or [. The notation with braces and brackets changes the way VFP looks stuff up. At least with non property array vs field

On the aside, one of the things that makes me cringe is when I see parenthesis rather than square bracket used when accessing an array element. Not only could it be ambiguous to a human reading the code, but I'd seen at least one situation where the *same* line of code could get interpreted as an array reference or a function - depending on the context at the time when that line of code was run.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform