[ic] usertag passing args by reference (perl newby)
Marco Mescoli
m.mescoli at omnib.it
Wed Aug 27 11:18:14 UTC 2008
I am working to a usertag to calculate day worktime beetwen more time
marks (manual clock mark, sms mark, web mark). If i cannot find correct
sequence entry-exit i must return the partial time computed and the code
error (no entry, no exit .... ). Passing to the usertag the name of a
scratch var to get the error is a simple good way to handle the problem.
Sorry and thanks for the other suggestion that going (slow ;-) me to
perl computing often more simple than i think.
Marco
Gert van der Spoel wrote:
>>-----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