|
I am working with procedure pointers. I have written a service program
that I am using to allow me to call procedures dynamically based on user
input. I use a procedure in the service program to "register" some local
procedures within the calling program and assign each a name that will
identify the procedure. These name and pointer are stored in arrays within
my service program, and are given the same index. Then I use a "handle"
procedure to call the correct procedure based on its assigned name. This
allows the procedure to be called by a variable. I use %lookup to find the
name that matches the variable, and use that index to fetch the
corresponding pointer from the pointer array. So far, this all seems to be
working as intended.
The problem has to do with files not being opened when the procedure is
called. The first thing my program does is open the file it needs. Then
it registers the exposed procedures, retrieves input and finally uses my
"handle" procedure to call the right procedure. This is where the problem
occurs. The right procedure is called, but I get a "I/O operation was
applied to closed file ..." message when I attempt to access the file. The
program is using a named activation group and everything is running within
the same job, so I am not sure why the file would be closed. Any idea why
I would open this file, and then when call a procedure with in the same
program, it tells me the file is closed?
Matt
______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
______________________________________________________________________
As an Amazon Associate we earn from qualifying purchases.
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.