Call too all one-liners !

Sarah Reichelt sarah.reichelt at gmail.com
Sat Jun 28 05:34:14 EDT 2008


On Sat, Jun 28, 2008 at 7:25 PM, Francis Nugent Dixon
<effendi at wanadoo.fr> wrote:
> Hi from Paris,
>
> You guys have always spoofed me with what you can do with
> Transcript. Some of your coding makes me look silly.
> I obviously don't "grab" Transcript like you do !
>
> So I have a little test for you. I want to :
>
> 1 -add
> 2 -remove
>
> a ".jpg" suffix from a file name that I'm holding in a variable.
>
> Have you got a couple of one-liners to do that ?


1. add .jpg if it isn't already there
   if char -4 to -1 of tFilename <> ".jpg" then put ".jpg" after tFileName

2. remove .jpg if it's there
   replace ".jpg" with empty in tFileName

Or to remove any file extension (sorry, a two-liner)
  set the itemDel to "."
  delete last item of tFileName

I'm sure other people will come up with many alternatives - that's the
fabulous thing about Revolution.

Cheers,
Sarah



More information about the use-livecode mailing list