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

Ken Ray kray at sonsothunder.com
Fri Sep 12 02:28:36 EDT 2008


> on mouseUp
>   answer file "Kies bestand:"
>     if the result is "Cancel"
>     then exit mouseUp
>   else put it into bLijst
> 
>     answer folder "Kies map" -- selection of destination folder
>   if the result is "Cancel" then exit mouseUp
>   put it & "/" into bMap
> end mouseup
> 
> After this I write back a new file into bMap.
> But...I don't want destfolder to be the same folder as where the chosen file
> is in.
> Otherwise the file will be overwritten.
> 
> I tried with:
> if filePath bLijst is within filePath bMap then answer error "Fout!"
> but that doesn't work.
> 
> Any idea's?

Yes... do this:

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

Ken Ray
Sons of Thunder Software, Inc.
Email: kray at sonsothunder.com
Web Site: http://www.sonsothunder.com/





More information about the use-livecode mailing list