Re: accessing a procedure from other program by Rush
Rush
Fri Jun 15 11:15:36 CDT 2007
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Including myprocs.prg does not eliminate the need for paths. Consider:
you could include two different copies of myproc.prg, each located in a
different, and each included with the project. How, then, would Fox
interpret:<br>
<pre wrap="">..........
set procedure to myprocs additive
..........
</pre>
? Which copy of myprocs.prg are you referring to?<br>
<br>
The answer is to specify the relative path to your files. For example,
if you start from the c:\MyApp directory. you'd use:<br>
<pre wrap="">..........
set procedure to .\progs\myprocs additive
..........
</pre>
or simply:<br>
<pre wrap="">..........
set procedure to progs\myprocs additive
..........
</pre>
<br>
[It is also common practice to store a global reference to the app
startup directory somewhere, and then to code paths that are relative
that directory.] <br>
<br>
- Rush<br>
<br>
Fanor wrote:
<blockquote cite="mid:uRaYtN2rHHA.4664@TK2MSFTNGP04.phx.gbl" type="cite">
<pre wrap="">the code is
..........
set procedure to myprocs additive
..........
Which works in one aplication and doesn't work in another one. BUt it works
if I change to
..........
set procedure to c:\myapp\progs\myprocs additive
..........
Remember that myprocs.prg is included in the project.
"Josh Assing" <a class="moz-txt-link-rfc2396E" href="mailto:XjoshX@jAssing.com"><XjoshX@jAssing.com></a> wrote in message
<a class="moz-txt-link-freetext" href="news:1ib3731rer1eleo39ph724cs7p392e0mjp@4ax.com">news:1ib3731rer1eleo39ph724cs7p392e0mjp@4ax.com</a>...
</pre>
<blockquote type="cite">
<pre wrap="">can you post an example for us?
it should work; unless myfile really doesn't work
You can also
do myproc in myfile
On Thu, 14 Jun 2007 16:51:52 -0400, "Fanor" <a class="moz-txt-link-rfc2396E" href="mailto:xreed2000@yahoo.com"><xreed2000@yahoo.com></a> wrote:
</pre>
<blockquote type="cite">
<pre wrap="">Hi all,
I have a procedure in a program file with is in the same project. I want
to
call that procedure from an clock event.
my program is myfile.prg
and the procedure is myproc()
the code in the event look like
..................
set procedure to myfile additive
=myproc()
.....
It doesn't work and the mesage error says that myfile doesn't exist.
TIA
</pre>
</blockquote>
</blockquote>
<pre wrap=""><!---->
</pre>
</blockquote>
</body>
</html>