template string question

2005-05-25 Thread Liu, Teh P
Hi All, I have a string TehpaoLiu Is it possible to just extract Tehpao from the above string in velocity? Any help will be appreciated. Thanks - tehpao

Re: template string question

2005-05-25 Thread Adam Williams
On 5/25/05, Liu, Teh P [EMAIL PROTECTED] wrote: I have a string TehpaoLiu Is it possible to just extract Tehpao from the above string in velocity? That is a very vague question, but I suppose that since you know the value of the String, you know the start and end index of the characters that

Re: template string question

2005-05-25 Thread Barbara Baughman
Since Velocity is using Java, you have access to all of the public methods of the classes in the java.lang package. String methods are included. #set ($string=TehpaoLiu) $string.substring(0,6) Barbara Baughman X2157 On Wed, 25 May 2005, Liu, Teh P wrote: Hi All, I have a string TehpaoLiu

Re: IteratorTool question

2005-05-25 Thread Shinobu Kawai
Hi JohnE, In the end I did it the long term correct way. I did the wise, extra programming that would only return the 30 records I require to the request. Depending on what you want to do, the AbstractPagerTool might be of use.

arithmetic

2005-05-25 Thread Ramin Dousti
Hello, I have a simple macro which is supposed to receive a netMask (say 255.255.0.0) and convert it to an inverseMask 0.0.255.255. The first problem is: how can I split on .? I tried ., \., \\. and so forth but none worked. The second question is: given a string 128, how can I subtract it from

Re: arithmetic

2005-05-25 Thread Jason Pettiss
You should really try to avoid being too clever in a template. Java is good for doing logical operations. Templates are good for creating content. Try to keep the business logic in Java. Btw, to split on '.' in Java you'd need to do \\.. You need to escape the backslash so that a literal

Re: arithmetic

2005-05-25 Thread Jason Pettiss
I'm mainly posting this as a joke. So keep that in mind. But. You could do something like, um... well... --- #set( $mask = '0.1.254.255' ) #set( $imask = '' ) #macro( numchar $char $x $m ) #if( $char=='0' )#set( $num = 0 ) #elseif( $char=='1' )#set( $num = 1 ) #elseif( $char=='2' )#set(