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.

I have been exploring the suggestions that Jim and Kurt recently made to see if there was a way to smooth out the printing of the post cards that my database produces. The most frequent problem has been getting the output formatted properly on paper.

I have been manually changing these settings, Landscape and Portrait, because there are other documents that I print that require a different orientation. But I sometimes forget to check first and have to run the procedure a second time after making a change to the correct orientation. In the procedure, printpreview would display the resulting selection in Preview, and then I would use Preview’s Print menu to make any changes to the orientation. However, the orientation settings in Preview do not override the orientation settings in Panorama’s Page Setup menu, so if they were not set correctly I would have to start all over again. Early on, when the postcards were presented in Landscape orientation, I did not pick up on that connection and it would sometimes take a while before I remembered to check the settings in Page Setup. It was all very confusing.

As I mentioned earlier, I set the procedure to open up a small Form window that listed all of the desired print settings, as they were set in both Page Setup and Preview’s Print menu. I did not see what was actually happening until today while I was working with the printtopdf statement. I now have printtopdf , set to portrait orientation, make a temporary file that I can inspect, and printpreview then displays the output from Panorama to Preview. When I ran the procedure with Page Setup set to Landscape, I finally saw the difference. The new file was in Portrait mode, and the display from Panorama to Preview was in Landscape mode. Now I have no need for the Form that displayed the print settings, and, if I can remember to put the postcard paper in the printer first, I will set the procedure to immediately print the postcards instead of making a temporary file.

Panorama is never dull. There is always something new to learn.