dragData["files"] question
Joe Lewis Wilkins
pepetoo at cox.net
Sun Oct 17 12:55:27 EDT 2010
Klaus,
Thank you very much for all of your coding efforts. This is really targeted at all of the revCoders who furnish solutions and suggestions on the lists:
Please provide comments indicating what you expect to achieve with the code you provide. This makes your efforts much more useful to the rest of us whose are just following along, hoping to learn something beneficial. I realize this adds significantly to the time you spend with your responses, but it will also allow you to "catch" your own errors when they occur.
Much appreciated,
Joe Wilkins
On Oct 17, 2010, at 9:40 AM, Klaus on-rev wrote:
> Hi Hugh,
>
>> Is it my syntax, or is it simply not possible to modify the
>> dragData["files"] during a file drag operation?
>>
>> If I drag a .png file and a .rev file, I would expect the .rev filepath to
>> have been removed, but it isn't...
>>
>> on dragEnter
>> put the dragData["files"] into tFilePaths
>> set the itemDel to "."
>> repeat for each line L in tFilePaths
>> if (last item of L is NOT among the items of "GIF.JPG.JPEG.PNG")
>> then delete line lineOffset(CR&L&CR,CR&tFilePaths&CR) of tFilePaths
>> end repeat
>> set the dragData["files"] to tFilePaths
>> put the dragData["files"] --> Value does not get updated!
>> end dragEnter
>>
>> So what am I missing?
>
> repeat for each is read only, but you try to change tFilePaths on the fly :-)
>
> Do this:
>
> on dragEnter
> put the dragData["files"] into tFilePaths
> set the itemDel to "."
> repeat for each line L in tFilePaths
> if (last item of L is among the items of "GIF.JPG.JPEG.PNG") then
> put l & CR after tFilePaths2
> end if
> end repeat
> delete char -1 of tFilePaths2
> set the dragData["files"] to tFilePaths2
> put the dragData["files"] --> Value does not get updated!
> end dragEnter
>
>> Hugh Senior
>> FLCo
>
> Best
>
> Klaus
>
> --
> Klaus Major
> http://www.major-k.de
> klaus at major.on-rev.com
More information about the use-livecode
mailing list