Syntax
[b,a]=flipvar(a,b)
Input Parameter
a : | | Variable A |
b : | | Variable B |
Output Parameter
b : | | Variable B |
a : | | Variable B |
Examples
a=4; b=5; [b,a]=flipvar(a,b)
Copyright 2013-2025 Tim C. Lueth. All rights reserved. The code is the property of Tim C. Lueth and may not be redistributed or modified without explicit written permission. This software may be used free of charge for academic research and teaching purposes only. Commercial use, redistribution, modification, or reverse engineering is strictly prohibited. Access to source code is restricted and granted only under specific agreements. For licensing inquiries or commercial use, please contact: Tim C. Lueth
Algorithm (Workflow)
This function, flipvar
, is a simple utility designed to swap the values of two input variables. It is part of the SolidGeometry library and was introduced in version 1.1. The function is authored by Tim Lueth and is categorized under auxiliary procedures.
Input Parameters
- a: Variable A, which is one of the two variables to be swapped.
- b: Variable B, the second variable to be swapped with Variable A.
Output Results
- b: After execution, this will hold the original value of Variable A.
- a: After execution, this will hold the original value of Variable B.
Algorithm Explanation
The function flipvar
operates by temporarily storing the value of the first input variable, a
, in a temporary variable x
. It then assigns the value of the second input variable, b
, to a
. Finally, it assigns the value stored in x
(originally from a
) to b
. This effectively swaps the values of a
and b
.
Example
Consider the following example where a = 4
and b = 5
. After calling [b,a] = flipvar(a,b)
, the values will be swapped such that b = 4
and a = 5
.
Algorithm explaination created using ChatGPT on 2025-08-18 22:08. (Please note: No guarantee for the correctness of this explanation)
Last html export of this page out of FM database by TL: 2025-09-21