LiveCode crashes with wait command
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
-
- Posts: 31
- Joined: Mon Apr 27, 2015 3:09 pm
LiveCode crashes with wait command
I'm trying to do something, not sure I've got the right way to do it. I have a search box, I automatically want to run an external db command when they enter something in the search box, but I want it to wait a little so it doesn't try to do it after every character. So I used a wait command, but now if I type in a search term of 5 or 6 characters it crashes. I'm not sure it that's the problem. It actually finishes the command and does the db access, but when it loads the table it crashes. It doesn't crash when I change other parameters using a dropdown box.
Here's the code I use. Please let me know if you need anything else, or give me another idea how to do it.
on textChanged
wait 1 second with messages
set the uCurrentSearchTerm of me to the text of me
call loadItemTable
end textChanged
Here's the code I use. Please let me know if you need anything else, or give me another idea how to do it.
on textChanged
wait 1 second with messages
set the uCurrentSearchTerm of me to the text of me
call loadItemTable
end textChanged
-
- Posts: 31
- Joined: Mon Apr 27, 2015 3:09 pm
Re: LiveCode crashes with wait command
More experimenting, I don't think it has to do with the wait. I think it has to do with keying in multiple characters and doing a db access that takes a little while. If I put in one character, wait for it to finish, put in another, wait for it to finish, etc. It works fine. It's just if I put in more than one character. Can anyone give me an idea how to do this differently? I can use a search button so it doesn't do anything until they say go, I just thought it would be cool to do it automatically.
Re: LiveCode crashes with wait command
I'd split the code this way:
Code: Select all
on textChanged
searchdb
end textChanged
on searchdb
wait 1 second with messages
set the uCurrentSearchTerm of me to the text of me
call loadItemTable
end searchdb
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w
-
- VIP Livecode Opensource Backer
- Posts: 10043
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: LiveCode crashes with wait command
If that's happening in the current version it may be helpful if you can spare a moment to file a bug report. No scripting engine should ever crash. Most do now and then, but if we stay on top of such reports we can bring that ever closer to zero.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
-
- Posts: 31
- Joined: Mon Apr 27, 2015 3:09 pm
Re: LiveCode crashes with wait command
This way does the same thing. If I key in one letter and wait for it to read, it works fine. More than one it crashes.MaxV wrote:I'd split the code this way:Code: Select all
on textChanged searchdb end textChanged on searchdb wait 1 second with messages set the uCurrentSearchTerm of me to the text of me call loadItemTable end searchdb
-
- Posts: 31
- Joined: Mon Apr 27, 2015 3:09 pm
Re: LiveCode crashes with wait command
Here's a super simple stack that I created. If you type in 1 character, it works. If you type in more than one, after you click on ok in the dialog box it crashes.
- Attachments
-
- SearchTest.livecode.zip
- (1004 Bytes) Downloaded 192 times
-
- VIP Livecode Opensource Backer
- Posts: 10043
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: LiveCode crashes with wait command
May be platform-specific: using v7.0.5 on Ubuntu 14.10 I can type as many characters as I like, slow or fast, and it seems to work just fine.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
-
- Posts: 31
- Joined: Mon Apr 27, 2015 3:09 pm
Re: LiveCode crashes with wait command
Maybe I'll try it standalone on Windows, that's what I'm going to be deploying it on.
-
- Posts: 31
- Joined: Mon Apr 27, 2015 3:09 pm
Re: LiveCode crashes with wait command
I tried it on Windows standalone and it works perfectly. Does this happen often where something works on one platform but not on another? I submitted a bug report.