Date: 02-16-2022
Return to Index
created by gbSnippets
'Compilable Example: (Jose Includes)
#Compile Exe
#Dim All
Function PBMain () As Long
Dim CArray(1 To 5) As String
Array Assign CArray() = "1", "2", "3" ,"4", "5"
MRU(CArray(), "6") : ? Join$(CArray()," ")
Array Assign CArray() = "1", "2", "3" ,"4", "5"
MRU(CArray(), "9") : ? Join$(CArray()," ")
Array Assign CArray() = "1", "2", "3" ,"4", "5"
MRU(CArray(), "2") : ? Join$(CArray()," ")
Array Assign CArray() = "1", "2", "3" ,"4", "5"
MRU(CArray(), "40") : ? Join$(CArray()," ")
End Function
Sub MRU(tempArray() as String, TestValue$)
Local iResult As Long
Array Scan tempArray(), = testValue$, To iResult
If iResult = 0 Then Array Insert tempArray(), testValue$
If iResult > 0 Then Array Insert tempArray() For iResult, testValue$
End Sub
Sub MRU(tempArray() As String, TestValue$)
Local iResult As Long
Array Scan tempArray(), = testValue$, To iResult
Array Insert tempArray() For iResult, testValue$
End Sub
http://www.garybeene.com/sw/gbsnippets.htm