QT: how do I determine wheter a chosen file is within the same folder as a new chosen destination folder?

Richard Gaskin ambassador at fourthworld.com
Fri Sep 12 11:25:48 EDT 2008


Ken Ray wrote:

> if (char 1 to length(bMap) of bLijst) = bMap then
>    -- in same folder
> else
>    -- in different folder
> end if

Rev 2.9 supports a new "begins with" operator for string comparisons, so 
the above could be written as:

   if bLijst begins with bMap then
      -- in same folder
   else
      -- in different folder
   end if


While both forms execute in just a fraction of a millisecond, the new 
"begins with" form runs about 25% faster.

There is also a new "ends with" operator as well.

Good times....

-- 
  Richard Gaskin
  Managing Editor, revJournal
  _______________________________________________________
  Rev tips, tutorials and more: http://www.revJournal.com



More information about the use-livecode mailing list