that's really neat...

I was hoping for a builtin function though.
Since my array isn't that large, I don't think I'd see
any speed differences between

temp=array(x) ; array(x)=array(y) ; array(y)=temp

and the XORing.

although down the road, if someone had no clue what XOR did
or why it works, it might be harder to maintain the XOR method.

Personally, I like XOR, I think it's one of the most underused
bit manipulation fuctions out there.

George

>-----Original Message-----
>From: Glenn Herbert [mailto:[EMAIL PROTECTED]
>Sent: Friday, February 13, 2004 2:03 PM
>To: U2 Users Discussion List
>Subject: Re: Swap array values? In UV
>
>
>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.
>
>
>At 01:38 PM 02/13/2004, you wrote:
>>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 a temp varible. Yes I know I can do it
>>that way.
>>
>>Thanks
>>George
>>
>>George Gallen
>>Senior Programmer/Analyst
>>Accounting/Data Division
>>[EMAIL PROTECTED]
>>ph:856.848.1000 Ext 220
>>
>>SLACK Incorporated - An innovative information, education and 
>management
>>company
>>http://www.slackinc.com
>>
>>--
>>u2-users mailing list
>>[EMAIL PROTECTED]
>>http://www.oliver.com/mailman/listinfo/u2-users
>
>-- 
>u2-users mailing list
>[EMAIL PROTECTED]
>http://www.oliver.com/mailman/listinfo/u2-users
>
-- 
u2-users mailing list
[EMAIL PROTECTED]
http://www.oliver.com/mailman/listinfo/u2-users

Reply via email to