Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

[ Image Removed |../../index.htm#lansa/ladtgubd_0015.htm]
You are here:

...

Some correct examples of VC_USING commands follow.
Example 1: Accumulate real fields TOT01 -> TOT05 into virtual field TOTAL:
    C*
    C* VC_USING FIELDS(TOT01 TOT02 TOT03 TOT04 TOT05 TOTAL)
    C*
    C                     Z-ADDTOT01     TOTAL
    C                     ADD  TOT02     TOTAL
    C                     ADD  TOT03     TOTAL
    C                     ADD  TOT04     TOTAL
    C                     ADD  TOT05     TOTAL
Some points to note about this example are:

...

If this example virtual field code section was actually compiled into the file I/O module it would look something like this:
  FIELD REPLACEMENT VALUES USED FOR THIS SECTION OF USER CODE
  *
  *  Field name as     Field name as in   Internal field name
  *in file definition  user RPG code      used as replacement
  *-----------------  --------------   ------------------
  *       TOT01              TOT01              @F0001
  *       TOT02              TOT02              @F0002
  *       TOT03              TOT03              @F0003
  *       TOT04              TOT04              @F0004
  *       TOT05              TOT05              @F0005
  *       FULLTOTAL          FFFFFF             @F0006
  *
 C                     Z-ADD@F0001    @F0006
 C                     ADD  @F0002    @F0006
 C                     ADD  @F0003    @F0006
 C                     ADD  @F0004    @F0006
 C                     ADD  @F0005    @F0006
Again the VC_USING command has been replaced by a series of comments that detail exactly what effect it has had on the following code. Also note how all fields listed in the VC_USING command have been replaced by their "internal" names, particularly the name "FFFFFF".
[ Image Removed |../../index.htm#lansa/ladtgubd_0015.htm]