HC to R question
Dale Pond
dalesvp at qwest.net
Mon Aug 25 09:02:00 EDT 2003
WA,
You offer an interesting suggestion. Thanks. Every card fld "Card Name"
has data so I don't know what might be gained by examining each card
then marking it. There aren't that many cards in each stack. With HC
anyway the restriction is 32k characters in the IndexField which lists
all the cards by name and ID. Rev has a higher fld limit so this
restriction is lifted. On these newer computers speed of execution
doesn't pose an issue. Even with adding in a "sort cards of stack" line
it takes about 1/2 (or less) of a second to complete this script. I will
try your "(option : sort lines of index1 by item 1 of each)", that might
improve general UI performance.
Dale
wouter wrote:
> Hi,
> If the amount of cards is considerable then you can gain some time by
> changeing the script to:
>
> on mouseUp
> put empty into field "IndexField"
> -- DON'T visit each card
> mark cards where fld "Card Name" <> empty
> repeat with x = 1 to the number of marked cds
> put (field "Card Name") of marked cd i & ";" && the ID of
> marked cd i \
> & return after index1
> end repeat
> unmark all cds
> go to card 2 -- go to card 2 "Index Card" -- If you were on cd 2
> originally you can omit this line
> sort index1 -- sort data within variable (option : sort lines of
> index1 by item 1 of each )
> put index1 into field "IndexField" -- put data into Index Field
> put number of chars in field "IndexField" into field "Characters"
> put number of lines in field "indexfield" into field "Line Count"
> unlock screen
> end mouseUp
>
> Have a nice day,
> WA
>
>
> On zaterdag, aug 23, 2003, at 18:01 Europe/Brussels,
> use-revolution-request at lists.runrev.com wrote
>
>> Message: 12
>> Date: Sat, 23 Aug 2003 10:26:06 -0600
>> From: "Dale Pond" <dalesvp at qwest.net>
>> To: use-revolution at lists.runrev.com
>> Subject: Re: HC to R question
>> Reply-To: use-revolution at lists.runrev.com
>>
>> Jim Hurley wrote:
>>
>>>>
>>>> Message: 17
>>>> Date: Sat, 23 Aug 2003 08:18:48 -0600
>>>> From: "Dale Pond" <dalesvp at qwest.net>
>>>> To: "Revolution" <use-revolution at lists.runrev.com>
>>>> Subject: HC to R question
>>>> Reply-To: use-revolution at lists.runrev.com
>>>>
>>>> Hi,
>>>>
>>>> I finally bit the bullet and purchased a copy of Revolution to convert
>>>> my HC stacks. I'm having trouble with a simple repeat loop:
>>>>
>>>> -- visit each card
>>>> repeat with x = 3 to the number of cards
>>>> go to card x
>>>> if field "Card Name" <> empty
>>>> then put (field "Card Name") & ";" && the ID of this card & return
>>>> after index1
>>>> end repeat
>>>>
>>>> This returns an error "Handler: end doesn't match handler name". Makes
>>>> no sense to me and I can't find anything wrong with the script. Can
>>>> someone help me out with this?
>>>>
>>>
>>> My specialty is the simple-minded solution. Forgive me, but did you
>>> check the spelling of the handler in which the above repeat loop is
>>> included--or perhaps other handlers in the same script? There
>>> certainly doesn't appear to be anything wrong with the repeat loop
>>> itself.
>>>
>>> Jim
>>
>>
>> Jim and Roger,
>>
>> Thanks for your pointers! I found an error further on in the script
>> (actually two errors). One was an unassociated repeat and the other
>> appeared to be an abbreviated "fld" instead of field or maybe it was the
>> 'go to card "Index"' which when changed to 'go to card "2"' worked.
>> Seems Rev doesn't like abbreviations nor does it point well to the
>> actual bug. The script works great now! Here is the complete and
>> working script:
>>
>> on mouseUp
>> put empty into field "IndexField"
>> lock screen
>> -- visit each card
>> repeat with x = 3 to the number of cards
>> go to card x
>> if field "Card Name" <> empty then
>> put (field "Card Name") & ";" && the ID of this card \
>> & return after index1
>> end if
>> end repeat
>> go to card 2 -- go to card 2 "Index Card"
>> sort index1 -- sort data within variable
>> put index1 into field "IndexField" -- put data into Index Field
>> put number of chars in field "IndexField" into field "Characters"
>> put number of lines in field "indexfield" into field "Line Count"
>> unlock screen
>> end mouseUp
>>
>> --
>> Life, Light, Love and Laughter,
>> Dale Pond
>> Sympathetic Vibratory Physics
>> Sacred Science - Sacred Life
>> http://www.svpvril.com
>> SVP Discussion Forum:
>
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/use-revolution
>
>
--
Life, Light, Love and Laughter,
Dale Pond
Sympathetic Vibratory Physics
Sacred Science - Sacred Life
http://www.svpvril.com
SVP Discussion Forum:
http://groups.yahoo.com/group/svpvril/
More information about the use-livecode
mailing list