And be very careful with 4GLs using named common, as I found out many years ago with &PACE. It stored filepointers in named common, generating the common name from the file name.
Fortunately we found the problem when the runtime complained of a redefinition of common (one routine had the same name declared twice), and not by two programs confusing one declaration and thereby writing to the wrong file! Cheers, Wol -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Allen Egerton Sent: 04 April 2008 14:00 To: u2-users@listserver.u2ug.org Subject: Re: [U2] COMMON Dennis Bartlett wrote: > Following up on the common thread, can one OPENSEQ to a COMMON variable? Absolutely. COMMON is merely a method of sharing data between programs without argument passing as is commonly done with subroutines. Note that common in this fashion is accessible among programs for the individual user, not to be confused with "shared common", (such as the catalog uses, which allows users to access the same info). So, any variable can be stuffed into a common block, and it's best to use what's called NAMED COMMON so that you don't collide with anyone else's definitions, (particularly if you're running vendor code which you can't read the source code to). And then any program or routine that has that COMMON block defined within it has acccess to the variables within it. With file pointers, the trick is to set flags so that you know that they're open or closed. Which can be followed through to other variables, set flags to show that they've been initialized or not. Always set them to show non-initialized first, set them, set the flags, then in any routine that uses them, check the flags before you use them, and if the flags aren't set, you can't use the values. One very common way of dealing with this is to call a program from the VOC LOGIN PA which sets common. As has been mentioned previously, watch out for accounts, as showing that your PAYMASTER file is open, and having your user log from TEST to LIVE will give you some very real problems... -- Allen Egerton aegerton at pobox dot com ------- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/ ------- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/