Order of statements in a procedure

I have run into a little situation related to the order order of two
statements in a procedure.

I use this procedure to select records to get names and addresses
that are used in the layout of postcards that are then printed.

The postcards are displayed in a separate form window once they are
laid out. This statement, openform “Form - Postcard”, is one of the
last statements in the procedure.

Just after that statement this is the next statement in the procedure,
openform “Form_Display Postcard Printer Settings”. Because I often
forget what the correct printer settings are for this layout, this
statement is used to create a reminder.

Because this print settings reminder window does not have to be very
large, the amount of white space of this window has been removed, and
the tool bar has been hidden.

This procedure worked very well, until the other day when I decided, for
personal reasons, that the print settings form window should open before
the form window that displays the postcards. Once I reversed order of
the two openform statements I had what I was looking for. Except that
now, no matter what I did, Panorama would not retain the dimensions of
the printer settings form window or continue to hide its tool bar. The
display of the list of printer settings was the same in either case.
After playing around with this for a couple of days, I remembered that
this all started after I had reversed the two statements. Once I put
those two statements back in their original order, everything worked as
before and the printer settings form window now retains the adjustments
that I made.

It appears that the form that will be printed needs to be organized and
displayed before the reminder form that displays the printer settings
will be displayed with the window settings I have chosen, but I am not
sure why.

I would appreciate an explanation, if there is one. Thank you.

I do not know of any reason why switching the order of these statements should cause the symptoms you mention.

You can, however, include the window dimensions and toolbar status in the openform statement itself (this is new in Panorama X, you couldn’t do this in Panorama 6). The code would look something like this:

openform "Postcard Printer Setting","toolbar","no","rectangle",rectanglesize(100, 150, 400, 200)

For further detail, see this help page:

  1. You could avoid opening a second form by using a nsnotify statement for your Print Settings reminder.

  2. You do not need to remember and to change any print setting when you make use of the printtopdf statement and its options.

Jim, thank you for that advice. It is perhaps strange to see this kind of behavior in a program when the two commands do not appear to have any connection each other. I will give your suggestion a try and will also use it in the future when I feel the need to set the dimensions of other form windows.

And thank you, Kurt, for the points you have made. I will explore nsnotify, something I am not acquainted with. I will have to see how it behaves and looks on the screen when it is displayed. So far, I have not needed to use printtopdf. Up to now, I have had my procedures stop at printpreview or I have printed manually once the from to be printed was displayed. This has allowed me to make sure the printer settings were set properly, but now that I have settled in using Panorama I will experiment with printtopdf to see if it will help smooth out the printing task.

Wishing every one a happy and healthy New Year.

Jim, I am now acquainted with the finer details of the openform statement. I modified my statement so it positions the form window out of the way in the upper right corner of the screen, modifies the form window title, sets the form window to a rectangle that is just big enough to show all of the text, and hides both the menu bar and the scroll bars. This is very neat. It does away with many little annoyances that I created. I plan to take a hard look at the other windows that are created and tidy them up.

Kurt, I have played around with nsnotify . It is a very nice feature that I will probably use in the future, but it did not fit in well in this case because my two lists of printer settings consists of 13 and 17 lines of text. Later, when I have more confidence printing these forms, I may pare down the amount of text and set nsnotify to work. I also played around with printtopdf . I may be able to put it to use once I test some code that sets the printing parameters that are needed to produce the results I am looking for.

I appreciate all the help.