That is correct Brett.  The file1 is derived from a fe solution and
contains new data.  The file1 contains over a 500 statements that
assign data to variables used by file2... Imagine having to write down
all these fscanf() statements, its not practical...  When I use
#include "file1" within the file2 program (which actually works within
the body of the program provided that file1 contains valid
C-statetments and that all vars are declared), the changes in file1
are not taken, and it will only keep using the original info from the
first execution, which makes sense now that I think about it.  Anyway,
I need to find a way to do this with a dynamically changing file1 like
u said.  I found an equivalent to what I want to in python script
where u simply write execfile(file1).  I thought C would have this
feature too.    
 
Thanks for ur help.  
/Mongi M 




--- In [email protected], "Brett W. McCoy" <[EMAIL PROTECTED]> wrote:
>
> On 2/21/07, Mongi <[EMAIL PROTECTED]> wrote:
> 
> > Hi Nico, Thanks very much for taking the time to reply.  The info in
> > file1 (where the data assignments are) is actually created by another
> > program and it is changing during the solution (while running the
> > overall prgm).  I tried using #include, it works only for constant
> > file (ie, file1 may not be changed if u use include even in the middle
> > of the code). I dont know if #define will work either.  The statements
> > in file1 are too many and this why I am looking for a more convenient
> > way to include it or execute the c-statements without having to insert
> > them into the calling prgm...
> 
> Are you saying you want to execute dynamically generated C statements
> (as source code) from an external file in a running program?
> 
> -- Brett
> ------------------------------------------------------------
> "In the rhythm of music a secret is hidden;
>     If I were to divulge it, it would overturn the world."
>                -- Jelaleddin Rumi
>


Reply via email to