Code: Select all
z←foo;f
'f'⎕WC'Form'('Coord' 'Pixel')
f.State←2
z←f.Posn f.Size
Executing this produces a different result than tracing. I assume because the State property really does not take affect until a wait state happens, sure enough:
Code: Select all
z←foo2;f
'f'⎕WC'Form'('Coord' 'Pixel')
f.State←2
f.onClose←1
⎕NQ f'Close'
f.Wait
z←f.Posn f.Size
gives the "correct" result.
First question: is this behavoir of Form.State a bug or a feature?
Second question: the reason I am doing this is to determine the position and dimensions of the monitor the form happens to reside on, which is not necessarily the same as the DevCaps property. Is there some other all-Dyalog (non []NA) way to do it?
Finally, I can do the above work around, no problem, with a slight modification to avoid a flashing, temporary visible form:
Code: Select all
z←foo3;f
'f'⎕WC'Form'('Coord' 'Pixel')
f.AlphaBlend←0
f.State←2
f.onClose←1
⎕NQ f'Close'
f.Wait
z←f.Posn f.Size
If you are wondering why I am not using the Visible property, try it and find out!
Thanks for any comments or suggestions.