× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Okay, now less than fun.

I know that this isn't exactly cricket, but I tried to do something "clever"
and got burned.

In order to allow a gradual move from a called subprogram to a procedure, I
thought I'd do the following:

1. Put all the primary code in a procedure
2. Export the procedure
3. In the subprogram mainline, simply put a call to the procedure

This way, other modules could either call the procedure directly, or call
the subprogram passing in the parameters.  I'd be able to wean my programs
off of the subprogram call and onto the procedure one at a time.  This
seemed like a good idea.

Until I did this on a program with a file.  It seems that no combination of
things I tried will allow me to intermix calls to a procedure and calls to
the mainline.  I started out by getting "File already open or in error"
(CPF4132) in the *INIT of the subprogram.  Next, I tried making the files
USROPN, and opening them once in the subprocedure based on a static
variable.  Still errors in the subprogram call.  I finally went so far as to
check to see if the file was open using the %open BIF, and then if not
attempting to open the file, but when I come through the mainline, I get
CPF4132.

Evidently, there is some mismatch between the *INIT and the procedure.  I'll
just break the code into a callable subprogram which in turn calls the
module, but I just thought I'd share this little bit of information.

Joe



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.