在调用数组复制命令时需要用到的数组复制函数:
Public Function ArraySort(ByRef ArrayTarget1() As Integer, ByRef ArrayTarget2() As Byte, ByRef ArrayTarget3() As Byte, ByRef ArrayTarget4() As Boolean, ByRef ArrayTarget5() As Boolean)
'目标数组递减排序函数
Dim i%, j%, t%
For i = 1 To 3
For j = 1 To 4 - i
If ArrayTarget1(j + 1) > ArrayTarget1(j) Then '用冒泡法进行递减排序
Swap ArrayTarget1(j + 1), ArrayTarget1(j)
Swap ArrayTarget2(j + 1), ArrayTarget2(j)
Swap ArrayTarget3(j + 1), ArrayTarget3(j)
Swap ArrayTarget4(j + 1), ArrayTarget4(j)
Swap ArrayTarget5(j + 1), ArrayTarget5(j)
End If
Next j
Next i
End Function
在棋步存取时需要用到的两个进制转换函数:
Public Function DToH(ByVal SourceNum%) As String
'十进制到十六进制转换函数,用于写出棋谱函数的调用
Dim i%, j%, S$, t$: S = ""
i = SourceNum
Do While i Mod 16 > 0
j = i Mod 16
Select Case j
Case 0 To 9
t = CStr(j)
Case 10 To 15
t = Chr(Asc("A") + j - 10)
End Select
S = t + S
i = i \ 16
Loop
DToH = S
End Function
|