home *** CD-ROM | disk | FTP | other *** search
/ Sauce 'n' Code 1 / sauce-n-code-01.adf / ASCII_Source / InterfacePacker.asc < prev    next >
Text File  |  1995-05-07  |  5KB  |  200 lines

  1. '
  2. ' Interface packer v1.0 by Janne Kalliola
  3. '
  4. ' This little program shows all the strings of the program, and the user 
  5. ' may decide should the string be packed as Interface string (remove all 
  6. ' the unneeded characters), unpacked (add some unneeded characters) or passed
  7. ' (a normal string). If the user presses button [Unfold], the accessory
  8. ' unfolds all the procedures of the current program. 
  9. '
  10. Set Buffer 20
  11. Set Accessory 
  12. Dim RIVI$(100,1)
  13. For I=0 To 69
  14.    Read RIVI$(I,0)
  15.    Read RIVI$(I,1)
  16. Next 
  17. Call Editor 11
  18. Call Editor 17
  19. Ask Editor 5
  20. RIVI_MAX=Param
  21. Trap Screen Close 7
  22. Resource Screen Open 7,640,40,0
  23. Cls 0
  24. For I=0 To 6
  25.    Trap Screen Hide I
  26. Next 
  27. A$="SV 0,'Interface packer';"
  28. A$=A$+"SV 1,'Pack';"
  29. A$=A$+"SV 2,'Unpack';"
  30. A$=A$+"SV 3,'Pass';"
  31. A$=A$+"SV 4,'Unfold';"
  32. A$=A$+"BUtton 1,0,0,24,10,0,0,1;[UNpack 0,0,22 BP+;][NoWait;]"
  33. A$=A$+"BUtton 2,24,0,360,10,0,0,1;[LIne 0,0,41,360;PRint 8,1,0 VA,7;][ScreenMove;]"
  34. A$=A$+"BUtton 3,384,0,64,10,0,0,1;[LIne 0,0,41 BP+ BP+ BP+,64;PR 16,1,1 VA,7;][]"
  35. A$=A$+"BUtton 6,448,0,64,10,0,0,1;[LIne 0,0,41 BP+ BP+ BP+,64;PR 8,1,2 VA,7;][]"
  36. A$=A$+"BUtton 4,512,0,64,10,0,0,1;[LIne 0,0,41 BP+ BP+ BP+,64;PR 16,1,3 VA,7;][]"
  37. A$=A$+"BUtton 5,576,0,64,10,0,0,1;[LIne 0,0,41 BP+ BP+ BP+,64;PR 8,1,4 VA,7;][]"
  38. A$=A$+"LIne 0,36,31,640;"
  39. A$=A$+"EXit;"
  40. Dialog Open 1,A$
  41. D=Dialog Run(1)
  42. Cls 2,0,11 To 640,35
  43. Do 
  44.    Ask Editor 1
  45.    A$=Param$
  46.    A=Instr(A$,'"')
  47.    If A>0
  48.       Cls 2,0,11 To 640,35
  49.       Text 0,18,Left$(A$,80)
  50.       If Len(A$)>80
  51.          Text 0,26,Mid$(A$,81,80)
  52.       End If 
  53.       If Len(A$)>160
  54.          Text 0,34,Mid$(A$,161,80)
  55.       End If 
  56.       Do 
  57.          Exit If Rdialog(1,1)=1,2
  58.          If Rdialog(1,3)=1
  59.             B$=Mid$(A$,A+1)
  60.             C$=Left$(A$,A)
  61.             For I=0 To 69
  62.                JATKO:
  63.                B=Instr(B$,RIVI$(I,0))
  64.                If B>0
  65.                   B$=Left$(B$,B-1)+RIVI$(I,1)+Right$(B$,Len(B$)-B-Len(RIVI$(I,0))+1)
  66.                   Goto JATKO
  67.                End If 
  68.             Next 
  69.             Call Editor 71,,C$+B$
  70.             X=Free
  71.             Dialog Update 1,3,0
  72.             Exit 
  73.          Else If Rdialog(1,4)=1
  74.             Dialog Update 1,4,0
  75.             Exit 
  76.          Else If Rdialog(1,5)=1
  77.             Call Editor 89
  78.             Dialog Update 1,5,0
  79.          Else If Rdialog(1,6)=1
  80.             B$=Mid$(A$,A+1)
  81.             C$=Left$(A$,A)
  82.             For I=0 To 69
  83.                JATKO2:
  84.                B=Instr(B$,RIVI$(I,1)+" ")
  85.                If B=0
  86.                   B=Instr(B$,RIVI$(I,1)+";")
  87.                End If 
  88.                If B=0
  89.                   B=Instr(B$,RIVI$(I,1)+"+")
  90.                End If 
  91.                If B=0
  92.                   B=Instr(B$,RIVI$(I,1)+"-")
  93.                End If 
  94.                If B>0
  95.                   B$=Left$(B$,B-1)+RIVI$(I,0)+Right$(B$,Len(B$)-B-Len(RIVI$(I,1))+1)
  96.                   Goto JATKO2
  97.                End If 
  98.             Next 
  99.             Call Editor 71,,C$+B$
  100.             X=Free
  101.             Dialog Update 1,6,0
  102.             Exit 
  103.          End If 
  104.       Loop 
  105.    End If 
  106.    Exit If Mouse Key=2
  107.    Exit If Rdialog(1,1)=1
  108.    If Rdialog(1,5)=1
  109.       Call Editor 89
  110.       Dialog Update 1,5,0
  111.    End If 
  112.    Ask Editor 4
  113.    Exit If Param=RIVI_MAX
  114.    Call Editor 2
  115. Loop 
  116. For I=0 To 6
  117.    Trap Screen Show I
  118. Next 
  119. Screen Close 7
  120. Edit 
  121. ' Command list 
  122. Data "BUtton","BU"
  123. Data "PRint","PR"
  124. Data "NoWait","NW"
  125. Data "SetVar","SV"
  126. Data "MEssage","ME"
  127. Data "UNpack","UN"
  128. Data "LIne","LI"
  129. Data "VLine","VL"
  130. Data "PUsh","PU"
  131. Data "PUzzle","PU"
  132. Data "BOx","BO"
  133. Data "BPosition","BP"
  134. Data "BReturn","BR"
  135. Data "BChange","BC"
  136. Data "EXit","EX"
  137. Data "EDit","ED"
  138. Data "DIgit","DI"
  139. Data "HorizontalSlider","HS"
  140. Data "HSlider","HS"
  141. Data "VerticalSlider","VS"
  142. Data "VSlider","VS"
  143. Data "ScreenMove","SM"
  144. Data "ArrayRead","AR"
  145. Data "ARray","AR"
  146. Data "ArraySize","AS"
  147. Data "ActiveList","AL"
  148. Data "AList","AL"
  149. Data "InactiveList","IL"
  150. Data "IList","IL"
  151. Data "ZonePosition","ZP"
  152. Data "ZPosition","ZP"
  153. Data "ZoneChange","ZC"
  154. Data "ZChange","ZC"
  155. Data "ZoneNumber","ZN"
  156. Data "ZNumber","ZN"
  157. Data "HyperText","HT"
  158. Data "HText","HT"
  159. Data "BAse","BA"
  160. Data "SIze","SI"
  161. Data "SAve","SA"
  162. Data "RunUntil","RU"
  163. Data "ButtonQuit","BQ"
  164. Data "SetZonevariable","SZ"
  165. Data "ZoneVariable","ZV"
  166. Data "CAll","CA"
  167. Data "GraphicBox","GB"
  168. Data "SetPattern","SP"
  169. Data "GraphicSquare","GS"
  170. Data "SetLine","SL"
  171. Data "GraphicLine","GL"
  172. Data "GraphicEllipse","GE"
  173. Data "PrintOutline","PO"
  174. Data "SetWriting","SW"
  175. Data "SetFont","SF"
  176. Data "TextWidth","TW"
  177. Data "TextHeight","TH"
  178. Data "TextLength","TL"
  179. Data "CentreX","CX"
  180. Data "VertText","VT"
  181. Data "LAbel","LA"
  182. Data "JumP","JP"
  183. Data "JumpSubroutine","JS"
  184. Data "ReTurn","RT"
  185. Data "UserInstruction","UI"
  186. Data "UserI","UI"
  187. Data "BaseX","BX"
  188. Data "BaseY","BY"
  189. Data "SizeX","SX"
  190. Data "SizeY","SY"
  191. Data "ScreenWidth","SW"
  192. Data "ScreenHeight","SH"
  193. ' Feel free to add commands
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.