Refer to Cards

Roger Guay rogerguay at centurytel.net
Mon Jul 19 11:21:53 CDT 2004


Thanks to all for your replies.

What I was really hoping for was 1 line of code preceding multiple 
lines that directs the multiple lines to work on a specified card.  I'm 
trying to avoid having to put a card reference on the multiple lines.  
Something like:

Repeat with i = 1 to the number of cards
	focus on cd i --for this repeat cycle
	do something -- note: no cardd reference
	do something
	etc.
end repeat

Thanks, Roger


> Message: 5
> Date: Sat, 17 Jul 2004 14:36:08 -0400
> From: Brian Yennie <briany at qldlearning.com>
> Subject: Re: Refer to Cards
> To: How to use Revolution <use-revolution at lists.runrev.com>
> Message-ID: <2B4860AE-D820-11D8-BAC8-000393AA08D2 at qldlearning.com>
> Content-Type: text/plain; charset=US-ASCII; format=flowed
>
> Roger,
>
> How about something like:
>
> put "myCardName" into tCard
> hide object 1 of card tCard
> show object 2 of card tCard
> ...
> put "anotherCardName" into tCard
> ...
>
>> Thanks, but I don't think this will work for what I need.  What I need
>> is a command that forces subsequent lines of script to  act only on a
>> specified card.  Something like:
>>
>> on someHandler
>> 	Do something to look only at card x for the following lines -- this
>> is the line I'm after
>>  	hide object 1
>> 	show object 2
>> 	put "something" into fld 3
>> 	etc.
>> 	Do something to look only at cd y for the following lines -- this is
>> the line I'm after
>> 	hide object 1
>> 	show object 2
>> 	put "something" into fld 3
>> 	etc.
>> end someHandler
> Message: 8
> Date: Sat, 17 Jul 2004 21:15:37 +0200
> From: Wouter <wouter.abraham at pi.be>
> Subject: Re: Refer to Cards
> To: use-revolution at lists.runrev.com
> Message-ID: <AF7E3F14-D825-11D8-8B52-003065CC999E at pi.be>
> Content-Type: text/plain; charset=WINDOWS-1252; format=flowed
>
>> Re: Refer to Cards
>> 	• 	From: Roger Guay
>> 	• 	 Subject: Re: Refer to Cards
>> 	• 	 Date: Sat, 17 Jul 2004 11:17:27 -0700
>>
>>  Thanks, but I don't think this will work for what I need. What I need
>> is a command that forces subsequent lines of script to act only on a
>> specified card. Something like:
>>
>> on someHandler
>>  Do something to look only at card x for the following lines -- this
>> is the line I'm after
>>  hide object 1
>>  show object 2
>>  put "something" into fld 3
>>  etc.
>>  Do something to look only at cd y for the following lines -- this is
>> the line I'm after
>>  hide object 1
>>  show object 2
>>  put "something" into fld 3
>>  etc.
>>  end someHandler
>>
>> I know that SuperCard had this ability, but I don't remember the
>> command.
>>
>>
>> Any help?
>>
>>
>> Thanks, Roger
>
>
> On the contrary, you can use the mark command in this case.
> But your pseudocode is not very clear to me.
> Anyway try something like:
>
> on someHandler
>     set defaultstack to <stackname>
>
>     mark cards where (the script of this cd contains " hide object 1")
> and  (the script of this cd contains "show object 2")
>
>    <then do something like:>
>     repeat with i = 1 to the number of marked cds
>       do the things you have to do with or on marked cd i
>     end repeat
>
> end someHandler
>
> May be it is not similar to Supercards system and may be not really in
> 1 line :-),
> but the mark command works on card scripts as well.
>
> HTH.
> Greetings,
> Wouter



More information about the use-livecode mailing list