Help me! My script is going a never ending loop!!!

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
ale870
Posts: 250
Joined: Tue Apr 22, 2008 9:17 am
Contact:

Help me! My script is going a never ending loop!!!

Post by ale870 » Tue Oct 14, 2008 8:30 pm

Please help me!
I made a wrong code, in fact I started to send a message entering in the stack, then this event call the same recursive function!!

Look at an example here:

Code: Select all

on openStack
  send myMessage
end

on myMessage
  send myMessage
end
Now I have a BIG problem: as soon as I try to modify the code (load the stack) it execute OpenStack and loops forever. So Revolution hangs up!

Please help me!
What can I do to lock the event so I can update it?

Thank you :cry:

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4172
Joined: Sun Jan 07, 2007 9:12 pm

Post by bn » Tue Oct 14, 2008 9:07 pm

Hi Ale870,

start revolution without the problematic stack.
make a new stack with a button. the script of the button is:

Code: Select all

on mouseUp pMouseBtnNo
    answer file "the recursion file"
    if it is empty then exit mouseUp
    lock messages 
    go stack it
end mouseUp
this opens your recursive stack without the openstack message and you can edit your script.
hth
Bernd

dont forget: recurse and the world curses with you :)

ale870
Posts: 250
Joined: Tue Apr 22, 2008 9:17 am
Contact:

Post by ale870 » Tue Oct 14, 2008 9:11 pm

Thank you!
You saved my life! :D

Post Reply