home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 28 / amigaformatcd28.iso / -seriously_amiga- / programming / amos / pic2txt / pic2txt20.amos / pic2txt20.amosSourceCode
AMOS Source Code  |  1998-05-09  |  3KB  |  87 lines

  1. On Error Proc ERR
  2. Resume Label _END
  3. Dim A$(15),Z$(25),WINCON(10)
  4. Global A$(),Z$(),WINCON()
  5. CL$=Command Line$
  6. Amos To Back 
  7. VER$="$VER: PIC-2-TXT V2.0 - Written by Robert Ciesnik in AMOSPro2.00"
  8. A= Extension_24_0564(1,"CON:0/0/640/256/PIC-2-TXT V2.0 - Written by Robert Ciesnik")
  9. A= Extension_24_05C8(1,"This program was written and compiled with AMOSPro2.00"+Chr$(10))
  10. A= Extension_24_05C8(1,"Type 'PIC2TXT ??' for more information!"+Chr$(10))
  11. A= Extension_24_05C8(1,"I've used three extensions to write it:"+Chr$(10))
  12. A= Extension_24_05C8(1,"AMOSPro Turbo Extension V1.9, AMOSPro Gui Extension V1.62 and"+Chr$(10))
  13. A= Extension_24_05C8(1,"AMOSPro JDColour Extension V1.4"+Chr$(10))
  14. A= Extension_24_05C8(1,"I`d like to thank the authors of these extensions!"+Chr$(10)+Chr$(10))
  15. A$(0)="#" : A$(1)="@" : A$(2)="0" : A$(3)="8" : A$(4)="%" : A$(5)="X"
  16. A$(6)="2" : A$(7)="�" : A$(8)=Chr$(177) : A$(9)=Chr$(215) : A$(10)="+"
  17. A$(11)="=" : A$(12)=":" : A$(13)="-" : A$(14)=Chr$(183) : A$(15)=" "
  18. For Y=0 To 25 : Z$(Y)="" : Next Y
  19. If CL$="?" Then A= Extension_24_05C8(1,"Usage: PIC2TXT <source> <destination>") : Repeat : Until Extension_18_0A32 : Goto _END
  20. If CL$="??" Then HELP : Goto _END
  21. For X=1 To Len(CL$)
  22.    B$=Mid$(CL$,X,1)
  23.    If B$=" " Then S$=Right$(CL$,Len(CL$)-X) : X=Len(CL$) Else F$=F$+B$
  24. Next X
  25. If CL$=""
  26.    F$= Extension_24_0162("Select an IFF-Picture","","","")
  27.    S$= Extension_24_0162("Select an Output-File","","","")
  28. End If 
  29. If F$="" Then Goto _END
  30. If Exist(F$)=False Then Goto _END
  31. If S$="" Then Goto _END
  32. A= Extension_24_05C8(1,"Converting...")
  33. Load Iff F$,0
  34. Screen 0
  35. X=Screen Width : Y=Screen Height
  36. Z=Screen Colour
  37. Screen Open 1,320,256,Z,Lowres : Curs Off : Flash Off 
  38. Screen 1
  39. Get Palette 0
  40. Zoom 0,0,0,X,Y To 1,0,0,76,26
  41. Screen Close 0
  42. Screen 1
  43. For Y=0 To 25
  44.    For X=0 To 75
  45.       R= Extension_12_0470(X,Y)
  46.       D=Val("$"+Right$(Hex$( Extension_20_0020(Colour(R))),1))
  47.       Z$(Y)=Z$(Y)+A$(D)
  48.    Next X
  49. Next Y
  50. A= Extension_24_05C8(1,"Ok"+Chr$(10))
  51. Screen Close 1
  52. Open Out 1,S$
  53. For Y=0 To 25
  54.    A= Extension_24_05C8(1,Z$(Y)+Chr$(10))
  55.    Print #1,Z$(Y);
  56.    Print #1,Chr$(10);
  57. Next Y
  58. Print #1,"PIC-2-TXT V2.0 <-> Copyright ï¿½1998 R-SOFT Entertainment Inc.";Chr$(10);
  59. Close 1
  60. A= Extension_24_05C8(1,"Press left mouse button to quit")
  61. Repeat : Until Extension_18_0A32 =0
  62. Repeat : Until Extension_18_0A32 
  63. _END:
  64.  Extension_24_0578 : Trap Close : End 
  65. Procedure ERR
  66. A= Extension_24_0150("PIC-2-TXT V2.0 - Error Request",Err$(Errn),"CANCEL")
  67. Resume Label 
  68. End Proc
  69. Procedure HELP
  70. M$=Chr$(10)
  71. A= Extension_24_05C8(1,"If you like this programm write me:"+M$)
  72. A= Extension_24_05C8(1,"Robert Ciesnik"+M$)
  73. A= Extension_24_05C8(1,"Vivaldistr. 3"+M$)
  74. A= Extension_24_05C8(1,"30989 Gehrden"+M$)
  75. A= Extension_24_05C8(1,"  GERMANY"+M$)
  76. A= Extension_24_05C8(1,"or phone me:"+M$)
  77. A= Extension_24_05C8(1,"+49-5108-927924"+M$)
  78. A= Extension_24_05C8(1,"I've written really much software for the Amiga in AmigaBasic,"+M$)
  79. A= Extension_24_05C8(1,"GFA-Basic and AMOS Professional 2.00."+M$)
  80. A= Extension_24_05C8(1,"Now, I`m going to spread it out in the Internet!!!"+M$)
  81. A= Extension_24_05C8(1,"You can reach me through the Internet, too:"+M$)
  82. A= Extension_24_05C8(1,"EMail: fbuschmann@compuserve.com"+M$)
  83. A= Extension_24_05C8(1,"WWW: http://ourworld.compuserve.com/homepages/fbuschmann"+M$)
  84. A= Extension_24_05C8(1,"PS: I`ve written a brand new game with good SFX and GFX!"+M$)
  85. A= Extension_24_05C8(1,"--- Press mouse button to quit ---"+M$)
  86. Repeat : Until Extension_18_0A32 
  87. End Proc