home *** CD-ROM | disk | FTP | other *** search
/ Program Metropolis - Software Boutique 95 / SOFTWARECD.iso / camipro3 / macros.cmz / FREPLACE.SMM < prev    next >
Encoding:
INI File  |  1994-08-14  |  6.9 KB  |  441 lines

  1. [ver]
  2.     4
  3. [sty]
  4.     _macro.sty
  5. [files]
  6. [charset]
  7.     82
  8.     CHINESEBIG5 (Windows)
  9. [revisions]
  10.     0
  11. [prn]
  12.     PostScript Printer
  13. [port]
  14.     LPT1:
  15. [lang]
  16.     1
  17. [desc]
  18.     ªbªh¡╙└╔«╫ññ┤MºΣ╗P¿·ÑNíC
  19.     Lotus WPD Marketing
  20.     Intermediate
  21.     Replace, FileOpen, Local Arrays
  22.     noautorun
  23.     773102811
  24.     30
  25.     676699899
  26.     101
  27.     2
  28.     0
  29.     0
  30.     0
  31.     0
  32.     
  33.     
  34.     
  35.     
  36.     
  37.     
  38.     0
  39. [fopts]
  40.     0
  41.     1
  42.     0
  43.     0
  44. [lnopts]
  45.     2
  46.     Body Text
  47.     1
  48. [docopts]
  49.     5
  50.     2
  51. [GramStyle]
  52.     
  53. [l1]
  54.     0
  55. [pg]
  56.     2
  57.     49 0 67 0 0 1 0 65535 2 Standard    65535 0 0    0 0 0 0 0 0 0 65535 0 0 65535 0 0 0 0 0
  58.     86 0 0 1025 0 0 0 65535 65535 Standard    65535 0 0    0 0 0 0 0 0 0 65535 0 0 65535 0 0 0 0 0
  59. [edoc]
  60. <:#293,9025>Macro by <+!>Charlie Pappas<-!>
  61.  
  62. <:#284,9025>
  63.  
  64. <:#284,9025>function freplace()
  65.  
  66. <:#284,9025>IF IsNewWave()
  67.  
  68. <:#284,9025>    Message("Macro not available while running under HP NewWave.")
  69.  
  70. <:#284,9025>    Exit Function
  71.  
  72. <:#284,9025>ENDIF
  73.  
  74. <:#284,9025>'ignorekeyboard(2)
  75.  
  76. <:#284,9025>again:
  77.  
  78. <:#284,9025>filledit(9001, strcat$(GetDocPath$(), "*.sam"))
  79.  
  80. <:#284,9025>box = dialogbox(".", "files")
  81.  
  82. <:#284,9025>if box <<<;> 1
  83.  
  84. <:#284,9025>    return 0
  85.  
  86. <:#284,9025>endif
  87.  
  88. <:#284,9025>findit = getdialogfield$(8007)
  89.  
  90. <:#284,9025>replaceit = getdialogfield$(8008)
  91.  
  92. <:#284,9025>if getdialogfield$(8001) = ""
  93.  
  94. <:#284,9025>    message("select files from the list")
  95.  
  96. <:#284,9025>    goto again
  97.  
  98. <:#284,9025>endif
  99.  
  100. <:#284,9025>cdir = getcurrentdir$()
  101.  
  102. <:#284,9025>dim files(100)
  103.  
  104. <:#284,9025>for i = 1 to 100
  105.  
  106. <:#284,9025>    file = Ucase$(strfield$(getdialogfield$(8001), i, " "))
  107.  
  108. <:#284,9025>    if file = "" or file = -1
  109.  
  110. <:#284,9025>        break
  111.  
  112. <:#284,9025>    endif
  113.  
  114. <:#284,9025>    files(i) = file
  115.  
  116. <:#284,9025>next
  117.  
  118. <:#284,9025>Count = GetOpenFileCount()
  119.  
  120. <:#284,9025>If Count <<1
  121.  
  122. <:#284,9025>    Count = 1
  123.  
  124. <:#284,9025>Endif
  125.  
  126. <:#284,9025>Dim OpenFiles(Count)
  127.  
  128. <:#284,9025>GetOpenFileNames(&OpenFiles)
  129.  
  130. <:#284,9025>
  131.  
  132. <:#284,9025>for j = 1 to i - 1
  133.  
  134. <:#284,9025>    file = files(j)
  135.  
  136. <:#284,9025><:f240,2Times New Roman,255,0,0>    ifopen = 0
  137.  
  138. <:#284,9025><:f240,2Times New Roman,255,0,0>    Count = GetOpenFileCount()
  139.  
  140. <:#284,9025><:f240,2Times New Roman,255,0,0>    IF Count <;> 0
  141.  
  142. <:#284,9025><:f240,2Times New Roman,255,0,0>    DIM Filess(Count)
  143.  
  144. <:#284,9025><:f240,2Times New Roman,255,0,0>    GetOpenFileNames(&Filess)
  145.  
  146. <:#284,9025><:f240,2Times New Roman,255,0,0>    FOR II = 1 to Count
  147.  
  148. <:#284,9025><:f240,2Times New Roman,255,0,0>    f = filess(II)
  149.  
  150. <:#284,9025>    <:f240,2Times New Roman,255,0,0>pathplace = instr(0, f, "\")
  151.  
  152. <:#284,9025><:f240,2Times New Roman,255,0,0>    while pathplace <<<;> 0
  153.  
  154. <:#284,9025><:f240,2Times New Roman,255,0,0>        pathtemp = pathplace + 1
  155.  
  156. <:#284,9025><:f240,2Times New Roman,255,0,0>        pathplace = instr(pathtemp, f,"\")
  157.  
  158. <:#284,9025><:f240,2Times New Roman,255,0,0>    wend    
  159.  
  160. <:#284,9025><:f240,2Times New Roman,255,0,0>    length = len(f)
  161.  
  162. <:#284,9025><:f240,2Times New Roman,255,0,0>    pathplace = right$(f, length  - pathtemp + 1)
  163.  
  164. <:#284,9025><:f240,2Times New Roman,255,0,0>    if  pathplace =  ucase$(file) and ifopen = 0 then
  165.  
  166. <:#284,9025><:f240,2Times New Roman,255,0,0>        ifopen = 1<:f>
  167.  
  168. <:#284,9025><:f240,2Times New Roman,255,0,0>    <:f><:f240,2Times New Roman,255,0,0>endif
  169.  
  170. <:#284,9025><:f240,2Times New Roman,255,0,0>    NEXT    <:f>
  171.  
  172. <:#284,9025>    <:f240,2Times New Roman,255,0,0>endif
  173.  
  174. <:#284,9025><:f240,2Times New Roman,255,0,0>    if ifopen = 0 then<:f>
  175.  
  176. <:#284,9025>        FileOpen(strcat$(cdir, file),  1, "")
  177.  
  178. <:#284,9025>        replace(0, 0, 1024, findit, replaceit)
  179.  
  180. <:#284,9025>        save()
  181.  
  182. <:#284,9025>        fileclose()
  183.  
  184. <:#284,9025>    <:f240,2Times New Roman,255,0,0>else<:f>
  185.  
  186. <:#289,9025>        <:f240,2Times New Roman,255,0,0>selectwindow({file})
  187.  
  188. <:#284,9025><:f240,2Times New Roman,255,0,0>        type("<[>CtrlHome]")
  189.  
  190. <:#284,9025><:f240,2Times New Roman,255,0,0>        replace(0,0, 1024, findit, replaceit)
  191.  
  192. <:#284,9025><:f240,2Times New Roman,255,0,0>        save()
  193.  
  194. <:#284,9025><:f240,2Times New Roman,255,0,0>    endif        <:f>
  195.  
  196. <:#284,9025>next
  197.  
  198. <:#284,9025>end function
  199.  
  200. <:#284,9025>
  201.  
  202. <:#284,9025>DIALOG files
  203.  
  204. <:#284,9025>-2134376448 10 88 20 184 136 "" "" "Find & Replace Across Multiple Files"
  205.  
  206. <:#284,9025>FONT 8 "Helv"
  207.  
  208. <:#284,9025>6 58 76 8 1000 1342177280 "static" "&Search Across Files:" 0 
  209.  
  210. <:#284,9025>6 6 60 8 1003 1342308352 "static" "F&ind:" 0 
  211.  
  212. <:#284,9025>6 16 120 12 8007 1350631552 "edit" "" 0 
  213.  
  214. <:#284,9025>6 30 60 8 1004 1342308352 "static" "&Replace With:" 0 
  215.  
  216. <:#284,9025>6 40 120 12 8008 1350631552 "edit" "" 0 
  217.  
  218. <:#284,9025>6 68 66 64 9001 1352728587 "listbox" "" 0 
  219.  
  220. <:#284,9025>138 7 40 14 1 1342373889 "button" "OK" 0 
  221.  
  222. <:#284,9025>138 23 40 14 2 1342373888 "button" "Cancel" 0 
  223.  
  224. <:#284,9025>92 100 48 1 8001 1342177280 "static" "" 0 
  225.  
  226. <:#284,9025>80 68 96 8 7999 1342177280 "static" "" 0 
  227.  
  228. <:#284,9025>END DIALOG
  229.  
  230. <:#284,9025>
  231.  
  232. >
  233.  
  234. [Embedded]
  235. 00004828
  236. >
  237. [macsum] 2
  238. freplace 0 0 18 2
  239. files 1533 0 -1 71
  240. [macse]
  241. 14 freplace
  242. 0 1317
  243. 13
  244. 11 00000109
  245. 0 3 "Macro not available while running under HP NewWave."
  246. 6 0
  247. 15
  248. 9
  249. 0 268
  250. 13
  251. 0 16 [X] "*.sam"
  252. 13
  253. 0 31 9001 [X]
  254. 0 26 "." "files"
  255. 13
  256. 8 1
  257. 6 1
  258. 5 1
  259. 18 1
  260. 11 00000225
  261. 5 0
  262. 15
  263. 9
  264. 0 27 8007
  265. 13
  266. 8 2
  267. 0 27 8008
  268. 13
  269. 8 3
  270. 0 27 8001
  271. 13
  272. 7 ""
  273. 18 0
  274. 11 00000352
  275. 0 3 "select files from the list"
  276. 10 00000109
  277. 0 290
  278. 13
  279. 8 4
  280. 5 100
  281. 21 5 [X]
  282. 5 1
  283. 8 6
  284. 5 100
  285. 6 6
  286. 18 2
  287. 12 00000472
  288. 10 00000624
  289. 5 1
  290. 6 6
  291. 3 0
  292. 8 6
  293. 10 00000395
  294. 0 27 8001
  295. 13
  296. 0 20 [X] "{6}" " "
  297. 13
  298. 0 18 [X]
  299. 13
  300. 8 7
  301. 6 7
  302. 7 ""
  303. 18 0
  304. 6 7
  305. 5 -1
  306. 18 0
  307. 1 2
  308. 11 00000595
  309. 10 00000624
  310. 6 6
  311. 6 7
  312. 23 5
  313. 10 00000439
  314. 0 1050
  315. 13
  316. 8 8
  317. 6 8
  318. 5 1
  319. 18 5
  320. 11 00000680
  321. 5 1
  322. 8 8
  323. 6 8
  324. 21 9 [X]
  325. 0 1051 &9
  326. 5 1
  327. 8 10
  328. 6 6
  329. 5 1
  330. 3 1
  331. 6 10
  332. 18 2
  333. 12 00000805
  334. 10 00001521
  335. 5 1
  336. 6 10
  337. 3 0
  338. 8 10
  339. 10 00000717
  340. 6 10
  341. 22 5
  342. 8 7
  343. 5 0
  344. 8 11
  345. 0 1050
  346. 13
  347. 8 8
  348. 6 8
  349. 5 0
  350. 18 3
  351. 11 00001310
  352. 6 8
  353. 21 12 [X]
  354. 0 1051 &12
  355. 5 1
  356. 8 13
  357. 6 8
  358. 6 13
  359. 18 2
  360. 12 00000996
  361. 10 00001310
  362. 5 1
  363. 6 13
  364. 3 0
  365. 8 13
  366. 10 00000918
  367. 6 13
  368. 22 12
  369. 8 14
  370. 0 808 0 "{14}" "\"
  371. 13
  372. 8 15
  373. 6 15
  374. 5 0
  375. 18 1
  376. 11 00001145
  377. 6 15
  378. 5 1
  379. 3 0
  380. 8 16
  381. 0 808 "{16}" "{14}" "\"
  382. 13
  383. 8 15
  384. 10 00001045
  385. 0 14 "{14}"
  386. 13
  387. 8 17
  388. 6 17
  389. 6 16
  390. 3 1
  391. 5 1
  392. 3 0
  393. 0 807 "{14}" [X]
  394. 13
  395. 8 15
  396. 6 15
  397. 0 18 "{7}"
  398. 13
  399. 18 0
  400. 6 11
  401. 5 0
  402. 18 0
  403. 1 1
  404. 11 00001297
  405. 5 1
  406. 8 11
  407. 10 00000961
  408. 6 11
  409. 5 0
  410. 18 0
  411. 11 00001441
  412. 0 16 "{4}" "{7}"
  413. 13
  414. 2 102 1 [X] 1 ""
  415. 2 488 1 0 0 1024 "{2}" "{3}"
  416. 2 103 1
  417. 2 147 1
  418. 10 00001508
  419. 0 796 "{7}"
  420. 0 6 "[16420]"
  421. 2 488 1 0 0 1024 "{2}" "{3}"
  422. 2 103 1
  423. 10 00000770
  424. 6 0
  425. 15
  426. 9
  427. DIALOG files
  428. -2134376448 10 88 20 184 136 "" "" "Find & Replace Across Multiple Files" 
  429. FONT 8 "Helv" 
  430. 6 58 76 8 1000 1342177280 "static" "&Search Across Files:" 0 
  431. 6 6 60 8 1003 1342308352 "static" "F&ind:" 0 
  432. 6 16 120 12 8007 1350631552 "edit" "" 0 
  433. 6 30 60 8 1004 1342308352 "static" "&Replace With:" 0 
  434. 6 40 120 12 8008 1350631552 "edit" "" 0 
  435. 6 68 66 64 9001 1352728587 "listbox" "" 0 
  436. 138 7 40 14 1 1342373889 "button" "OK" 0 
  437. 138 23 40 14 2 1342373888 "button" "Cancel" 0 
  438. 92 100 48 1 8001 1342177280 "static" "" 0 
  439. 80 68 96 8 7999 1342177280 "static" "" 0 
  440. 00004853
  441.