Page 1 of 1

How can I tell if I'm on the first card (of this bg or of this stack)?

Posted: Tue Jun 19, 2018 3:20 pm
by mluka
Hi all.

Such simple questions...

Thanks!

Re: How can I tell if I'm on the first card (of this bg or of this stack)?

Posted: Tue Jun 19, 2018 3:45 pm
by Klaus
Bonjour Michel,

et voila:
...
put the number of this cd
...
:-)

Best

Klaus

Re: How can I tell if I'm on the first card (of this bg or of this stack)?

Posted: Tue Jun 19, 2018 4:04 pm
by mluka
Hallo Klaus.

Not really... what I want to be able to do is something like:

if this card is the first card of this stack then...

I've been trying all kinds of combinations in the msg box, but none of them works (errors like "chunk source is not a container, etc.)

Regards.

Re: How can I tell if I'm on the first card (of this bg or of this stack)?

Posted: Tue Jun 19, 2018 4:10 pm
by Klaus
Bonjour Michel,

LC is all about PROPERTIES and to get and set them and cards have a NUMBER property, so:

Code: Select all

...
if the num of this cd = 1 then
  ## current card is the FIRST card in your stack, do your thing...
end if
...
Best

Klaus

Re: How can I tell if I'm on the first card (of this bg or of this stack)?

Posted: Tue Jun 19, 2018 4:24 pm
by mluka
Ah... the properties!

Thank you for pointing me in that direction!

And I see that I won't have to ask my followup question: how can I tell if I'm on the LAST card:

the number of the last cd of this stack

Danke, danke!

Re: How can I tell if I'm on the first card (of this bg or of this stack)?

Posted: Tue Jun 19, 2018 4:35 pm
by Klaus
Many ways to skin a cat in Livecode:
...
if the num of this cd = the num of cds then
...
:D

Avec plaisir, mon ami!