A Very Strange Error
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
A Very Strange Error
I have a function which sometimes works and sometimes
doesn't.
The problem is a repeat loop...
repeat with r = 16 to 36.
The error occurs on the first iteration of the loop.
The value of r is somehow changed - to 15 - so the loop
is exited.
This happens even when I add a line before to put 16 into r.
Other functions which have the same code work as expected.
What's up here???????
doesn't.
The problem is a repeat loop...
repeat with r = 16 to 36.
The error occurs on the first iteration of the loop.
The value of r is somehow changed - to 15 - so the loop
is exited.
This happens even when I add a line before to put 16 into r.
Other functions which have the same code work as expected.
What's up here???????
Is age an excuse? Eighty-four and counting.
Programming powered by coffee.
Programming powered by coffee.
-
- VIP Livecode Opensource Backer
- Posts: 9838
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: A Very Strange Error
We won't be able to determine we what's happening in the handler until you post the full handler.
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
Re: A Very Strange Error
Richard
I've never needed to figure out "handlers".
Can you explain or direct me to an explanation?
I've never needed to figure out "handlers".
Can you explain or direct me to an explanation?
Is age an excuse? Eighty-four and counting.
Programming powered by coffee.
Programming powered by coffee.
-
- Livecode Opensource Backer
- Posts: 120
- Joined: Tue May 22, 2012 1:57 pm
- Location: Vicenza (Italy)
- Contact:
Re: A Very Strange Error
Hi RossG,
Paolo
post your LiveCode script with the while loopI've never needed to figure out "handlers".
Paolo
Paolo Borzini | paolo@borzini.it
The WhiteFly Software | www.thewhitefly.it
Service on line for printers | www.4pellicole.it
The WhiteFly Software | www.thewhitefly.it
Service on line for printers | www.4pellicole.it
Re: A Very Strange Error
The while loop is OK sometimes.Neurox66 wrote:Hi RossG,post your LiveCode script with the while loopI've never needed to figure out "handlers".
Paolo
Usually after the first run it goes wrong.
The first stack I've had which crashes LC and
the stand-alone.
I'll try adding this code to the Explicator stack and
see if it crashes.
Also...
After ten years using LC (from Rev 3) it's occurred to me
that it would be very convenient if, when compiling a stack,
a copy of it was saved with the .exe.
Is there a setting or a way to do this?
Is age an excuse? Eighty-four and counting.
Programming powered by coffee.
Programming powered by coffee.
Re: A Very Strange Error
Made some progress on this.
the loop...
repeat with x = 16 to min(sCount,36)
Somehow sCount wasn't what it should have been.
Should be between 16 and 200(say).
It was reduced to 2, so naturally the loop failed.
Now I have to find where this change is occurring
which brings me to my next question.
Had a look for info about using the Watch Window but
can't figure out if I can set it up to tell me when sCount
is being changed.
I expect it's possible.
Some clues would really be appreciated.
the loop...
repeat with x = 16 to min(sCount,36)
Somehow sCount wasn't what it should have been.
Should be between 16 and 200(say).
It was reduced to 2, so naturally the loop failed.
Now I have to find where this change is occurring
which brings me to my next question.
Had a look for info about using the Watch Window but
can't figure out if I can set it up to tell me when sCount
is being changed.
I expect it's possible.
Some clues would really be appreciated.
Is age an excuse? Eighty-four and counting.
Programming powered by coffee.
Programming powered by coffee.
-
- VIP Livecode Opensource Backer
- Posts: 9665
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: A Very Strange Error
Ross.
I think it was Richard who said we need to see the entire handler before we have any hope at all of helping you.
He was correct.
Craig Newman
I think it was Richard who said we need to see the entire handler before we have any hope at all of helping you.
He was correct.
Craig Newman
Re: A Very Strange Error
Would still like to know how I can watch a variable
so that the stack stops when it changes as I now
have an array which "disappears" at some point
after it's been initialized.
A fairly usual facility in all the programming languages
I've used.
so that the stack stops when it changes as I now
have an array which "disappears" at some point
after it's been initialized.
A fairly usual facility in all the programming languages
I've used.
Is age an excuse? Eighty-four and counting.
Programming powered by coffee.
Programming powered by coffee.
-
- VIP Livecode Opensource Backer
- Posts: 9665
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: A Very Strange Error
Ross.
What does stepping through each line of a handler in the debugger not do for you? Breakpoints, soft or hard, or watchpoints for that matter, may be placed anywhere.
Another big advantage and feature of the LC debugger is that array variables are visible as the handler proceeds
Craig
What does stepping through each line of a handler in the debugger not do for you? Breakpoints, soft or hard, or watchpoints for that matter, may be placed anywhere.
Another big advantage and feature of the LC debugger is that array variables are visible as the handler proceeds
Craig
Re: A Very Strange Error
Craig
Tried all the usual but as usual I'd found a new way
to confuse LC.
I'd declared the array as global but when I added it
to the list I'd separated it from the previous global
with a "." instead of a ",". Took a bit of finding
what with these hi-res monitors and low-res eyes.
Must try harder but as usual a post here seemed to
solve it nicely!
Thanks again for your attention.
Tried all the usual but as usual I'd found a new way
to confuse LC.
I'd declared the array as global but when I added it
to the list I'd separated it from the previous global
with a "." instead of a ",". Took a bit of finding
what with these hi-res monitors and low-res eyes.
Must try harder but as usual a post here seemed to
solve it nicely!
Thanks again for your attention.
Is age an excuse? Eighty-four and counting.
Programming powered by coffee.
Programming powered by coffee.
-
- VIP Livecode Opensource Backer
- Posts: 7237
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: A Very Strange Error
"Low-res eyes" -- lol. That's me too. I'm stealing that.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
Re: A Very Strange Error
Due to advances in display technology the human eye
can't discern any difference between the latest
display resolution and the previous one so in
fact we all have "low-res" eyes now.
Waiting for the bionic eye implant before I
get a new monitor.
can't discern any difference between the latest
display resolution and the previous one so in
fact we all have "low-res" eyes now.
Waiting for the bionic eye implant before I
get a new monitor.
Is age an excuse? Eighty-four and counting.
Programming powered by coffee.
Programming powered by coffee.
-
- VIP Livecode Opensource Backer
- Posts: 9838
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: A Very Strange Error
I'd used Andale Mono for years, and many others for years before, and I found that they often made the descending tail on the comma too small to be readily distinguished from a period.RossG wrote:I'd declared the array as global but when I added it
to the list I'd separated it from the previous global
with a "." instead of a ",".
No more. I came across Ubuntu Mono a few years ago, one of the few monospaced fonts that understands its role in coding and makes the comma very easily distinguishable from a period.
The Ubuntu font family is available for free as open source, downloadable here:
http://font.ubuntu.com/
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