Hi:
Thank you for your help. it worked. Below is an example of a recursive
process:
But i still have a question, how can i do to print inside the procedure
get_factorial without call the subroutine eplprint?. If i try to use
embperl code to define the sub ([$ sub get factorial $]), it does not
work.
[$ sub eplprint $]
[- $c = shift ; -]
[+ $c +]
[$ endsub $]
[*
sub get_factorial
{
local $a;
$a = shift;
if( $a == 1 )
{
&eplprint($a);
return($a);
} else {
&eplprint($a);
return($a*&get_factorial($a-1));
}
}
*]
[- $d= 3; $b=&get_factorial($d);-]
--- "Factorial" of [+ $d +] is [+ $b +]
Thank you
Carlos Kassab
El mar, 21-01-2003 a las 00:59, Gerald Richter escribi�:
>
> >
> > it seems that embperl is loosing the values for recursive process.
> >
> > Do you know a way to do recursive processes with embperl? i am using
> > embperl 1.3.4
> >
>
> If you are using Embperl's [$ sub $] or Execute to do the recursive call you
> need to declare the variables local. In Embperl you can do this with
>
> [*
> local $foo ;
> local $bar ;
> *]
>
> Note that in 1.3.4 'my' instead of local does not work (in 2.0 it does)
>
> Gerald
>
>
> -------------------------------------------------------------
> Gerald Richter ecos electronic communication services gmbh
> Internetconnect * Webserver/-design/-datenbanken * Consulting
>
> Post: Tulpenstrasse 5 D-55276 Dienheim b. Mainz
> E-Mail: [EMAIL PROTECTED] Voice: +49 6133 925131
> WWW: http://www.ecos.de Fax: +49 6133 925152
> -------------------------------------------------------------
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]