Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Understanding _Access methods
Message
De
22/04/2008 11:41:47
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Divers
Thread ID:
01312365
Message ID:
01312396
Vues:
10
Hi Sergey,

Thanks...I wondered if it should be "both" ways. Good to get a confirmation.

Albert

>It doesn't matter what actual value of the property is because it can only be accessed through _Access method. However for consistency I would keep it updated.
>
>
>* ioDocuments_Access()
>* 1 and 1/2 way:
>WITH THIS
>  IF NOT ISNULL(.ioServer)  && Word automation server open etc
>     STORE .ioServer.Documents TO .ioDocuments
>  ELSE
>     STORE .NULL. TO .ioDocuments
>  ENDIF
>ENDWITH
>RETURN This.ioDocuments
>
>
>>
>>Just coding my first _Access method as I found a use for it when using Word automation. Instead of trying to keep a property .ioDocuments up to date when creating a Word instance, I instead tried to use an .ioDocuments_Access() method.
>>
>>Question: am I supposed to set .ioDocuments within that code or am I supposed to return the reference from that method (or both); I read the "help" file but it did not make it clear.
>>
>>
>>
>>* ioDocuments_Access()
>>* first way:
>>
>>WITH THIS
>>
>>IF NOT ISNULL(.ioServer)  && Word automation server open etc
>>   STORE .ioServer.Documents TO .ioDocuments
>>ELSE
>>   STORE .NULL. TO .ioDocuments
>>ENDIF
>>
>>ENDWITH
>>
>>RETURN
>>
>>** second way, return the reference instead
>>
>>LOCAL loDocuments
>>
>>IF NOT ISNULL(.ioServer)
>>   STORE .ioServer.Documents TO loDocuments
>>ELSE
>>   STORE .NULL. to loDocuments
>>ENDIF
>>
>>ENDWITH
>>
>>RETURN (loDocuments)
>>
>>
>>
>>Albert
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform