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_xreplace()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
N_XREPLACE()
Replace field(s) in current record buffer with specified data

Syntax
N_XREPLACE(<Field1>, <Data1> [, <Field2>, <Data2> ...])

RDD
Use REPLACE or DBREPLACE()

Arguments
<Field> is a field name, specified by name or by field number. If you use a 
field name, case is ignored.

<Data> is a value to store to the corresponding <Field>.

You can replace multiple fields with one N_XREPLACE() by repeating the 
construction: <Field>, <Data>.

Returns
True if successful. False on failure. Use N_XERROR() to get an error code.

Remarks
Works similarly to the Clipper REPLACE command. Stores data into the 
specified field of the record buffer in the current area.

RaSQL will not write the modified record out to disk until followed up by 
N_XUPDATE() or N_XINSERT().

N_XREPLACE will fail if you specified an invalid field, or if the data types 
of the field and the replacement value are inconsistant (e.g., trying to 
replace a numeric field with a date value).

If you replace a character field with a "trimmed" value, RaSQL pads the 
remainder of the field with spaces if type 'C' or binary zeros if type 'CZ' 
or 'CL'.  In addition, RaSQL will trim trailing blanks from the end of a CZ 
field, but not from a CL field.

Example
@ 1, 0 SAY 'Address:' GET M->lname
@ 2, 0 SAY 'City   :' GET M->fname
READ
N_XREPLACE('last_name', lname, ;
           'first_name', lfname)
N_XUPDATE()


See Also: N_XFETCH() N_XINSERT() N_XNUM()

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