Page 1 of 1

Works while in IDE but not when compiled..

Posted: Sat Nov 15, 2008 9:00 pm
by Garrett
So I have a button sitting around to use as a template to dynamically generate a menu when my stack starts up. I copy the button to the group, set it's name and other properties, set it's size and position etc...

This worked as it should while in the IDE. But when compiled, it all goes to hell instantly.

The button is copied, but the names, contents, size and positions are not being changed at all in the compiled program.

Is there any reason for this, or have I overlooked something?

Thanks,
~Garrett

Posted: Sun Nov 16, 2008 11:58 am
by Mark
Hi Garrett,

First of all, turn on error reporting in the standalone builder settings.

Second, if you are also setting a script, you might be bumping into script limits.

Third, maybe you have set a password, either as a property of the stack or in the standalone builder settings. If your template stack is password protected, you can't copy from it.

Fourth, make sure that you are referring to your new buttons by ID number or make sure that they all have a unique name.

Best,

Mark

Posted: Sun Nov 16, 2008 8:10 pm
by Garrett
Hi Mark,

1. error reporting for standalone? I'll have to look into this

2. not sure what you mean by "setting a script"

3. no passwords being used, and no template stack.. It's a button that's being used as a template on the main stack. In fact, no other stacks and no other cards. Just one stack and one card here.

4. I've been using "the last button" to do the work. should/would that not work?

Thanks,
~Garrett

Posted: Sun Nov 16, 2008 8:26 pm
by Mark
Hi Garrett,

Setting script means that you set a script by means of a script, like this:

Code: Select all

set the script of btn x to the script of btn y
After copying a button to a group, "the last button" may not work, because the layer of the group may affect the layer of the button.

Best,

Mark

Posted: Mon Nov 17, 2008 3:09 am
by Garrett
Ahhh... No, not setting the script because the template button I have already has the script needed to do what I need.

So, maybe if don't copy it directly to the group.. But just copy the button, get the id, then move it to the group using the id and .. yeah, I'll give that a whirl

Thanks :-)
~Garrett

Posted: Tue Nov 18, 2008 2:17 am
by Mark
Hi Garrett,

You can copy the button directly to the group. Just don't refer to it as "last".

Best,

Mark

Posted: Tue Nov 18, 2008 9:13 am
by Garrett
might have to in order to at least get the id of it for further actions. In fact, I should go give this all a whirl now.

Thanks,
~Garrett

Posted: Tue Nov 18, 2008 10:11 am
by malte
Hi Garrett,

directly after the copy command, the ID of the newly created button will be in the it variable. Try this_

on mouseUp pMouseBtnNo
copy me to grp 1
put it
end mouseUp

Hth,

Malte

Posted: Tue Nov 18, 2008 10:53 am
by Garrett
To late Malte ;-)

I decided to try renaming my template button first and setting it's label, then copy it to the group, then set the name again of the "first button" back to it's template name and label... Then I go back to the new button and set it's position and such. And this seems to have solved my problem.

Thanks to all who replied here, it really helped me out :-)
~Garrett

Posted: Fri Nov 21, 2008 12:29 am
by SparkOut
malte wrote:Hi Garrett,

directly after the copy command, the ID of the newly created button will be in the it variable. Try this_

on mouseUp pMouseBtnNo
copy me to grp 1
put it
end mouseUp

Hth,

Malte
Seems like there's a bug in the standalone builder to me - I have painstakingly built a system which relies on copying template images to new cards and referencing them by collecting the id from the it variable. Works fine in the IDE, only I've just been bitten by the standalone not working, as it seems that after copying the image, "it" contains only "OK".

Posted: Fri Nov 21, 2008 12:32 am
by Mark
hi SparkOut,

Are you sure you aren't using the answer command somewhere?

Best,

Mark

Posted: Fri Nov 21, 2008 12:38 am
by SparkOut
Absolutely sure!
I only found out why my standalone was silently failing after saving a bug report and finding a reference to the line where the object ref was failing.
More delving and troubleshooting later I tracked it down to the wrong result being returned by "it" - but only in the standalone. (I went to QCC and saw your bug ref 7314 too - which oddly is recorded as "not a bug".)

Posted: Fri Nov 21, 2008 12:52 am
by Mark
Hi S.,

The next morning, i found out that I was really copying the wrong object. That's why I closed that bug.

Does it help if you lock messages while you copy? I have just finished a project that is copying objects all the time and it never goes wrong. Although it is possible that there is a bug, I am quite convinced that there is a problem with a script in your stack.

Mark

Posted: Fri Nov 21, 2008 1:01 am
by SparkOut
Lol - yes, my mistake.
I found out the substack had been inadvertantly ticked to encrypt with password in the standalone settings. The mainstack was showing no password protection, so I had overlooked the fact that the substack needs to be selected to see its encryption properties - the encrypt with password checkbox is not a global setting for the whole bundle obviously.
:roll: