Free conversion function between 2-36

xiaoxiao2021-03-06  15

'-------------------------------------------------------------------------------------------------------------------------------------------------------------------- ------------------------------- 'I don't know if there is 36 credits, huh, huh, maybe I have made it myself. Bar. The '36 credit concept, 11 corresponds to a, 12 comparable to B, ............ 35 quite with Z. Only between uppercase A - Z. Capture did not add judgment. Add it again. Time relationship, less write a lot of restrictions. 'It feels good to encrypt. Ha ha'------------------------------------------------ -----------------------------------------------

'X is the number of converted, M is not converted previously, N is converted after converting Function EN (X AS String, M AS Integer, n as integer) AS STRINGDIM TEMP AS Longdim ZHT () AS Stringdim Total As integer

DIM MMID AS STRING

IF N> 36 THEN MSGBOX "This function supports up to 36 credits" EXIT functionEND IFIF M = 10 THEN TEMP = Clng (x) Do Total = Total 1 Temp = Int (TEMP / N) loop unsteil temp = 0 redim ZHT (TOTAL) TEMP = CLNG (X) Total = 0 DO Total = Total 1 zht (Total) = Temp MOD N TEMP = INT (TEMP / N) Loop Until Temp = 0 for i = Total to 1 Step -1 EN = EN & SZ (CSTR (ZHT (I))) Next IELSE for i = len (x) to 1 step -1 mmid = MID (X, LEN (X) - i 1, 1) IF mmid = "1" OR MMID = "2" or mmid = "3" or mmid = "4" or mmid = "5" or mmid = "6" or mmid = "7" or mmid = "8" or mmid = "9" THEN TOTAL = TOTAL CINT (MMID) * m ^ (i - 1) Else Total = Total (ASC (MMID) - 55) * m ^ (i - 1) end if next I zh = zh (cstr (Total), 10 , N) end if

END FUNCTION

'Conversion of a number of greater than 9 into A --- ZFunction SZ (Y AS STRING) AS Stringif Cint (Y)> 9 Then SZ = CHR (CINT (Y) 55) Else Sz = Yend IFEND FunctionPrivate SUB Command1_Click () DIM B, C as integerim a as string

A = CSTR ("InputBox")) B = CINT ("InputBox")) C = CINT ("InputBox")) MSGBOX CSTR (B) "Number of Enter:" A "Convert to" CSTR (C) "The number of applications is:" zh (a, cint (b), c) end SUB

转载请注明原文地址:https://www.9cbs.com/read-45775.html

New Post(0)