help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: source-ing files vs. entering on cmd line?


From: Mario Storti
Subject: Re: source-ing files vs. entering on cmd line?
Date: Tue, 17 Nov 1998 17:39:02 -0300

I'm sorry. I didn't see the last comment of Dan. Please, discard my
post. Obviously my message was useless. 

Mario

> >>>>> On Tue, 17 Nov 1998 15:26:03 -0500 (EST), 
> >>>>>      Daniel Friedman <address@hidden> said:
> 
> > I am running Octave version 2.0.13.  Suppose I start Octave while in
> > directory 'foo', and I have a file in ./bar/mstuff.m I wish to run, 
> > to declare a bunch of special functions at the beginning of a particular
> > session.  Without adding the 'bar' directory to LOADPATH, since I need
> > the bar directory only once, is there a way to specify to octave where to
> > look for mstuff.m just one time?  If I could enter "bar/mstuff" on the
> > command line, that would be great, but this of course doesn't work.  Do
> > I have to change to the bar directory, run mstuff, and then change back
> > where I was?
> 
    vvvvvvvvvvvvvvvvvvvvvvvvvvvvv
> > I tried source("bar/mstuff"), and this executes without error, but the
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> > functions defined in mstuff are not remembered by Octave for later use. 
> 
> > Thanks,
> > --dan
> 
> Use the following,
> 
> octave> source("./bar/mstuff.m")
> 
> >From the Octave manual:
> 
> >  - Built-in Function:  source (FILE)
> >      Parse and execute the contents of FILE.  This is equivalent to
> >      executing commands from a script file, but without requiring the
> >      file to be named `FILE.m'.
> 
> Regards,
> 
> Mario



reply via email to

[Prev in Thread] Current Thread [Next in Thread]