Custom Global Functions/Handlers

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller

Post Reply
wmiriye
Posts: 24
Joined: Tue Jun 02, 2020 4:09 am

Custom Global Functions/Handlers

Post by wmiriye »

I have a function that I don't want to write for every single card. How do I make that functions/handler global and then call it on each card.
anmldr
Posts: 459
Joined: Tue Sep 11, 2012 11:13 pm

Re: Custom Global Functions/Handlers

Post by anmldr »

You can put the script in the stack's script rather than having it as a card script. (I think. I am a newbie too.)

Linda
wmiriye
Posts: 24
Joined: Tue Jun 02, 2020 4:09 am

Re: Custom Global Functions/Handlers

Post by wmiriye »

ok, will try that. Thanks.
Klaus
Posts: 14325
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Custom Global Functions/Handlers

Post by Klaus »

Linda is correct! :D
dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10509
Joined: Wed May 06, 2009 2:28 pm

Re: Custom Global Functions/Handlers

Post by dunbarx »

Try this, Make a new stack with several cards. In the stack script:

Code: Select all

on openCard
  put the number of this card
  end openCard
Press cmd-2 several times (on a Mac) and watch the message box.

Craig
Post Reply