Just a note, If there are two or more periods in the file name (which  
is more and more common), your code will discard part of the file name.

<@! First figure out the number of periods in the filename>
<@assign local$numPeriods "<@length '<@keep str="@@local$image"  
chars=".">'>">

<@ifequal @@local$numPeriods 0>
        <@assign local$thumbnail "<@var local$image>tn">
<@else>
        <@! Then replace the period in the LAST occurence of the filename>
        <@assign local$thumbnail "<@replace str='@@local$image' findstr='.'  
replacestr='tn.' position='@@local$numPeriods'>">
</@if>

This code should be more fullproof, and more efficient. The more you  
think of every possibility, the more your code won't break, and the  
less bugs you will have.

Robert Garcia

On Tuesday, September 10, 2002, at 08:50  PM, JJ Smith wrote:

> Change the last line to:
>
> <@assign name='Thumbnail' value='<@var
> local$Name1[1,1]>tn.@@local$Name1[1,2]'
> scope='local'>
>
> and it will work....
>
> --- "Fogelson, Steve"
> <[EMAIL PROTECTED]> wrote:
>> Dumb question got me stumped.
>>
>> I want to insert "tn" prior to the period in a file
>> name. Used the
>> following, but it diesn't display the tn, only the
>> period.
>>
>> <@assign name='Name1' value='<@tokenize
>> value="@@local$image" chars=".">'
>> scope='local'>
>> <@assign name='Thumbnail'
>> value='@@local$Name1[1,1]tn.@@local$Name1[1,2]'
>> scope='local'>
>>
>> I know this has to be simple. Must be late at night.
>>
>> Thanks
>>
>> Steve Fogelson
>>
> _______________________________________________________________________ 
> _
>> TO UNSUBSCRIBE: send a plain text/US ASCII email to
>> [EMAIL PROTECTED]
>>                 with unsubscribe witango-talk in the
>> message body
>
>
> __________________________________________________
> Yahoo! - We Remember
> 9-11: A tribute to the more than 3,000 lives lost
> http://dir.remember.yahoo.com/tribute
> _______________________________________________________________________ 
> _
> TO UNSUBSCRIBE: send a plain text/US ASCII email to  
> [EMAIL PROTECTED]
>                 with unsubscribe witango-talk in the message body
>

-- 

Robert Garcia
BigHead Technology
2781 N Carlmont Pl
Simi Valley, CA 93065
Phone 805.522.8577
http://www.bighead.net/
http://www.theradmac.com/
[EMAIL PROTECTED]

________________________________________________________________________
TO UNSUBSCRIBE: send a plain text/US ASCII email to [EMAIL PROTECTED]
                with unsubscribe witango-talk in the message body

Reply via email to