I know I am probably missing something extremely simple in all this, but after reading that entry I thought I could stick the closing location of the stack into a custom property, and then have the app re-open at its last location (usually I use pref files for this sort of thing, but what the heck, I wanted to try something I thought would be simple to explore custom props!).
In card 1 of the main stack, I put :
Code: Select all
on closeStack
// set the last open location of the stack...
set myCustLocProp of the stack "Report" to the location of the defaultStack
end closeStack
Stack "Report" is a substack of my main stack, so if I understand how stacks work correctly, I should be able to write the custom prop. there and it will persist through closing and opening the program. In the IDE this does indeed happen, and it lists the x / y coordinates of the program.
Next, in card 1 I added this, based on this line from the dictionary "set the location of this stack to the mouseLoc", reasoning that if it would use the x / y of the mouseLoc, it would also use the x / y of the cust. prop. :
Code: Select all
on openStack
// put the stack at the last open position...
set the location of this stack to myCustLocProp of stack "Report"
end openStack
However, this produced an error on re-opening the stack:
error "card "frmMain": execution error at line n/a (Object: coordinate is not a point) near myCustLocProp
Undaunted, I tried a few more variations to see if I could figure out what was going wrong on my own. First, I tried reading in the 2 items of the cust. prop. :
Code: Select all
put item 1 of myCustLocProp into tmpX1
put item 2 of myCustLocProp into tmpX2
set the location of this stack to ("tmpX1, tmpX2")
This gave me the same error, now referencing tmpX1 and tmpX2
error "card "frmMain": execution error at line n/a (Object: coordinate is not a point) near "tmpX1, tmpX2"
I tried a few variations of the above two examples, with and without (), "", (""), and so on. To make sure the cust. prop. had the right info, I moved the program around and closed it, and the numbers do appear to record correctly.
When opening it however, it always produces that error, then if you hit stop or continue, the program shows up at the last position indicated by the cust. prop. (figures), but not in the standalone.
Any ideas on what I'm missing?