New topic: 

How To Make a Swap Method

<http://forums.realsoftware.com/viewtopic.php?t=27605>

       Page 1 of 1
   [ 1 post ]                 Previous topic | Next topic         Author  
Message       Frank32           Post subject: How To Make a Swap MethodPosted: 
Fri Apr 17, 2009 3:39 pm                               
Joined: Thu Nov 15, 2007 4:07 am
Posts: 52
Location: Netherlands              Could not find this one in any topic: Is 
there a way to make a swap method to swap any type of parameters?

I need to do this in an algorithm: Code:If j1 > j2 Then
  Swap j1, j2
End If
 A general method with variants does not seem to work: Code:Sub Swap(ByRef a As 
Variant, ByRef b As Variant)
  Dim c As Variant
  c = a
  a = b
  b = c
End Sub
 If I use this method with Int32's I get "Parameters are not compatible with 
this function".

Of course, I could do the swapping right in the algorithm, but I prefer a 
general method. Does anyone have an idea?

Frank     
_________________
Ubuntu 8.10 Intrepid Ibex
You have to have a little fun every day!  
                            Top            Display posts from previous: All 
posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost 
timeSubject AscendingDescending          Page 1 of 1
   [ 1 post ]     

-- 
Over 900 classes with 18000 functions in one REALbasic plug-in. 
The Monkeybread Software Realbasic Plugin v8.1. 

&lt;http://www.monkeybreadsoftware.de/realbasic/plugins.shtml&gt;

[email protected]

Reply via email to