Sometimes it is not good idea to keep uncontrolled the size of the supporting dynamic array with file names that is used to locate the position of the file. It is better to set the size to reasonable value and to rotate the elements. Keeping too many elements in the dynamic array will usually slow down the LOCATE results and after that the OPEN becomes faster.
On May 27, 6:43 pm, "Mark Hogden" <[email protected]> wrote: > JIMI beat me too this, but that's what we do. We keep a list of opened files > in a dynamic array and a dimensioned array for the file variables, both in > COMMON. A routine locates the file name in that array and returns the number > of the file, or opens the file and then returns the number. The files are > only opened once and the locate code is quick. YMMV. > > ListOfFiles = file1:@am:file2 > DIM ArrayOfFiles(nnn) > > Locate newfilename in ListOfFiles setting FileNumber ELSE > OPEN etc, etc > END > > Read/write/delete ArrayOfFiles(FileNumber) > > > > -----Original Message----- > From: [email protected] [mailto:[email protected]] On Behalf Of > > Darrin > Sent: Friday, May 27, 2011 8:50 AM > To: jBASE > Subject: Re: Dynamic array of file pointers? > > Oops, it appears that jbase doesn't allow dimensioned arrays to be > passed as function parameters. > > Is there another solution? Or is it best simply to pass an array of > file names and open/close those files hundreds or thousands of times a > second? It seems like I might be overlooking an obvious solution. > > Common variables would be an option. But I've steered away from in > order to have a more flexible/expandable architecture. The nature of > this data is such that it will change quite frequently. > > -- > 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 [email protected] > To unsubscribe, send email to [email protected] > For more options, visit this group > athttp://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 [email protected] To unsubscribe, send email to [email protected] For more options, visit this group at http://groups.google.com/group/jBASE?hl=en
