help-octave
[Top][All Lists]
Advanced

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

Re: Pass argument to script file


From: Ben Abbott
Subject: Re: Pass argument to script file
Date: Fri, 12 Jun 2015 13:53:06 -0400

> On Jun 12, 2015, at 9:33 AM, jbb4 <address@hidden> wrote:
> 
> Hi, thanks for answering, i've read the manual about argv() but i cannot get
> it work.
> For example:
> 
> source file.m --name --age
> 
> or
> 
> source --name --age file.m 
> 
> And doing that reports and error. The problem is i want to pass arguments
> like to a function. Is it possible?
> 
> Regards

A script will recognize all variable which you have previously defined.

If you set …

        name = “John Boy”;
        age = 23;

and then run file.m, the script can use “name” and “age” just as if you were 
tying the commands yourself.

Ben


reply via email to

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