Page 1 of 1

No such object error when stack opens

Posted: Fri May 31, 2013 12:18 pm
by Terryfic
Hi All

I am getting the following error when I first open my stack:

_executing at 11:23:04 AM
Type_Chunk: no such object
Object_Slidercode
Line_put the round of tunits into field manfld2
Hint_Man@

I think I know why it is happening but I'm not sure how to deal with the issue.

The button 'slidercode' holds script that is set as a property for numerous other controls in the application. One of the sections of this script in the mousemove event is:

put numtochar(qnum + 64) into manfld
put "Man"&manfld into manfld2
put the round of tunits into field manfld2

This simply evaluates the name of the field to ManA, ManB, ManC, etc. up to ManL, depending on the value of qnum (a number between 1 and 12).

I am assuming that when the stack opens, before qnum has been set that it has a value of 0, which would explain why the value of manfld2 is evaluating to Man@, because numtochar(0+64) is @.

What I don't understand is why it is even trying to evaluate manfld2 when the stack first opens, before the app is in run mode or the mouse has been moved into the controls that set the value of qnum?

As long as I stay away from the 'slidercode' button (or make it invisible) the application works fine, but it is the error on opening the stack that I don't get.

Incidentally, I have gone down the route of just making the field names Man1, Man2, etc. but that caused a whole new set of problems.

Any help would be much appreciated.

Regards

Terry

Re: No such object error when stack opens

Posted: Fri May 31, 2013 1:53 pm
by dunbarx
Is the error in a handler in an openStack or preOpenstack script?

Craig Newman

Re: No such object error when stack opens

Posted: Fri May 31, 2013 2:02 pm
by Klaus
Sounds like he has a BUTTON with a "mousemove" handler that is causing this, right?

Does this happen in a standalone?
How do you open the stack: via the "Open" dialog or doubleclicking on the desktop?
Can't oyu just check if -> qnum <> 0 or empty or whatever it should NOT be before
concatenating the fields name?

Re: No such object error when stack opens

Posted: Fri May 31, 2013 3:05 pm
by Terryfic
Sorry guys - I think I've solved the problem. Because the value of qnum is set by a mouseenter event and there is also a mousemove event that contains the script that determines the name of the field, the movement of the mouse into the control was triggering the mousemove handler, where qnum would still be 0.

Amazing what you can work out if you stare at the screen for long enough. :)

Regards

Terry