[Toc][Index]

Swapping two variables without using a temp. variable



Use the <PARSE instruction to swap the values of two variables without 
using a temporary variable: 

 
/* sample code to swap the values of two variables using PARSE        */

  var1=44
  var2=55
  parse value var1 var2 with var2 var1;

/* use a separator character if the values contain blanks             */
  var1=44 66
  var2=55 77
  parse value var1 || "00"x || var2 with var2 "00"x var1;


  

Created using Inf-PHP v.2 (c) 2003 Yuri Prokushev
Created using Inf-HTML v.0.9b (c) 1995 Peter Childs