''' <summary> ''' 36进制数加1,0~9,A~Z ''' </summary> ''' <param name="value"></param> ''' <returns></returns> ''' <remarks></remarks> PublicFunction Str36Add()Function Str36Add(ByVal value AsObject, OptionalByVal RetBitNum AsInteger=0) AsString If value.GetType.Name <>"String"AndNot (value Is DBNull.Value) Then Str36Add ="" MsgBox("参数错误,应为字符型数据或空值。") Exit Function EndIf If value Is DBNull.Value Then Str36Add = AddBit("1", RetBitNum, "0") Exit Function EndIf Dim tmp AsString=UCase(Trim(value)) Dim i AsInteger Dim newtmp AsString="" For i =1ToLen(tmp) If newtmp <>""Then newtmp = newtmp &Mid(tmp, i, 1) Else IfMid(tmp, i, 1) <>"0"Then newtmp =Mid(tmp, i, 1) EndIf EndIf Next tmp = newtmp IfString.IsNullOrEmpty(tmp) Then Str36Add = AddBit("1", RetBitNum, "0") Exit Function EndIf If tmp <>""AndNot IsString(tmp) Then Str36Add ="" MsgBox("错误,非字符串。", 16, "参数错误") Exit Function EndIf Dim newstr AsString="" Dim laststr AsString="" Str36Add ="" Dim addstr AsString="" Dim addvalue AsString="" For i =Len(tmp) To1Step-1 laststr =Mid(tmp, i, 1) addvalue = straddone(laststr) '先判断这位数字是否小于字母“Z”,如不小于则返回值 IfAsc(laststr) <90Then Str36Add = AddBit(Mid(tmp, 1, i -1) & addvalue & addstr, RetBitNum, "0") Exit Function EndIf If i =1Then Str36Add = AddBit("1"& addvalue & addstr, RetBitNum, "0") Exit Function Else addstr = addvalue & addstr EndIf Next Str36Add = AddBit(Str36Add, RetBitNum, "0") End Function Function AddBit()Function AddBit(ByVal OldStr AsString, ByVal bitnum AsInteger, ByVal pstr AsString) AsString AddBit = OldStr If bitnum =0Then Exit Function EndIf Dim tmp AsString=Left(pstr, 1) If tmp =""Then tmp ="" EndIf Dim i AsInteger For i =1To bitnum -Len(OldStr) AddBit = tmp & AddBit Next End Function Function straddone()Function straddone(ByVal value AsString) AsString IfAsc(value) =57Then straddone ="A" Exit Function EndIf IfAsc(value) =90Then straddone ="0" Exit Function EndIf straddone =Chr(Asc(value) +1) End Function