Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Understanding _Access methods
Message
From
22/04/2008 10:39:44
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Understanding _Access methods
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01312365
Message ID:
01312365
Views:
56
Hi All,

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
Next
Reply
Map
View

Click here to load this message in the networking platform