Why resizing a stack terminates my scripts
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Why resizing a stack terminates my scripts
I have one definite card in one definite stack that shows a strange (and ultimately annoying) behaviour. Whenever I reset the size of the stack using a line of code like the following, the stack (and the card within) do resizes to the right dimensions, but any script stops there after resizing
set the rectangle of this stack to "0,0,1000,500"
I have tried with several dimensions to resize, to no avail. I can resize any other card of the same stack with the same line, but not this one. Anybody has a guess about what can be happening? I'm using LC 5.5.1 on a 2Gz Intel core i7 iMac OSX 10.7.5
set the rectangle of this stack to "0,0,1000,500"
I have tried with several dimensions to resize, to no avail. I can resize any other card of the same stack with the same line, but not this one. Anybody has a guess about what can be happening? I'm using LC 5.5.1 on a 2Gz Intel core i7 iMac OSX 10.7.5
Re: Why resizing a stack terminates my scripts
hi danierr,
I tried your script and I was suprised it work.
I don't know that a rect between quotes works
Try without quotes
Can you post your stack and we can see also the scripts which don't work ?
Best regards
Jean-Marc
I tried your script and I was suprised it work.
I don't know that a rect between quotes works
Try without quotes
Can you post your stack and we can see also the scripts which don't work ?
Best regards
Jean-Marc
https://alternatic.ch
Re: Why resizing a stack terminates my scripts
I always use quotes when referencing rects or points. I did not know you could do without.
But what do you mean when you say that the script stops? If the resize line is in the middle of a running script, are you saying it exits at that point?
on mouseUp
beep 2
set the rectangle of this stack to "0,0,1000,500"
beep 2
end mouseup
The last line is not executed?
Craig Newman
But what do you mean when you say that the script stops? If the resize line is in the middle of a running script, are you saying it exits at that point?
on mouseUp
beep 2
set the rectangle of this stack to "0,0,1000,500"
beep 2
end mouseup
The last line is not executed?
Craig Newman
Re: Why resizing a stack terminates my scripts
that's what I meant, Craig, but now, after using your "dummyscript" in several environments, I can be more precise: If I use the dummyscript as it is, on its own, in a simple button, then evererything goes right and you'll hear four beeps. But (I suppose that's really meaningful) if you put the script in the "opencard" handler, then you'll hear only the first two beeps.
I mean, if you execute (in this particular card, and in no other card of that stack!)
on openCard
beep 2
set the rectangle of this stack to "0,0,1000,500"
beep 2
end mouseup
the stack will resize to the indicated sice but the last line of the script is not executed.
I mean, if you execute (in this particular card, and in no other card of that stack!)
on openCard
beep 2
set the rectangle of this stack to "0,0,1000,500"
beep 2
end mouseup
the stack will resize to the indicated sice but the last line of the script is not executed.
Re: Why resizing a stack terminates my scripts
... I have the suspicion that the resizing of this card (I mean the resizing of the stack as you are in this card) conflicts with some attribute of some of the card's object. My uneducated guess is that this attribute may be a "fixed location" or some object's geometry of sorts but (If the guess is sound) how can you detect which object is conflicting with the resizing? (there's more than a hundred objects in that card alone)
Re: Why resizing a stack terminates my scripts
More info, in the hope somebody can give it a meaning.
If I put a line that resizes the stack inside a openCard instruction, what I normally can read in the message watcher is something like the following:
openCard 5:59:22 PM (61)
tamannoStack 5:59:22 PM (0) --this is the handler containing the resize instruction
cREVGeometryCache 5:59:22 PM (18) --I ask for the location of some stuff
cREVGeometry 5:59:22 PM (0)
resizeStack 5:59:22 PM (3) --the resize stack instruction and...
idle 5:59:23 PM (615) --everything went smooth
BUT in the offending card, the very same hadler produces the following
opencard 6:04:08 PM (0)
tamannoStack 6:04:08 PM (0) --this is the handler containing the resize instruction
cREVGeometryCache 6:04:08 PM (26) --I ask for the location of some stuff
cREVGeneral 6:04:08 PM (1)
cREVGeometry 6:04:08 PM (0) --no "resizeStack" message. Instead, this line appears several times
cREVGeometry 6:04:08 PM (0)
cREVGeometry 6:04:08 PM (0)
cREVGeometry 6:04:08 PM (0)
cREVGeometry 6:04:08 PM (0)
The precise handler is exactly this one
on tamannoStack
put fld "tamannosTarjetas" into tamannosTarjetas
if short name of this card is in tamannosTarjetas
then
get devLin(nCard,tamannosTarjetas) --returns the number in a field where the "right" dimensions of eevry card is stored
put line it of tamannosTarjetas into lalin
get item 2 to 5 of lalin
put the location of this stack into laLoc
set the rectangle of this stack to it
set the location of this stack to laLoc
beep 2 --prueba
end if
end tamannoStack
If I put a line that resizes the stack inside a openCard instruction, what I normally can read in the message watcher is something like the following:
openCard 5:59:22 PM (61)
tamannoStack 5:59:22 PM (0) --this is the handler containing the resize instruction
cREVGeometryCache 5:59:22 PM (18) --I ask for the location of some stuff
cREVGeometry 5:59:22 PM (0)
resizeStack 5:59:22 PM (3) --the resize stack instruction and...
idle 5:59:23 PM (615) --everything went smooth
BUT in the offending card, the very same hadler produces the following
opencard 6:04:08 PM (0)
tamannoStack 6:04:08 PM (0) --this is the handler containing the resize instruction
cREVGeometryCache 6:04:08 PM (26) --I ask for the location of some stuff
cREVGeneral 6:04:08 PM (1)
cREVGeometry 6:04:08 PM (0) --no "resizeStack" message. Instead, this line appears several times
cREVGeometry 6:04:08 PM (0)
cREVGeometry 6:04:08 PM (0)
cREVGeometry 6:04:08 PM (0)
cREVGeometry 6:04:08 PM (0)
The precise handler is exactly this one
on tamannoStack
put fld "tamannosTarjetas" into tamannosTarjetas
if short name of this card is in tamannosTarjetas
then
get devLin(nCard,tamannosTarjetas) --returns the number in a field where the "right" dimensions of eevry card is stored
put line it of tamannosTarjetas into lalin
get item 2 to 5 of lalin
put the location of this stack into laLoc
set the rectangle of this stack to it
set the location of this stack to laLoc
beep 2 --prueba
end if
end tamannoStack
Re: Why resizing a stack terminates my scripts
What happens if you step through the "dummy" script in the debugger? Make sure you step "into", not step "over".
Craig
Craig
Re: Why resizing a stack terminates my scripts
When I step through the "dummy" script in the debugger, the script terminates most ungently likewise
Re: Why resizing a stack terminates my scripts
uh, one more thing. The card missbehaviour occurs only when you try to resize it from the stack script. If you do it from any script in the same card, then alles ist Gut
Re: Why resizing a stack terminates my scripts
News from the "trial and error" front:
I have been able to identify the source of the strange behaviour, but not the cause of it, as doctors use to do.
The cause were two table fields, that's it. I created a dummy, empty card, run a script to copy each and every object from the original card into the new one and soon it turned out those two table fields were the only culprits.
The strange thing is they were rather inane: they contained no script and their only function was to display a visible grid upon which certain objects had to appear. Once I have deleted them, the card resizes as it should do.
I leave the plausible explanations to the gurus of the list.
I have been able to identify the source of the strange behaviour, but not the cause of it, as doctors use to do.
The cause were two table fields, that's it. I created a dummy, empty card, run a script to copy each and every object from the original card into the new one and soon it turned out those two table fields were the only culprits.
The strange thing is they were rather inane: they contained no script and their only function was to display a visible grid upon which certain objects had to appear. Once I have deleted them, the card resizes as it should do.
I leave the plausible explanations to the gurus of the list.
Re: Why resizing a stack terminates my scripts
Would you mind uploading the culprit stack?
Craig
Craig
Re: Why resizing a stack terminates my scripts
Craig, the whole stack is a huge (mean huge) stack with lots of code about very specific projects. I'll be glad to contribute with all kind of implicated scripts but I don't think the whole stack's deposition would add something meaningful to the general cause