> dear experts,
>
> how can i access public variables outside vfp?
>
> thanks.
> - jeffbesides 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