home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
HomeWare 14
/
HOMEWARE14.bin
/
prog
/
ks94an.arj
/
DUPREC.HDR
< prev
next >
Wrap
Text File
|
1994-04-24
|
2KB
|
77 lines
/******************************************************************************
The Klipper Library, for CA-Clipper 5.x
Copyright (c), 1994, Wallace Information Systems Engineering
FUNCTION:
_DupRec( cSource_Area, cTarget_Area, l_move, l_Append ) --> lAppendStatus
PARAMETERS:
cSource_Area : Alias of area to copy FROM (If Blank, assumed current area)
cTarget_Area : Alias of area to copy TO (If blank, assumed current area)
l_Move : TRUE = Copy and Delete from Source Area (MOVE)
: FALSE = Copy but do not delete in Source area (COPY) (DEFAULT)
l_Append : TRUE = Append Record to TARGET->EOF DEFAULT
: FALSE = REPLACE Current Target Record
SHORT:
Copy, optionally MOVE, records between work areas.
DESCRIPTION:
_DupRec() copies (and optionally MOVES) records from one database to another.
The source and target databases must be specified by ALIAS. Source fields
that do not exist in the target database are ignored.
If l_Move = TRUE, the Source record is deleted after being copied to the
Target Record, effecting a MOVE. If l_Move = FALSE, then the Source record
is retained.
If l_Append = TRUE, a blank record is appended to the end of the Target
Database and the Source record is copied to this appended record. If
l_Append = FALSE, the Source record is copied onto the current record in the
Target database, overwriting it!!! This is useful for updating records in one
database with new information in another. You will need to SEEK the desired
Target Record before calling _DupRec() in this case.
_DupRec() returns FALSE if the Target Area cannot be appended to, otherwise
it returns TRUE.
NOTE:
EXAMPLE:
Select 1
USE data1 ALIAS First
Select 2
USE data2 ALIAS Second
Select 1
GOTO TOP
_DupRec('FIRST','SECOND',.t.)
Result: All common fields from the top record in data1 are copied
to data2, and the data1 record is deleted.
Select 1
USE data1 ALIAS First
GOTO TOP
_DupRec()
Result: Record is duplicated WITHIN data1, resulting in TWO records in
the same database.
******************************************************************************/