home *** CD-ROM | disk | FTP | other *** search
/ HomeWare 14 / HOMEWARE14.bin / prog / ks94an.arj / DUPREC.HDR < prev    next >
Text File  |  1994-04-24  |  2KB  |  77 lines

  1. /******************************************************************************
  2.                  The Klipper Library, for CA-Clipper 5.x
  3.         Copyright (c), 1994, Wallace Information Systems Engineering
  4.  
  5. FUNCTION:
  6.  
  7. _DupRec( cSource_Area, cTarget_Area, l_move, l_Append ) --> lAppendStatus
  8.  
  9. PARAMETERS:
  10.  
  11. cSource_Area : Alias of area to copy FROM (If Blank, assumed current area)
  12.  
  13. cTarget_Area : Alias of area to copy TO (If blank, assumed current area)
  14.  
  15. l_Move   : TRUE = Copy and Delete from Source Area (MOVE)
  16.          : FALSE = Copy but do not delete in Source area (COPY) (DEFAULT)
  17.  
  18. l_Append : TRUE = Append Record to TARGET->EOF DEFAULT
  19.          : FALSE = REPLACE Current Target Record
  20.  
  21. SHORT:
  22.  
  23. Copy, optionally MOVE, records between work areas.
  24.  
  25. DESCRIPTION:
  26.  
  27. _DupRec() copies (and optionally MOVES) records from one database to another.
  28.  The source and target databases must be specified by ALIAS.  Source fields
  29. that do not exist in the target database are ignored.
  30.  
  31. If l_Move = TRUE, the Source record is deleted after being copied to the
  32. Target Record, effecting a MOVE.  If l_Move = FALSE, then the Source record
  33. is retained.
  34.  
  35. If l_Append = TRUE, a blank record is appended to the end of the Target
  36. Database and the Source record is copied to this appended record.  If
  37. l_Append = FALSE, the Source record is copied onto the current record in the
  38. Target database, overwriting it!!! This is useful for updating records in one
  39. database with new information in another.  You will need to SEEK the desired
  40. Target Record before calling _DupRec() in this case.
  41.  
  42. _DupRec() returns FALSE if the Target Area cannot be appended to, otherwise
  43. it returns TRUE.
  44.  
  45. NOTE:
  46.  
  47.  
  48.  
  49. EXAMPLE:
  50.  
  51. Select 1
  52. USE data1 ALIAS First
  53.  
  54. Select 2
  55. USE data2 ALIAS Second
  56.  
  57. Select 1
  58.  
  59. GOTO TOP
  60. _DupRec('FIRST','SECOND',.t.)
  61.  
  62. Result: All common fields from the top record in data1 are copied
  63. to data2, and the data1 record is deleted.
  64.  
  65.  
  66. Select 1
  67. USE data1 ALIAS First
  68.  
  69. GOTO TOP
  70. _DupRec()
  71.  
  72.  
  73. Result: Record is duplicated WITHIN data1, resulting in TWO records in
  74. the same database.
  75.  
  76. ******************************************************************************/
  77.