home *** CD-ROM | disk | FTP | other *** search
/ High Voltage Shareware / high1.zip / high1 / DIR22 / JORF21_2.ZIP / DUMP.J < prev    next >
Text File  |  1993-07-05  |  2KB  |  63 lines

  1. Dump:Start
  2.   New (WildCard, FileList, Choice)
  3.   New (FileName, Char, Length, Pos, Col)
  4.  
  5.   While (Ok)
  6.     | First get a wildcard for dir command
  7.     Win:Add ("Dump a File")
  8.       Input:"Directory WildCard: ", Field:"WildCard"
  9.     If (Kbd:Got = 'Esc_Key')
  10.       Return
  11.  
  12.     | Read the directory
  13.     Win:Add("Reading Directory")
  14.       One Moment Please . . .
  15.     FileList  = Arr:Dir(WildCard)
  16.     If Arr:Len(FileList) < 1
  17.       Msg:Add
  18.         No Files match the WildCard!
  19.     Else
  20.       While FileList != Null
  21.         | And ask to pick a file
  22.         Choice   = Arr:Pick(FileList,Null,"Dump File", 0, 0, 0, Choice)
  23.     If Kbd:Got = 'Esc_Key'
  24.           Break
  25.  
  26.         | Got a file name!
  27.         FileName = FileList[Choice]
  28.         FileName = Str:At (FileName 1, Str:In(FileName," "))
  29.         Length   = File:Len (FileName)
  30.         Pos      = 0
  31.  
  32.         Win:Add (FileName, 2, 8, (Length/16)+2, 78, Here)
  33.  
  34.         While (Pos < Length)
  35.           Col = (Pos % 16)     | Set column position
  36.           If (Col == 0)        | If beginning new line
  37.             If (Pos > 0)       | If after first line
  38.               Move:By (1,0)    | Start a new line
  39.               Move:To (0,1)    |
  40.             Str:Put (To:Str(Pos,"0000:0000",16))
  41.           ++Pos
  42.           | Read One Character
  43.       Char = File:Read (FileName,1,Pos)
  44.           | And Display It . . .
  45.           Move:To (0,13+(Col*3))
  46.           Str:Put (To:Str(To:Ascii(Char),'00',16))
  47.           Move:To (0,62+Col)
  48.           Char:Put (To:Ascii(Char))
  49.       If Kbd:Hit           | If key hit
  50.         Char = Kbd:Get     | See What it is
  51.             If Char = "Esc_Key"| If Escape
  52.               Break            |      Break
  53.             Win:Pause          |   Pause
  54.         Str:PutLine            | One more line
  55.         Str:PutLine            | One more line
  56.         Win:Msg("End of File") | Done!
  57.         Win:Pause              | Wait
  58.         Win:Del                | Delete window
  59.       Win:Del
  60.     Win:Del
  61.     Win:Del
  62.   Return                       | Exit
  63.