Within BASIC, try
array(x)=BITXOR(array(x),array(y));
array(y)=BITXOR(array(y),array(x));
array(x)=BITXOR(array(x),array(y));
It only works with integers. Other real numbers and strings won't work.
--
u2-users mailing list
[EMAIL PROTECTED]
http://www.oliver.com/mailman/listinfo/u2-users
In a message dated 2/13/2004 11:10:14 AM Pacific Standard Time,
[EMAIL PROTECTED] writes:
Within BASIC, try
array(x)=BITXOR(array(x),array(y));
array(y)=BITXOR(array(y),array(x));
array(x)=BITXOR(array(x),array(y));
No temp variable used.
ROFL. Nice way to take a simple process and
It's an 'old as the hills' C programmers' trick
Which is no relection on Glenn of course ...
Brian
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of [EMAIL PROTECTED]
Sent: 16 February 2004 16:47
To: [EMAIL PROTECTED]
Subject: Re: Swap array values
I understand why this works, but honestly, that's nasty.
array(x)=BITXOR(array(x),array(y));
array(y)=BITXOR(array(y),array(x));
array(x)=BITXOR(array(x),array(y));
No temp variable used.
Our company accepts no liability for the content of this email, or for the
consequences of any actions
*lol* i agree it's nasty and not readily obvious as to it's intent, but
that wasn't the question posed...
sometimes it's just to exercise the mind
At 02:36 PM 02/13/2004, you wrote:
I understand why this works, but honestly, that's nasty.
array(x)=BITXOR(array(x),array(y));
UniVerse 10.0.x and higher have the SWAP command in BASIC. Please refer to
our documentation regarding its use.
-- original message --
Is there a command to swap two array contents?
Like matswap array(x,y) will swap the contents of
array(x) - array(y)
and array(y) - array(x)
Without using
6
but it did compile.
I tried swap mat a(1),mat a(2), that did not compile.
-Original Message-
From: Leroy Dreyfuss [mailto:[EMAIL PROTECTED]
Sent: Friday, February 13, 2004 5:18 PM
To: [EMAIL PROTECTED]
Subject: RE: Swap array values? In UV
UniVerse 10.0.x and higher have
PROTECTED]
Sent: Friday, February 13, 2004 5:18 PM
To: [EMAIL PROTECTED]
Subject: RE: Swap array values? In UV
UniVerse 10.0.x and higher have the SWAP command in BASIC.
Please refer to
our documentation regarding its use.
-- original message --
Is there a command to swap two array contents?
Like
Of Glenn Herbert
Sent: Friday, February 13, 2004 2:25 PM
To: U2 Users Discussion List
Subject: RE: Swap array values? In UV
*lol* i agree it's nasty and not readily obvious as to it's intent, but
that wasn't the question posed...
sometimes it's just to exercise the mind
At 02:36 PM 02/13/2004, you
PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Glenn Herbert
Sent: Friday, February 13, 2004 2:25 PM
To: U2 Users Discussion List
Subject: RE: Swap array values? In UV
*lol* i agree it's nasty and not readily obvious as to it's intent, but
that wasn't the question posed...
sometimes it's just
10 matches
Mail list logo