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

Re: accessing a procedure from other program by Josh

Josh
Thu Jun 14 16:09:40 CDT 2007

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" <xreed2000@yahoo.com> wrote:

>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
>


Re: accessing a procedure from other program by Stefan

Stefan
Thu Jun 14 16:15:02 CDT 2007


"Fanor" <xreed2000@yahoo.com> schrieb im Newsbeitrag
news:OZPtEUsrHHA.4800@TK2MSFTNGP03.phx.gbl...
> 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.

Does that happen when you're testing in the IDE or at runtime?
Does the debugger confirm the error message when you put expressions
like CurDir() and File('myfile') in the watch window?



hth
-Stefan



--
|\_/| ------ ProLib - programmers liberty -----------------
(.. ) Our MVPs and MCPs make the Fox run....
- / See us at www.prolib.de or www.AFPages.de
-----------------------------------------------------------


Re: accessing a procedure from other program by Fanor

Fanor
Fri Jun 15 10:45:49 CDT 2007

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" <XjoshX@jAssing.com> wrote in message
news:1ib3731rer1eleo39ph724cs7p392e0mjp@4ax.com...
> 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" <xreed2000@yahoo.com> wrote:
>
>>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
>>
>



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.&nbsp; Consider:
you could include two different copies of myproc.prg, each located in a
different, and each included with the project.&nbsp; How, then, would Fox
interpret:<br>
<pre wrap="">..........
set procedure to myprocs additive
..........
</pre>
?&nbsp; Which copy of myprocs.prg are you referring to?<br>
<br>
The answer is to specify the relative path to your files.&nbsp; 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>
&nbsp;- 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">&lt;XjoshX@jAssing.com&gt;</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">&lt;xreed2000@yahoo.com&gt;</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>

Re: accessing a procedure from other program by Dan

Dan
Fri Jun 15 12:27:17 CDT 2007

If it's in a directory other than the current directory, and you're running
outside a compiled app or exe, yes you'll need to include the path.

But don't worry about it. The project manager will resolve all that at
compile time.

Dan

Fanor wrote:
> 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" <XjoshX@jAssing.com> wrote in message
> news:1ib3731rer1eleo39ph724cs7p392e0mjp@4ax.com...
>> 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" <xreed2000@yahoo.com>
>> wrote:
>>> 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