Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- RaSQL/B 6.1a for Clipper - <b>n_xhardwrite()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
N_XHARDWRITE()
Select Btrieve's or Clipper's write

Syntax
N_XHARDWRITE([<lSetting>>])

RDD Syntax
SET HARDWRITE on|OFF

Argument
<lSetting> is the desired setting. The default is .F. or OFF, and is assumed 
if the argument is omitted.

Returns
Current setting as a logical.

Remarks
This function affects the APPEND BLANK or APPEND from commands. Normally 
Clipper adds new records in a twostep process: first a blank record is 
written, and then later a populated record is rewritten after the data is 
replaced. The reasons for doing this generally do not exist in Btrieve, but 
RaSQL continues to use this method for consistency with Clipper. However, by 
setting N_XHARDWRITE(.F.) or SET HARDWRITE OFF, RaSQL will write a the new 
record out only after it has been populated with data (e.g., with REPLACE). 
This can save a significant amount of I/O overhead when adding large numbers 
of records. Thus, unless there is a specific reason not to, you should SET 
HARDWRITE OFF during an APPEND FROM.

Note that if APPEND BLANK is issued with HARDWRITE OFF, then the newly added 
record is a "phantom" record until it is populated with data and COMMITed. 
It has no physical location and the value returned by RECNO() will be 
invalid.

Examples
SET HARDWRITE ON
APPEND BLANK            // Blank record appended
REPLACE ... WITH ...
COMMIT                  // Overwritten with data

SET HARDWRITE OFF
APPEND BLANK            // No i/o
REPLACE
COMMIT                  // Populated record
                        // appended


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