Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Artful Two for Clipper 5.0 - Norton Guide http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]

Syntax

RPL( [ acNewData[, lRelFlag ]] )

Purpose

A generalised REPLACE function.

Arguments

     acNewData -- If an array, values to write to the current record of the
                  current table, otherwise, a one-character prefix
                  indicating the memvars to write back to the table;
                  defaults to "m"

     lRelFlag -- If passed, whether to replace relational-key fields in
                 related tables. Defaults to !is_append.

Setup

RPL() requires either that memvars for the fields in the selected table
have been created, usually conforming to the pattern "m" + fieldname
(created automatically within GET_STD() and GET_STD2()), or that its first
parameter be an array of values, one for each field.

RPL() also requires the variable is_append to determine the current
add/edit status, and THE_USUAL()'s arrays u_*[] to determine which related
tables need key updates.

Example

This example duplicates the current record.

     is_append := .T.

     FOR i = 1 TO FCOUNT()
         v  := "m" + FIELD( i )
         &v := FIELDGET( i )
     NEXT

     IF ADDREC()
         RPL()
     ENDIF

Returns

.T.

Side Effects

Crash if the memory variables do not match the field names. Key field
updates cause corresponding updates in the keys of child files.

Artful Calls

AEMPTY

Source File

AA_RPL.PRG

See Also: THE_USUAL() GET_STD2() GET_STD()

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