|
SwapIfLower | ||||
SwapIfLower NumericVar1, NumericVar2 | ||||
Parameters: NumericVar1 = first numeric variable NumericVar2 = second numeric variable |
||||
Returns: NONE | ||||
SwapIfLower performs a conditional swap betweem two numeric variables. SwapIfLower checks If NumericVar1 is lower than NumericVar2, if so, it swaps the contents of the two variables. if not, they are left unchanged. If the data typse of both variables are not the same, PlayBASIC will cast them automatically. So you can swap between an Integer and Float variables, But that's not recommended. FACTS: * SwapIfLower cannot use string variables. * SwapIfLower performs a conditional exchange between two variables, so it's short hand for the following.
is the same as,
Mini Tutorial:
This example would output.
|
Related Info: | If | Swap | SwapIfHigher : |
|
|||||||||||||||||||||||||||||||||||||||
(c) Copyright 2002 - 2024 - Kevin Picone - PlayBASIC.com |