Trouble deleting a line of text
Bill Vlahos
bvlahos at mac.com
Mon Aug 25 02:49:54 EDT 2008
Thanks Sarah.
Bill
On Aug 24, 2008, at 3:58 PM, Sarah Reichelt wrote:
> On Mon, Aug 25, 2008 at 8:36 AM, Bill Vlahos <bvlahos at mac.com> wrote:
>> I have a table field (but in testing any field behaves this way)
>> that I want
>> to delete a line of text when the user right clicks on it. The
>> following
>> script deletes the line of text as expected but then throws an error.
>>
>> 1. Create a field and type several lines of text in it.
>> 2. Lock the text of the field (so it can respond to mouseUp)
>> 3. Paste the following code into the field
>> 4. Click on a line of text
>>
>> on mouseUp
>> select the clickLine
>> answer "Really delete" & return & the clickLine && "?" with "No" or
>> "Yes"
>> if it is "Yes" then
>> delete the clickLine
>> end if
>> end mouseUp
>>
>
> The problem is that "the clickLine" is not preserved and becomes empty
> while the answer dialog is open (or when it closes).
> Try this instead. It stores "the clickLine" first, then uses the
> stored value instead of expecting "the clickLine" to remain the same:
>
> on mouseUp
> put the clickline into tClick
> select tClick
> answer "Really delete" & return & tClick && "?" with "No" or "Yes"
> if it is "Yes" then
> delete tClick
> end if
> end mouseUp
>
> Cheers,
> Sarah
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
More information about the use-livecode
mailing list