|
SwapIfHigher | ||||
SwapIfHigher NumericVar1, NumericVar2 | ||||
Parameters: NumericVar1 = first numeric variable NumericVar2 = second numeric variable |
||||
Returns: NONE | ||||
SwapIfHigher performs a conditional swap betweem two numeric variables. SwapIfHigher checks If NumericVar1 is greater 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: * SwapIfHigher cannot use string variables. * SwapIfHigher 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: | Float | If | Integer | Swap | SwapIfLower | Variables : |
|
|||||||||||||||||||||||||||||||||||||||
(c) Copyright 2002 - 2024 - Kevin Picone - PlayBASIC.com |