help-octave
[Top][All Lists]
Advanced

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

Re: Placing Functions Inline to Script


From: Julien Bect
Subject: Re: Placing Functions Inline to Script
Date: Thu, 8 Jun 2017 17:18:29 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0

Le 08/06/2017 à 16:03, Fritz Sonnichsen a écrit :
%%%%%%%%%% script %%%%%%%%
maxpoint(3);

%%%%%%%% functions %%%%%%%
function maxpoint (p)
printf("point= %d",p);
endfunction

Hi Fritz,

I think that the function definition must appear before you use it. Like that:

1;  % this is a script ;-)

function maxpoint (p)
printf("point= %d",p);
endfunction

maxpoint(3);

HTH,
Julien



reply via email to

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