Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Boudewijn Lutgerink
  Where is Boudewijn Lutgerink?
 Hoonaardstraat, Driel
 Netherlands
 Boudewijn Lutgerink
 To: Jefferson Aguilar
  Where is Jefferson Aguilar?
 Cabanatuan
 Philippines
 Jefferson Aguilar
 Tags
Subject: RE: public variables
Thread ID: 95261 Message ID: 95299 # Views: 70 # Ratings: 1
Version: Visual FoxPro 9 Category: General VFP Topics
Date: Monday, May 08, 2006 12:52:43 PM         
   


> dear experts,
>
> how can i access public variables outside vfp?
>
> thanks.
> - jeff


besides what Eric already said youu can do the following as well.
Create a com+ server in VFP that starts some process, the result of this process could be the return value of that object. This can then be used in a totally different application.

like this:
**************************************************
*-- Class:        excelfuncs (d:\testdir\excelfuncs.vcx)
*-- ParentClass:  separator
*-- BaseClass:    separator
*-- Time Stamp:   05/08/06 12:47:14 PM
*
DEFINE CLASS excelfuncs AS separator OLEPUBLIC


	Height = 0
	Width = 0
	Name = "excelfuncs"


	PROCEDURE getorderamount
		LPARAMETERS tcOrdernumber
		LOCAL lnRetVal


		OPEN DATABASE HOME(2)+'data\testdata' SHARED

		USE orders SHARED

		SELECT order_amt ;
		  FROM orders ;
		 WHERE ALLTRIM(order_ID) == ALLTRIM(tcOrdernumber) ;
		  INTO CURSOR cOrder

		IF _tally>0
			lnRetVal = cOrder.order_amt
			USE IN SELECT("cOrder")
			USE IN SELECT("orders")
			CLOSE DATABASES
			RETURN lnRetVal
		ELSE
		   CLOSE DATABASES
			RETURN 0
		ENDIF
	ENDPROC


ENDDEFINE
*
*-- EndDefine: excelfuncs
**************************************************


build a DLL or exe with this class inside it.
Then create an object like
oExcel = CREATEOBJECT("testdllforexcel.excelfuncs")


Then you can call the function like oExcel.GetOrderAmount("10009")

The returned value is then the order amount form the table ( €1530.00)

Boudewijn Lutge®ink
My Blog is here


COMPLETE THREAD

public variables Posted by Jefferson Aguilar @ 5/8/2006 4:00:41 AM
RE: public variables Posted by Eric den Doop @ 5/8/2006 7:38:06 AM
RE: public variables Posted by Boudewijn Lutgerink @ 5/8/2006 12:52:43 PM
RE: public variables Posted by Jefferson Aguilar @ 5/10/2006 5:30:38 AM
RE: public variables Posted by Eric den Doop @ 5/10/2006 8:46:55 AM
RE: public variables Posted by Eduard @ 5/11/2006 12:55:42 PM
RE: public variables Posted by Boudewijn Lutgerink @ 5/11/2006 1:18:14 PM
RE: public variables Posted by Eduard @ 5/11/2006 1:49:08 PM