PMS Information Systems
Welcome to PMS Information Systems - IBM i (AS/400) Forum !!!

Get Answers for all your queries on IBM i (AS/400).

Join the forum, it's quick and easy

PMS Information Systems
Welcome to PMS Information Systems - IBM i (AS/400) Forum !!!

Get Answers for all your queries on IBM i (AS/400).
PMS Information Systems
Would you like to react to this message? Create an account in a few clicks or log in to continue.

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 Empty Swap the values of two similarly-defined variables without a temporary holding variable

Post  maran Mon Dec 12, 2011 12:57 am

THIS CAN BE ACHIEVED BY USING %BITXOR BIF

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

/free
Var1 = 'PMS INFO';
Var2 = 'INFO PMS';

Var1 = %bitxor(Var1: Var2);
Var2 = %bitxor(Var1: Var2);
Var1 = %bitxor(Var1: Var2);
after this code runs, Var1 has the value "INFO PMS" and Var2 has the value "PMS INFO"
maran
maran
Admin

Posts : 442
Join date : 2009-07-24

https://pmsinformationsystem.forumotion.net

Back to top Go down

Back to top

- Similar topics

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