The only thing we do also, which others may have commented on, is to add the
ACCOUNT into the 'search' - otherwise, if the user logs from LIVE to TEST,
and the file names are the same, you are writing and reading from your LIVE
data since the file name was 'found' in the list.  So our 'locate' is
ACCOUNT*FILENAME... Or if you want, store the account elsewhere in COMMON,
and if not the same, clear the DIM structure.

DW 
>
> > -----Original Message-----
> > From: [EMAIL PROTECTED]
> > [mailto:[EMAIL PROTECTED] On Behalf Of Scott 
> > Ballinger
> > Sent: Thursday, January 24, 2008 11:37 AM
> > To: u2-users@listserver.u2ug.org
> > Subject: Re: [U2] Universe 20.1 itype perf enhancer
> >
> > Hi John,
> >
> > As you surmised, this is not a new trick. Here is my version:
> >
> > SUBROUTINE OPEN.FILE.SUB(FILENAME,FILEVAR,ERROR)
> > * open filename to filevar, keep opened files in named common
> > * 01-20-01 asb
> > COMMON /OPEN.FILE.SUB/ FILENAMES,FILEVARS(1000) IF 
> ASSIGNED(FILENAMES) 
> > ELSE  FILENAMES = ""
> > END
> > ERROR = ""
> > LOCATE(FILENAME,FILENAMES;POS) THEN
> >  FILEVAR = FILEVARS(POS)
> > END ELSE
> >  OPEN FILENAME TO FILEVAR THEN
> >    IF POS LE 1000 THEN
> >      FILENAMES<POS> = FILENAME
> >      FILEVARS(POS)  = FILEVAR
> >    END
> >  END ELSE
> >    FILEVAR = ""
> >    ERROR = 1
> >    CRT @(0):"ERROR! can't open ":FILENAME:@(-4)  END END RETURN
> >
> > In use, you CALL OPEN.FILE.SUB("MYFILE",FILEVAR,ERR) ; IF 
> ERR THEN ....
> >
> > Interestingly, on D3 this does not seem to have much benefit, where 
> > the OPEN function seems faster than the LOCATE.
> >
> > /Scott Ballinger
> > Pareto Corporation
> > Edmonds WA USA
> > 206 713 6006
-------
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/

Reply via email to