Skip to content

SWAPVAL ​

Used in a JUSTAFTER to replace a field in any table with a specified value, or another field's value, for all records in a report cursor.

Reporting Area(s) ​

General

Required Parameters ​

  1. Table which contains field to stamp (i.e." NAMES", "COURSE", "REGISTER","PAY")
  2. Field in which to stamp value (i.e. 'nmorg', 'cocoord', 'rggrade','pyaccount')
  3. Field which contains value to stamp (i.e. 'nmbirth', 'rgupdate') When using a date as a replacement value, you must enclose it in quotes, ie: "DATE()" or "CTOD([01/30/2015])"

--OR-- Character expression to stamp in field-in brackets (i.e. ["A"]).

Optional Parameters ​

  1. Logical .t. if stamping a UDF field, .f. if not stamping UDF

Example(s) ​

JUSTAFTER("=SWAPVAL('NAMES','nmsuff',['PhD'])") replaces Suffix with PhD

JUSTAFTER("=SWAPVAL('NAMES','nudfd3','nmbirth',.T.)") replaces the Names UDF date field # 3 with value of the Birthday field

Notes ​

This POWERFUL (and dangerous) function MUST BE USED with caution. ALWAYS BACK-UP BEFORE USING THIS FUNCTION.