Why does my LiveCode script fail to properly update and pass data between stacks using send and dispatch

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
brienne
Posts: 1
Joined: Tue Apr 07, 2026 8:27 am
Contact:

Why does my LiveCode script fail to properly update and pass data between stacks using send and dispatch

Post by brienne » Tue Apr 07, 2026 8:31 am

Hi everyone, I’m working on a multi-stack LiveCode project where I’m trying to pass data between a mainstack and a substack using both `send` and `dispatch`, but I’m running into inconsistent behavior where the receiving stack either doesn’t update its fields or throws an execution error depending on how the message is triggered; for example, I’m using code like `send "updateData tValue" to stack "SubStackA" in 0 millisecs` and also testing `dispatch "updateData" to stack "SubStackA" with tValue`, but the handler sometimes isn’t recognized or the variable scope seems lost when the message arrives, especially after opening and closing stacks dynamically, so I’m wondering if this is related to message path issues, timing (async vs sync), or how LiveCode handles variable context across stacks, and what would be the correct pattern to reliably pass and update data between stacks in a more complex app structure.

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

Re: Why does my LiveCode script fail to properly update and pass data between stacks using send and dispatch

Post by dunbarx » Tue Apr 07, 2026 2:25 pm

Hmmm.

This is a good one.

Craig

Post Reply