Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How To Know Parameter Passed By Reference?
Message
 
 
To
29/11/2005 14:02:01
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01072940
Message ID:
01072959
Views:
25
I do not know if you can. However, in the calling code, you can set the value of loOutlook to NULL. If your function is successfull, loOutlook will NOT be null so there would be no need to "return" anything from the function. Just changer your calling code to:
LOCAL loOutlook
loOutlook = NULL
IF NOT ISNULL(GetOutlookInstance(@loOutlook))
    * Proceed using Outlook instance.
ELSE
    * Outlook object could not be instantiated.
ENDIF

FUNCTION GetOutlookInstance
	* Attach to an instance of Outlook.
	* RETURNS:  TRUE if attachment successful, FALSE otherwise.
	LPARAMETERS poInstance
	LOCAL loInstance
	loInstance = NULL
	TRY
		* Try to attach to existing instance of Outlook
		loInstance = GETOBJECT(, "Outlook.Application")
	CATCH
		* Attaching to Outlook failed, so create new instance.
		loInstance = CREATEOBJECT("Outlook.Application")
	ENDTRY
	IF VARTYPE(loInstance) = "O"
		* We have a valid instance.
		poInstance = loInstance
	ENDIF
ENDFUNC
>Hey all,
>
>Kind of a theory question here... I want to know in a function whether or not a parameter has been passed by reference or value?
Mark McCasland
Midlothian, TX USA
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform