[ic] usertag passing args by reference (perl newby)

Gert van der Spoel gert at 3edge.com
Wed Aug 27 10:21:49 UTC 2008


> -----Original Message-----
> From: interchange-users-bounces at icdevgroup.org [mailto:interchange-
> users-bounces at icdevgroup.org] On Behalf Of Stefan Hornburg
> Sent: woensdag 27 augustus 2008 13:17
> To: interchange-users at icdevgroup.org
> Subject: Re: [ic] usertag passing args by reference (perl newby)
> 
> Marco Mescoli wrote:
> > And if i want to pass the address of a scratch var and modify the var
> > inside mytag ?
> 
> Just pass the name of the scratch variable and use $Scratch to
> manipulate
> it.
> 
> > Something like this:
> >
> > -------- mytag.tag ------------
> > UserTag mytag Order myarg
> > UserTag mytag Routine <<EOR
> > sub {
> >    my $ref = shift;
> >    $($ref) = 'bar'; # :-?
> >    return;
> > }
> > EOR
> 
> UserTag mytag Order myarg
> UserTag mytag Routine <<EOR
> sub {
>     my $ref = shift;
> 
>     $Scratch->{$arg} = 'bar';
>     return;
> }
> 
> Regards
>           Racke

Then probably not $arg in the {} as it sets my $ref ... But that's the basic
idea yes :)

You could also probably do [seti myexample][mytag ... ][/seti]  ... 

But if you are trying to do something specific/fancy ... Sometimes it is
best to explain what you really want to achieve.
The solution might not lie with the passing the arguments to a usertag etc
...

CU,

Gert










More information about the interchange-users mailing list