Progress Programming Tips
By Rod Gaither (rdg@worldinfo.com)
PPT-10 Being a "Nice" Windows application
Tip:
Writing a Windows client requires some additional thought when it
comes to sharing the desktop. There are several things to be aware
of.
1. The MultitaskingInterval setting in your Progress.ini file
This attribute can be set either in the [Startup] section of
the ini file or is available as an attribute to the SESSION
handle. Setting this to a large value degrades your progress
performance but helps make your application cooperate with
> Correction - After all that I forgot to fix this reference.
> The lower the value, except 0, give the other applications more
> chances to process events.
other desktop apps. The nice thing about the SESSION
handle is that you can change the value as you enter certain parts of
your code as needed.
2. Blocking for input - WAIT-FOR/UPDATE
When you are blocking for input your application is automatically
being friendly to other apps. Because Progress is not chewing up
processing power the events are managed evenly and fairly.
3. Tight loops with long processing - big problem
The problem comes when you are in sections of code that have
nothing to do with blocking for input and that run for some time. One
such example might be a loop that executes a compile for every program
in a directory. During this process, which can be lengthy windows is
not getting enough breathing room to handle even a simple mouse click
to change focus from your application to another one.
4. Process Events
This statement can be used inside a loop to allow for event
processing. I don't know if this is for Progress only events
or if it opens up all events a chance to be processed. In any
event it is useful to allow a user to interrupt that tight loop
if they see it is going to take a long time.
5. WAIT-FOR with a PAUSE n
Another option to improve the behavior of your application is
to put a loop around the WAIT-FOR and allow the WAIT-FOR to
drop through every N seconds. This could be used as the
reverse of the PROCESS EVENTS technique in that you do a little
work each time you drop out of the WAIT-FOR.
A Progress client puts a considerable load on the typical Windows PC
so remember to cooperate as much as possible with the other
applications or your users are likely to get very annoyed.
Wisdom:
The value in the internet is not the creation of another business
frontier but in the incredible opportunity for communication of all
types. What the printing press did for passing on long term knowledge
and short term local knowledge the Internet could do for both on a
global scale.
Rod Gaither | rdg@worldinfo.com
World Information Systems | (910) 333-2580 Voice
Greensboro, NC | (910) 333-2584 Fax