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 ​
- Table which contains field to stamp (i.e." NAMES", "COURSE", "REGISTER","PAY")
- Field in which to stamp value (i.e. 'nmorg', 'cocoord', 'rggrade','pyaccount')
- 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 ​
- 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.