'painter_icon.mac / convert RAW to Painter icon data (2004/07/21) proc main dim i, j, n, file$, s$, fnum fnum = freefile() file$ = @Pathname$ + ".txt" open file$ for output as #fnum 'read code and convert @MoveFileTop do while 1 i++ 'get hex value for each char if @Code = -224 then 'return code (CR/LF, LF, CR) 'which return code? n = @ScrLineToCrLine(@Line) 'get current line number if @TextCrReturnCode(n) = 0 then s$ = "0a0d" i++ elseif @TextCrReturnCode(n) = 1 then s$ = "0a" elseif @TextCrReturnCode(n) = 2 then s$ = "0d" end if else 'not a return code if i mod 3 = 1 then 'remove initial 0 s$ = cformat$("%x",@Code) else s$ = cformat$("%02x",@Code) end if end if if i mod 3 = 0 then 'group of 3 (RGB) complete j++ if j mod 10 = 0 then 'group of 10 RGB units print #fnum, s$ else print #fnum, s$ + " "; end if else print #fnum, s$; end if @MoveRightChar if @code = CODE_EOF then exit do loop close #fnum print "DONE!!" end proc