help-octave
[Top][All Lists]
Advanced

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

Automatically generating usage and help strings for a function?


From: forkandwait
Subject: Automatically generating usage and help strings for a function?
Date: Mon, 14 Jun 2010 22:08:25 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

Hi all,

Is there a way to programmatically get 
the usage and help strings inside a function?

For example, I have the following code:

function [Lx tm bx]= varyLx(Lx, s, bx) 
  %%  [Lx tm bx] = varyLx(Lx, s, bx) 
  %%
  %%  returns Lx blah blah blah description
  
  if nargin < 1
        usage ("gmafc", "[Lx tm bx] = varyLx(Lx, s, bx)\n")
  endif

I type "[Lx tm bx] = varyLx(Lx, s, bx)" three times, 
but I would like to just type it once in the function 
definition, and then generate the same string
multiple times, whenever I want to remind the 
user what to do (like in  the above usage message).

Any ideas?  

I know there is fancy texinfo capabilities 
for the help section of a function, but they 
seem non-portable and somewhat complex, so 
I haven't bothered with them yet.  If I should, 
feel free to point me in that direction.

Thanks!



reply via email to

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