[sr-dev] test if $var has been give a value
Daniel-Constantin Mierla
miconda at gmail.com
Thu Sep 3 17:29:57 CEST 2009
On 02.09.2009 14:14 Uhr, Juha Heinanen wrote:
> why does test
>
> if ($var(test)) ...
>
> fail even when $var(test) has a non-empty string value?
>
indeed, I checked the sources, SR core tries to convert the str to int
and fails in above case.
I can make a patch so to return true for PV is they have a value with
len!=0, if feels to be right for the rest -- it is what I would expect
as well.
However, maybe Andrei can detail more about the logic behind.
Cheers,
Daniel
> the test works, if i do it like this:
>
> if ($var(test) != 0) ...
>
> i'm pretty sure that in k also the first version of the test works.
>
--
Daniel-Constantin Mierla
* http://www.asipto.com/
More information about the sr-dev
mailing list