home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 18 / 18.iso / w / w252 / 4.ddi / MACROS.CMZ / FREPLACE.SMM < prev    next >
Encoding:
INI File  |  1991-08-19  |  3.2 KB  |  274 lines

  1. [ver]
  2.     4
  3. [sty]
  4.     ~macro.sty
  5. [files]
  6. [charset]
  7.     82
  8.     ANSI (Windows, IBM CP 1252)
  9. [revisions]
  10.     0
  11. [prn]
  12.     PostScript Printer
  13. [lang]
  14.     1
  15. [desc]
  16.     Find and replace across multiple files with FREPLACE.
  17.     Lotus WPD Marketing
  18.     Intermediate
  19.     Replace, FileOpen, Local Arrays
  20.     
  21.     682670342
  22.     16
  23.     676699899
  24.     69
  25.     1
  26.     0
  27.     0
  28.     0
  29.     0
  30.     
  31.     
  32.     
  33.     
  34.     
  35.     
  36.     0
  37. [fopts]
  38.     0
  39.     1
  40.     0
  41.     0
  42. [lnopts]
  43.     2
  44.     Body Text
  45.     1
  46. [docopts]
  47.     5
  48.     2
  49. [l1]
  50.     0
  51. [edoc]
  52. Macro by <+!>Charlie Pappas<-!>
  53.  
  54.  
  55. function freplace()
  56.  
  57. again:
  58.  
  59. filledit(9001, strcat$(GetDocPath$(), "*.sam"))
  60.  
  61. box = dialogbox(".", "files")
  62.  
  63. if box <<<;> 1
  64.  
  65.     return 0
  66.  
  67. endif
  68.  
  69. findit = getdialogfield$(8007)
  70.  
  71. replaceit = getdialogfield$(8008)
  72.  
  73. if getdialogfield$(8001) = ""
  74.  
  75.     message("select files from the list")
  76.  
  77.     goto again
  78.  
  79. endif
  80.  
  81. cdir = getcurrentdir$()
  82.  
  83. dim files(100)
  84.  
  85. for i = 1 to 100
  86.  
  87.     file = strfield$(getdialogfield$(8001), i, " ")
  88.  
  89.     if file = ""
  90.  
  91.         break
  92.  
  93.     endif
  94.  
  95.     files(i) = file
  96.  
  97. next
  98.  
  99. for j = 1 to i - 1
  100.  
  101.     file = files(j)
  102.  
  103.     if j = 1
  104.  
  105.         opts = 1
  106.  
  107.     else
  108.  
  109.         opts = 129
  110.  
  111.     endif
  112.  
  113.     FileOpen(strcat$(cdir, file),  opts "")
  114.  
  115.     replace("", "", 1024, findit, replaceit)
  116.  
  117.     save()
  118.  
  119. next
  120.  
  121. fileclose()
  122.  
  123. end function
  124.  
  125.  
  126. DIALOG files
  127.  
  128. -2134376448 10 88 20 184 136 "" "" "Find & Replace Across Multiple Files"
  129.  
  130. FONT 8 "Helv"
  131.  
  132. 6 58 76 8 1000 1342177280 "static" "&Search Across Files:" 0 
  133.  
  134. 6 6 60 8 1003 1342308352 "static" "F&ind:" 0 
  135.  
  136. 6 16 120 12 8007 1350631552 "edit" "" 0 
  137.  
  138. 6 30 60 8 1004 1342308352 "static" "&Replace With:" 0 
  139.  
  140. 6 40 120 12 8008 1350631552 "edit" "" 0 
  141.  
  142. 6 68 66 64 9001 1352728587 "listbox" "" 0 
  143.  
  144. 138 7 40 14 1 1342373889 "button" "OK" 0 
  145.  
  146. 138 23 40 14 2 1342373888 "button" "Cancel" 0 
  147.  
  148. 92 100 48 1 8001 1342177280 "static" "" 0 
  149.  
  150. 80 68 96 8 7999 1342177280 "static" "" 0 
  151.  
  152. END DIALOG
  153.  
  154.  
  155. >
  156.  
  157. [Embedded]
  158. 00001864
  159. >
  160. [macsum] 2
  161. freplace 0 0 10 2
  162. files 786 0 -1 38
  163. [macse]
  164. 14 freplace
  165. 0 268
  166. 13
  167. 0 16 [X] "*.sam"
  168. 13
  169. 0 31 9001 [X]
  170. 0 26 "." "files"
  171. 13
  172. 8 1
  173. 6 1
  174. 5 1
  175. 18 1
  176. 11 00000129
  177. 5 0
  178. 15
  179. 9
  180. 0 27 8007
  181. 13
  182. 8 2
  183. 0 27 8008
  184. 13
  185. 8 3
  186. 0 27 8001
  187. 13
  188. 7 ""
  189. 18 0
  190. 11 00000256
  191. 0 3 "select files from the list"
  192. 10 00000013
  193. 0 290
  194. 13
  195. 8 4
  196. 5 100
  197. 21 5 [X]
  198. 5 1
  199. 8 6
  200. 5 100
  201. 6 6
  202. 18 2
  203. 12 00000376
  204. 10 00000492
  205. 5 1
  206. 6 6
  207. 3 0
  208. 8 6
  209. 10 00000299
  210. 0 27 8001
  211. 13
  212. 0 20 [X] "{6}" " "
  213. 13
  214. 8 7
  215. 6 7
  216. 7 ""
  217. 18 0
  218. 11 00000463
  219. 10 00000492
  220. 6 6
  221. 6 7
  222. 23 5
  223. 10 00000343
  224. 5 1
  225. 8 8
  226. 6 6
  227. 5 1
  228. 3 1
  229. 6 8
  230. 18 2
  231. 12 00000587
  232. 10 00000765
  233. 5 1
  234. 6 8
  235. 3 0
  236. 8 8
  237. 10 00000502
  238. 6 8
  239. 22 5
  240. 8 7
  241. 6 8
  242. 5 1
  243. 18 0
  244. 11 00000655
  245. 5 1
  246. 8 9
  247. 10 00000667
  248. 5 129
  249. 8 9
  250. 0 16 "{4}" "{7}"
  251. 13
  252. 2 102 1 [X] "{9}" ""
  253. 2 488 1 "" "" 1024 "{2}" "{3}"
  254. 2 103 1
  255. 10 00000554
  256. 2 147 1
  257. 6 0
  258. 15
  259. 9
  260. DIALOG files
  261. -2134376448 10 88 20 184 136 "" "" "Find & Replace Across Multiple Files" 
  262. FONT 8 "Helv" 
  263. 6 58 76 8 1000 1342177280 "static" "&Search Across Files:" 0 
  264. 6 6 60 8 1003 1342308352 "static" "F&ind:" 0 
  265. 6 16 120 12 8007 1350631552 "edit" "" 0 
  266. 6 30 60 8 1004 1342308352 "static" "&Replace With:" 0 
  267. 6 40 120 12 8008 1350631552 "edit" "" 0 
  268. 6 68 66 64 9001 1352728587 "listbox" "" 0 
  269. 138 7 40 14 1 1342373889 "button" "OK" 0 
  270. 138 23 40 14 2 1342373888 "button" "Cancel" 0 
  271. 92 100 48 1 8001 1342177280 "static" "" 0 
  272. 80 68 96 8 7999 1342177280 "static" "" 0 
  273. 00001889
  274.