Swap the values of two similarly-defined variables without a temporary holding variable

Go down

Swap the values of two similarly-defined variables without a temporary holding variable

Post  Archana K on Sun Jan 27, 2013 4:50 pm

THIS CAN BE ACHIEVED BY USING %BITXOR BIF

This code fragment illustrates that technique.
D Var1 s 8a
D Var2 s 8a

/free
Var1 = 'MITH ARG';
Var2 = 'ARG MITH';

Var1 = %bitxor(Var1: Var2);
Var2 = %bitxor(Var1: Var2);
Var1 = %bitxor(Var1: Var2);
after this code runs, Var1 has the value "ARG MITH" and Var2 has the value "MITH ARG"

Archana K

Posts : 76
Join date : 2013-01-27
Age : 27
Location : chennai

View user profile

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum