At 01:03 PM 1/28/2013, Stephen Markson wrote:
Thanks Razzak,
Is it possible to detect if a file is open?
You are welcome, Stephen!
TTBOMK, currently, there is no function available to detect if an external
file is open or not. Thus, the reason to provide you with a sample code to
help you take advantage of R:BASE functions in a multi-user environment.
Having said that, as you may know, nothing is impossible!
Very Best R:egards,
Razzak.
> -----Original Message-----
> From: [email protected] [mailto:[email protected]] On Behalf Of A.
> Razzak Memon
> Sent: Monday, January 28, 2013 12:45 PM
> To: RBASE-L Mailing List
> Subject: [RBASE-L] - Re: Is a file Open?
>
> At 11:27 AM 1/28/2013, Stephen Markson wrote:
>
> >How does one check if a file is open (in use)?
> >
> >If you do R> OUTPUT somefile, or R> PRINT reportname OPTION
> PDF|FILENAME
> >somefile, and someone has the file open, then nothing is produced.
>
>
> Stephen,
>
> In a multi-user environment, you should adapt the technique to
> dynamically
> create a unique file name to avoid such instances.
>
> You may use the new (CVAL('GUID')) function to create a unique file
> name.
>
> Here are two simple examples that you may modify and adopt, if you wish.
>
> -- Example 01
> -- Using R:BASE eXtreme 9.5 (64)
> IF (CVAL('DATABASE')) <> 'RRBYW18' OR (CVAL('DATABASE')) IS NULL
> THEN
> CONNECT RRBYW18 IDENTIFIED BY NONE
> ENDIF
> CLEAR VARIABLE vPDFFileName
> SET VAR vPDFFileName TEXT =
> ((CVAL('NetUser'))+'_'+(CVAL('GUID'))+'.PDF')
> PRINT InvoiceSummary +
> OPTION PDF +
> |FILENAME .vPDFFileName +
> |SHOW_CANCEL_DIALOG ON +
> |TITLE Running R:BASE Your Way! +
> |SUBJECT Invoice Summary +
> |AUTHOR R:BASE eXtreme 9.5 +
> |KEYWORDS Invoice Summary +
> |OPEN ON
> CLEAR VARIABLES vPDFFileName
> RETURN
>
> -- Example 02
> -- Using R:BASE eXtreme 9.5 (32)
> IF (CVAL('DATABASE')) <> 'RRBYW18' OR (CVAL('DATABASE')) IS NULL
> THEN
> CONNECT RRBYW18 IDENTIFIED BY NONE
> ENDIF
> CLEAR VARIABLE vPDFFileName
> SET VAR vPDFFileName TEXT = +
> ((CVAL('NetUser'))+'_'+(FORMAT(.#NOW,'MMDDYYYY_HHNN'))+'.PDF')
> PRINT InvoiceSummary +
> OPTION PDF +
> |FILENAME .vPDFFileName +
> |SHOW_CANCEL_DIALOG ON +
> |TITLE Running R:BASE Your Way! +
> |SUBJECT Invoice Summary +
> |AUTHOR R:BASE eXtreme 9.5 +
> |KEYWORDS Invoice Summary +
> |OPEN ON
> CLEAR VARIABLES vPDFFileName
> RETURN
>
> Hope that helps!
>
> Very Best R:egards,
>
> Razzak.
>
> www.rbase.com
> www.facebook.com/rbase
>