Well, in whatever way makes sense for your application. There are many ways to do such a thing, mostly touched upon in other posts.
Jim > -----Original Message----- > From: jbase@googlegroups.com [mailto:jbase@googlegroups.com] On Behalf > Of Mike Preece > Sent: Thursday, June 09, 2011 4:36 AM > To: jBASE > Subject: Re: Dynamic array of file pointers? > > > > On May 27, 5:22 pm, Jim Idle <j...@temporal-wave.com> wrote: > > A dynamic array is a C structure internally, not a first class > > primitive value, hence it cannot be stored as an element in a dynamic > > array. You can use a DIM/REDIM for your file descriptor cache and > then > > as there are no Map type things in jBC you will need to create some > > cross reference that tells you where the file descriptor is for a > file > > or whether it needs to be open. Place the variables that do all this > > tracking in COMMON or even named COMMON and you will avoid the OPEN > > overhead. Use CALL MYOPEN(FDSCInd, "File") and have it return the > > index of the file descriptor, which it either opens or locates. Then > > the generic writing routines just use FILECACHE(FDSCInd) and you are > done. > > > > Jim > > How does MYOPEN obtain FDSCInd given "File"? > > > > > > > > > > From: jbase@googlegroups.com [mailto:jbase@googlegroups.com] On > > > Behalf Of Darrin > > > Sent: Thursday, May 26, 2011 12:37 PM > > > To: jBASE > > > Subject: Dynamic array of file pointers? > > > > > Is it possible to store file pointers in a dynamic array? Or is > > > there another way to pass a variable number of file pointers to > > > various functions? > > > > > The problem is that when attempting something like: > > > file_ptrs<-1> = new_file_ptr > > > > > The following error is returned: > > > Invalid or uninitialised variable -- ZERO USED , Var temp_file_ptr > , > > > Line 66 , Source process_gpw_node.b Trap from an error message, > > > error message name = ZERO_USED > > > > > (The variable is defined, it just can't be placed into a dynamic > > > array.) > > > > > The purpose for this is that when recursively walking an xml tree > > > and importing data into jbase, I would like to open files and pass > > > file pointers to between functions. The idea being, to avoid the > > > overhead of opening and closing multiple files when processing each > node. > > > Otherwise, files would be opened and closed thousands of times a > > > second. My assumption is that there would be some serious overhead > > > to this. > > > > > -- > > > Please read the posting guidelines at: > > >http://groups.google.com/group/jBASE/web/Posting%20Guidelines > > > > > IMPORTANT: Type T24: at the start of the subject line for questions > > > specific to Globus/T24 > > > > > To post, send email to jBASE@googlegroups.com To unsubscribe, send > > >email to jbase-unsubscr...@googlegroups.com > > > For more options, visit this group at > > >http://groups.google.com/group/jBASE?hl=en- Hide quoted text - > > > > - Show quoted text - > > -- > Please read the posting guidelines at: > http://groups.google.com/group/jBASE/web/Posting%20Guidelines > > IMPORTANT: Type T24: at the start of the subject line for questions > specific to Globus/T24 > > To post, send email to jBASE@googlegroups.com To unsubscribe, send > email to jbase-unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/jBASE?hl=en -- Please read the posting guidelines at: http://groups.google.com/group/jBASE/web/Posting%20Guidelines IMPORTANT: Type T24: at the start of the subject line for questions specific to Globus/T24 To post, send email to jBASE@googlegroups.com To unsubscribe, send email to jbase-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/jBASE?hl=en