Message handler called during compile

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
andyh1234
Posts: 476
Joined: Mon Aug 13, 2007 4:44 pm
Contact:

Message handler called during compile

Post by andyh1234 » Sat Nov 02, 2024 1:17 pm

Hi,

I have a simple routine

on setupstack
put x into fld "y"
end setupstack

that I would like to run everytime I run the app in the iOS simulator. Is there a function or message handler that is called every time the test button (or build for device) is pressed I can hook into?

Would save me having to remember to call the routine to clear everything before each test.

Thanks

SWEdeAndy
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 324
Joined: Sat Aug 16, 2008 9:48 am
Contact:

Re: Message handler called during compile

Post by SWEdeAndy » Sat Nov 02, 2024 4:23 pm

andyh1234 wrote:
Sat Nov 02, 2024 1:17 pm
Is there a function or message handler that is called every time the test button (or build for device) is pressed I can hook into?
Yes, the test button/menu triggers the revIDEDeployAction message. You can hijack it by inserting this handler into front:

Code: Select all

on revIDEDeployAction  
   put x into fld "y" of MyCard of MyStack ## Or any code or other handler you want to invoke here
   pass revIDEDeployAction ## Releases the message to run its course
end revIDEDeployAction
Andreas Bergendal
Independent app and system developer
Free LC dev tools: https://github.com/wheninspace
(WIS_WebDeployHelper, WIS_ScriptDependencies, WIS_BrowserAnimation)
WhenInSpace: https://wheninspace.com

andyh1234
Posts: 476
Joined: Mon Aug 13, 2007 4:44 pm
Contact:

Re: Message handler called during compile

Post by andyh1234 » Sat Nov 02, 2024 4:23 pm

Thank you.

Post Reply