/ * =================== decimal turn binary function GF_Dectobin ================================================================================================================================================== GF_Dectobin Parameter Description: String Type 1, S_DEC Decoction Strings
Note: Function: Convert the decimal string to a binary string. Return Value: Binary strings. Illegal decimal string return -1; returns an empty string Null Author: Fei Yin Chi Date: 2005/2/4 ========================== ====================================================== * / long ll_tempstring ls_returnif NOT MATCH (S_DEC, "[0-9]") THEN RETURN "-1" // illegal decimal string LL_TEMP = long (s_dec) // converts numeric strings to long type; 2006-11-15IF LL_TEMP = 0 THEN RETURN "0" // If it is 10-based 0, return "0" directly, because 0 is also 0 in binary; 2006-11-15do while ll_temp> 0 // If it is greater than 0 ls_return = String (MOD (LL_Temp 2)) ls_return // take out the character in the decimal in the decimal, the mold, the core of the decision; 2006-11-15 LL_TEMP = long (ll_temp / 2) // Take a feasibility, so that the next step continues Take 2 model; 2006-11-15loopreturn "B" ls_return // binary Binary Differential number, PB does not support direct representation of binary thus returns a string; 2006-11-15