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