home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD1.iso / Editor / FREDV19A.LHA / FrexxEd / fpl / HexDisplay.FPL < prev    next >
Encoding:
Text File  |  1995-07-19  |  820 b   |  36 lines

  1. export void HexDisplay()
  2. {
  3.   int hextab[16]={'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'};
  4.  
  5.   int line=ReadInfo("line");
  6.   int columns=ReadInfo("view_columns");
  7.   int counter, linecounter=0;
  8.   string out1, out2, out3;
  9.   int outcount;
  10.   string empty;
  11.  
  12.   for (counter=0; counter<columns; counter++)
  13.     empty+=" ";
  14.  
  15.   out1=GetLine();
  16.   out2="";
  17.   out3="";
  18.   for (outcount=0; outcount<columns && outcount<strlen(out1); outcount++) {
  19.     out2+=itoc(hextab[out1[outcount]>>4]);
  20.     out3+=itoc(hextab[out1[outcount]&15]);
  21.   }
  22.   out2+=empty;
  23.   out3+=empty;
  24.   line=ReadInfo("cursor_y");
  25.   empty="";
  26.   for (counter=0; counter<columns; counter++)
  27.     empty+="-";
  28.  
  29.   PrintLine(out2, line+1);
  30.   PrintLine(out3, line+2);
  31.   PrintLine(empty, line+3);
  32. }
  33.  
  34. AssignKey("HexDisplay();", "Amiga Shift h");
  35.  
  36.