You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by pl...@netscape.net on 2002/08/29 22:59:05 UTC

methods that might return null

How do people handle the case where the return value for a method
might be null?  If you are calling the method in a loop, it looks 
like you have to call the method twice:

#foreach ($arg in $arglist)
   #if ($obj.method($arg))
      #set ($rtn = $obj.method($arg))
      ... do something with $rtn
   #end
#end

Is there a better way?

Thanks in advance,
   --Paul

__________________________________________________________________
The NEW Netscape 7.0 browser is now available. Upgrade now! http://channels.netscape.com/ns/browsers/download.jsp 

Get your own FREE, personal Netscape Mail account today at http://webmail.netscape.com/

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>