Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How To Know Parameter Passed By Reference?
Message
 
 
À
29/11/2005 14:02:01
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP
Network:
Windows 2003 Server
Database:
Visual FoxPro
Divers
Thread ID:
01072940
Message ID:
01072959
Vues:
26
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform