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: FourthWorld, heatherlaine, Klaus, kevinmiller

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

Custom Global Functions/Handlers

Post by wmiriye » Thu Jun 04, 2020 2:31 am

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 » Thu Jun 04, 2020 2:36 am

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 » Thu Jun 04, 2020 2:41 am

ok, will try that. Thanks.

Klaus
Posts: 14194
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Custom Global Functions/Handlers

Post by Klaus » Thu Jun 04, 2020 9:12 am

Linda is correct! :D

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10320
Joined: Wed May 06, 2009 2:28 pm

Re: Custom Global Functions/Handlers

Post by dunbarx » Thu Jun 04, 2020 1:48 pm

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