如果是后者的话,就:
'返回0时一样大,返回1时str1>str2,2时str2>str1
Private function Equal(str1$,str2$) As Integer
if str1=str2 then Equal=0 : Exit function
Dim len1%,len2%,i%,len%
len1=Len(str1)
len2=Len(str2)
if len1>len2 then
len = len2
else
len = len1
end if
For i = 0 to len
if asc(mid(str1,i+1,1)) > asc(mid(str2,i+1,1)) then
Equal=1 : Exit function
elseif asc(mid(str1,i+1,1)) < asc(mid(str2,i+1,1)) then
Equal=2 : Exit function
end if
next
'到这里表示Len长度字符串相等
if len=len1 then
Equal = 2 '表示str2比str1长,str2大
else
Equal = 1
end if
End Function