Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Global variable

Status
Not open for further replies.

Nordlund

Programmer
Jul 17, 2001
458
SE
Hi there.
For a couple of years ago, I read about some kind global variable type. You could then access the value from another application.

Have you heard of it, please share :)




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-"There is always another way to solve it, but I prefer my way.
 
...This is one way to perhaps solve my problem.

The goal is to pass some vital info from my Delphi app to excel. The next step is to retrieve the vial info from Excel. ( But this is another question for another forum :) )

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-"There is always another way to solve it, but I prefer my way.
 

One way is simply to use one or two files.

With two files, Delphi writes to file A, Excel reads file A (using VBA, of course). Then when necessary, Excel writes to file B and Delphi reads file B.

You could start by Delphi deletes file B and then after writing file A, goes into a timer loop checking every few seconds for the existence of file B. After file B reappears, clear the timer and carry on.

 
hi

Maybe just an INI file will do the job too.
In one section, lets say DATA, keys could be the shared variable name and the data would be the value (text).
In an other Section, lets say TYPE, keys would be the same as in [data] and the data would be the data type.

ex :

[DATA]
var1=86
var2=hello
[TYPE]
var1=integer
var2=string

this would only work for single data type (no class or other stuff like files etc).

maybe (really not sure) u could just store the adress and reload it (the data at that adress) in the 2sd app.. but i think the adress would be reserved for only 1 appz.. if its possible this should work for any data type known by the 2 app and having the same struct.

hope this help
jb
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top