HOWTO: Pass Data Between Different Versions of FoxProID: Q192957
|
With the rapid pace of advancements in software development tools, developers are increasingly confronted with issues related to legacy applications and exchanging data between applications. This article illustrates how to pass data between applications created with different versions of FoxPro.
At run-time, applications exist as separate and distinct processes
executing within their own memory space. Because these are separate
processes, attempts to pass variables directly between applications created
with different versions of FoxPro are likely to fail. Using shared tables
is generally the simplest and most efficient way to share data between two
processes.
Before running this code, use the SET DEFAULT TO command to ensure that
both versions of FoxPro point to the same folder.
PARAMETER lcharvalue
IF PARAMETERS()>0
? "The String Passed was "+ALLTRIM(lcharvalue)
ENDIF
"Object file test1.exe was compiled in a previous version of FoxPro"
*:* Begin Code
SET EXCLUSIVE OFF
IF !FILE('TESTTHIS.DBF')
IF ATC("Visual", VERSION())=0
CREATE TABLE testthis (datainfo C(20))
ELSE
CREATE CURSOR temp (datainfo C(20))
COPY TO testthis.DBF TYPE FOX2X
ENDIF
CLOSE ALL
ENDIF
IF !USED('TESTTHIS')
USE testthis
ELSE
SELECT testthis
ENDIF
fileval=RECCOUNT()
DO WHILE .T.
IF RECCOUNT('TESTTHIS')<>fileval ;
OR LASTKEY()=27
EXIT
ENDIF
ENDDO
IF RECCOUNT('TESTTHIS')<>fileval
GO BOTTOM
=TEST1(datainfo)
ENDIF
*:* ENDCODE Code
SET EXCLUSIVE OFF
"INSERT INTO TESTTHIS (datainfo) VALUES ('Hello World')"
Additional query words: kbDSupport kbDSE kbXBase kbVFp600 kbVFp500a kbVFp500 kbVFp300b kbVFp300
Keywords :
Version : MS-DOS:2.6a; WINDOWS:2.6a,3.0,3.0b,5.0,5.0a,6.0
Platform : MS-DOS WINDOWS
Issue type : kbhowto
Last Reviewed: August 9, 1999