logo       
Google Custom Search
    AddThis Social Bookmark Button
-->

if() function behavior: msg#00026

Subject: if() function behavior
I have a statement in my form like this:

<xforms:setvalue xforms:ref="instance('instance00')/brands/brand3" value="if(string-length('203') &gt; 4,substring('203',5,1),'')"/>

When executed, I get "java.lang.StringIndexOutOfBoundsException: String index out of range: -1".

It looks like the "substring('203',5,1)" part is evaluated even if the "string-length('203') &gt; 4" part returns "false". Is this normal behavior?

I am trying to split a value submitted from a SELECT control - like '204060708' - into values "2", "4", "6"... that I can insert into individual nodes of the instance tree.

A.



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click


<Prev in Thread] Current Thread [Next in Thread>