SWAP


Exchanges the values of two variables

Syntax:
declare sub Swap ( byref a as any, byref b as any )

Parameters:
a
A variable to swap.
b
A variable to swap.

Description:
Swaps the value of two variables, including UDT instances (swaps all data members).

Examples:
' using swap to order 2 numbers:
Dim a As Integer, b As Integer

Input "input a number: "; a
Input "input another number: "; b
If a > b Then Swap a, b
Print "the numbers, in ascending order are:"
Print a, b


Differences from QB:
See also:
Back to Memory Functions

Valid XHTML :: Valid CSS: :: Powered by WikkaWiki



sf.net phatcode