help-octave
[Top][All Lists]
Advanced

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

Re: Scripts within functions


From: James Sherman Jr.
Subject: Re: Scripts within functions
Date: Mon, 10 Oct 2011 10:26:09 -0400

On Mon, Oct 10, 2011 at 9:45 AM, José Vallet <address@hidden> wrote:
Hello.

Is it possible to define and use scripts within functions?

I'd like to move some blocks of code (scripts) to the end of the file and then call the scripts in different parts of the function. The purpose is simply for cleanness of the code.

I know that I can define functions inside functions. That is not what I want, as in this particular case the list of input and output arguments would get too complicated.

BR
Jose

Hi,

I know (and this may be stating the obvious), but you can certainly call scripts within functions.  You could move the code you want in your script to another file to make a script, and then call it from your function.

Your experience may differ, but I find that when I have a long list of inputs/outputs, putting them into a structure makes my code much easier to read.


reply via email to

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