Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- NetLib for Clipper, Version 6.0 - n_readonly( [ <lsetting> ] ) http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
N_READONLY( [ <lSetting> ] )


Parameters

<lSetting>
Logical true sets read-only mode On. Files subsequently opened with USE 
or N_USE() cannot be updated.

Logical false sets read-only mode Off. Files will be opened in 
read/write mode.


Returns

Current setting, as a logical data type.


Description

Clipper normally attempts to open database files in read/write mode. 
This will result in an error if a file's read-only attribute has been 
set On, or if the current user has read-only rights in the directory.

Settings passed in a call to N_READONLY() apply only to files opened 
after the call. Currently open files are not affected.

N_READONLY(.T.) directs NetLib to open files in read-only mode. Any 
updates made to files opened in read-only mode will be ignored. If you 
open database files while read-only is On, you should also opened any 
associated index files that you plan to use.

Set read-only mode On only when needed and then immediately turn it Off 
by calling N_READONLY(.F.).


Example

* ZIP.DBF has been marked read-only.
lSaveSetting = N_READONLY()
N_READONLY(.T.)
USE Zip
IF N_ERROR() = 0
   SET INDEX TO State
ENDIF
N_READONLY(lSaveSetting)



See Also: N_FATTRSET() N_RIGHTS() N_USE()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson