Encourage three (bin-> DEC)

xiaoxiao2021-03-06  42

/ * =================== binary turn 10 input function GF_Bintodec ======================================================================================== GF_Bintodec parameter description: string type 1, s_bin binary string

Note: Function: Convert binary strings to a decimal string. Return Value: Decimal strings. Illegal binary string return -1; returns an empty string Null Author: Fei Yin Chi Date: 2005/2/4 ========================== ===================================================== * / int li_len, LI_LOOPSTRING LS_RETURNIF UPPER (LEFT (S_bin, 1)) = 'b' TEN S_BIN = MID (S_BIN, 2) // Remove Enterprise LI_LEN = LEN (S_BIN) for Li_LOOP = (LI_LEN - 1) TO 0 Step -1 IF Long (s_bin, li_len - li_loop, 1)> 1 Then Return "-1" // illegal binary string ls_return = string (long (ls_return) long (MID (S_bin, li_len - li_loop, 1)) * 2 ^ li_loop) NextReturn LS_RETURN

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

New Post(0)