[AccessD] Swap two elements in an array

Stuart McLachlan stuart at lexacorp.com.pg
Thu Aug 25 23:37:41 CDT 2022


Oops!  Too quick!
I messed those last two functions up badly :(

Actually, the return value assignment is hardly necessary and you could make the functions 
marginally faster again by not setting a return value.

Function iSwap(x As Long y As Long) As Boolean
    'swap integral variables
    Dim t As Long
    t = x
    x = y
    y = t
End Function
Function fSwap(x As Double, y As Double) As Boolean
    'Swap float  variables
    Dim t As Double
    t = x
    x = y
    y = t
End Function
Function sSwap(x As String, y As String) As Boolean
   'swap string variables
    Dim t As String
    t = x
    x = y
    y = t
End Function





More information about the AccessD mailing list