Re: Having trouble doing math with values retrieved from external data source

Sergiu Dumitriu <[email protected]>
Newsgroups gmane.comp.jakarta.velocity.user
Organization XWiki
Message-ID <[email protected]>
On 10/02/2012 01:55 PM, Dalrymple, Craig - OCIO-ITS, Kansas City, MO wrote:
> Could the following issue be related to the 1.4 engine, or to the way Cisco has it implemented?
>
> Source:
> #set ($county=$!{dsobj.getValue('Location-CountyName')})
> #set ($county=$county.toLowerCase())
> #if ($county.lentgh() > 8) ## check to see if the county name is longer than 8

Do you really have lentgh instead of length in your code?

>    ! true
>    hostname $county.substring(0,8)$!{dsobj.getValue('Location-FIPSCode')}$!{dsobj.getValue('Device-Instance')}
> #else
>    ! false
>    hostname $county$!{dsobj.getValue('Location-FIPSCode')}$!{dsobj.getValue('Device-Instance')}
> #end
>
> Output:
> ! false
> hostname stelsewhere99
> !
>
> Clearly, the length is more than 8....
> 	


-- 
Sergiu Dumitriu
http://purl.org/net/sergiu/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.