home *** CD-ROM | disk | FTP | other *** search
/ Compute! Gazette 1989 July / 1989-07.d64 / geoconverter (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  1KB  |  42 lines

  1. 10 rem copyright 1989 compute! publications, inc. - all rights reserved
  2. 20 rem this is the updated geoconverter        revised may issue 1988 gazette
  3. 30 poke 53280,0:poke 53281,0:poke 646,5:printchr$(142);chr$(147)
  4. 40 fori=1to10:print"":next
  5. 50 printtab(5)"[151][213][196][201] copyright 1989"
  6. 60 printtab(5)"[199]c[200] compute! publications inc."
  7. 70 printtab(5)"[202][198][203] all rights reserved"
  8. 80 print"[155]geoconverter 1.1[146]"
  9. 90 input"file to convert";gf$
  10. 100 print"searching for "gf$
  11. 110 hd$="":for i=1 to 4:read he:hd$=hd$+chr$(he):next
  12. 120 for i=1to5:readie:id$=id$+chr$(ie):next
  13. 130 nl$="":t$=chr$(18):s$=chr$(1):open 15,8,15,"i0:":open 2,8,2,"#"
  14. 140 gosub370:get #2,nt$,ns$
  15. 150 for e=0 to 7
  16. 160 d$=nl$:get#2,b$:i=1:ifb$=nl$ then220
  17. 170 if asc(b$)<>130 then220
  18. 180 get#2,ht$,hs$:i=3:if hs$="" then hs$=chr$(0)
  19. 190 get#2,b$:i=i+1:if b$="" then b$=chr$(0)
  20. 200 if asc(b$)=160 then220
  21. 210 d$=d$+b$:goto190
  22. 220 for i=i to 31:get#2,b$:next
  23. 230 if d$=gf$ then260
  24. 240 next e:if nt$=nl$ then260
  25. 250 t$=nt$:s$=ns$:goto140
  26. 260 if d$=nl$ thenprint"file not found[146]":goto360
  27. 270 print"converting "gf$
  28. 280 dt$=t$:ds$=s$:t$=ht$:s$=hs$:gosub370
  29. 290 get#2,mt$,ms$:if ms$="" then ms$=chr$(0)
  30. 300 for i=0 to 65:get #2,b$:next
  31. 310 get#2,ct$,gt$:gosub370:print#2,hd$;:gosub380:t$=dt$:s$=ds$:gosub370
  32. 320 for i=0 to 32*e+2:get#2,b$:next
  33. 330 print#2,mt$;ms$;:fori=0 to 15:get#2,b$:next
  34. 340 print#2,ht$;hs$;chr$(0);gt$;
  35. 350 print#2,id$;:gosub380:print:printgf$" converted"
  36. 360 close2:close15:end
  37. 370 u$="u1":goto390
  38. 380 u$="u2"
  39. 390 print#15,u$;2;0;asc(t$+"0");asc(s$+"0")
  40. 400 return
  41. 410 data 0,255,3,21,87,10,1,0,0
  42.