This is part of the HicEst documentation
>< HicEst SWAP operator
The swap operator swaps the values of the left-hand side and the right hand side.
⇾Home
⇾Contents
⇾more Programming
⇾ Examples
Bookmarks:
⇾file_sections
Numerical scalars:
x = 1
y = 2
x >< y
! x is now == 2, y is now == 1
x >< y
! x is again == 1, y is again == 2
Strings
, only affected string sections are swapped:
CHARACTER
S3="ABC", S6="uvwxyz"
S3 >< S6
S3 truncated to "uvw"
S6 set to "ABCxyz"
S6(2:3) >< S6(5:6)
S6 is now "AyzxBC"
Arrays
, only affected array sections are swapped:
REAL
:: N4(4), M35(3,5)
N4 = 1 /
$
1 0.5 0.3333 0.25
M35 =
$
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
N4 >< M35
N4 1 2 3 4
M35
1
0.5
0.3333
0.25
5
6
7
8
9
10
11
12
13
14
15
N4(3) >< M35(1,3)
N4 1 2 0.3333 4
M35
1
0.5
3
0.25
5
6
7
8
9
10
11
12
13
14
15
file_sections
(see also
MatrixExplorer
):
CHARACTER
testfile="TEST.txt"
OPEN
(FIle=testfile, Format=",/")
! testfile is opened as a 3-column CSV text-file (columns separated by comma)
testfile(1234, 1) >< testfile(4321, 2)
! 2 elements swapped
⇾
Support HicEst
⇾
Impressum
©2000-2019 Georg Petrich, HicEst Instant Prototype Computing. All rights reserved.