> From: David Wolverton 
> In UniData we also make sure the file is opened to a COMMON
> variable. Makes a huge performance difference vs doing the OPEN on
> every call to the subroutine.
> YMMV.... 

> From: Wjhonson 
> I had forgotten that one!

Wow, I thought that was SOP these days across all "new" MV apps of any
size. Then again we hardly ever discuss style and coding patterns in
these forums so it's no surprise that patterns like this aren't as
common as Design Patterns ala GOF.

I never re-open a file if it's used across many programs, and I use
Include items to contain the housekeeping that determines whether to
open the files and to do the opening. I use named common in D3 because
it keeps the files open across level pushing and between TCL
executions. The pattern is:

- Enter into a program
- Move into the Include code
- If current account is not the same as the prior account, set INIT=-1
- Check INIT flag
-- If not set or -1 do all initialization, open files
-- Otherwise just continue
- Return to the "functional" code

These patterns make for small and well organized code. It's easy to
make a single change that affects the entire application (need to get
them right though). Adding new modules is easier because the
housekeeping is already done elsewhere. Optimizations in one place can
impact the entire app.

HTH
T

_______________________________________________
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users

Reply via email to