qbasic.hlp (Topic list)
SWAP Statement
  Contents  Index  Back
──────────────────────────────────────────────────────────────────────────────
Exchanges the values of two variables.
 
SWAP variable1, variable2
 
    ■ variable1 and variable2    Two variables of the same data type.
 
Example:
    a% = 1: b% = 2
    PRINT "Before: "; a%, b%
    SWAP a%, b%
    PRINT "After: "; a%, b%