Gossamer Forum
Home : Products : DBMan SQL : Discussion :

<%test1 + test2%>

Quote Reply
<%test1 + test2%>
How do I add the values of <%test1%> and <%test2%>

I am trying to show addittion between these 2 fields.

I tried <%test1 + test2%> did not work.Unsure



Thanks
Quote Reply
Re: [Suomi] <%test1 + test2%> In reply to
Hi,

It should be <%$test1 + $test2%>

TheStone.

B.
Quote Reply
Re: [TheStone] <%test1 + test2%> In reply to
YESCool Awesome.... this thing is so cool, once you learn all the tricks



Works really nice with 2 items, how would you do with 3 or more?

Last edited by:

Suomi: Feb 12, 2002, 3:35 PM
Quote Reply
Re: [Suomi] <%test1 + test2%> In reply to
Use a global:

sub {
my $tags = shift;
return $tags->{test1} + $tags->{test2} + $tags->{test3};
}

You can insert whatever perl code you like inside the global. The first argument is a hash ref of all the other tags on the page. You can either return a string, or return a hash ref (which will make new tags available).

Cheers,

Alex
--
Gossamer Threads Inc.
Quote Reply
Re: [Alex] <%test1 + test2%> In reply to
Thanks a bunchTongue