// // ABIN2HEX.VDM Christian Ziemski 09.05.2004 // // // Converts a "binary" output (e.g. of Reg_Type(r, 8192)) into "hex", "decimal" // or back to character. // // // Example: // // -- From: // X X X . XX X X. XX XXX. X XXXXX. X X X . XXXX X. XXX . XX X X. // -- To: // 52 65 67 5F 54 79 70 65 // -- or: // 82 101 103 95 84 121 112 101 // -- or: // Reg_Type // // // The cursor has to be set exactly at the beginning of the "binary" string! // //-------------------------------------------------------------------------- repeat (ALL) { if (Match("|{ ,X}|{ ,X}|{ ,X}|{ ,X}|{ ,X}|{ ,X}|{ ,X}|{ ,X}.") != 0) { if (!At_EOL) { break } Line(1, NOERR+ERRBREAK) if (Match("|{ ,X}|{ ,X}|{ ,X}|{ ,X}|{ ,X}|{ ,X}|{ ,X}|{ ,X}.") != 0) { break } } #103 = 0 #105 = 128 for (#104=0; #104<8; #104++) { #103 = #103 + (Cur_Char(#104)!=32) * #105 #105 /= 2 } Del_Char(9) Num_Ins(#103, HEX+NOMSG+NOCR) // hex Ins_Text(" ") // Num_Ins(#103, LEFT+NOMSG+NOCR) // decimal // Ins_Text(" ") // Ins_Char(#103) // character }