home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 1998 July & August
/
Pcwk78b98.iso
/
Smart30
/
ENGLISH
/
PRODUCTS
/
LOTUS018.DSK
/
FREPLACE.SMM
< prev
next >
Wrap
INI File
|
1992-06-10
|
7KB
|
437 lines
[ver]
4
[sty]
_macro.sty
[files]
[charset]
82
ANSI (Windows, IBM CP 1252)
[revisions]
0
[prn]
PostScript Printer
[port]
LPT1:
[lang]
1
[desc]
Find and replace across multiple files
Lotus WPD Marketing
Intermediate
Replace, FileOpen, Local Arrays
noautorun
708190343
29
676699899
101
2
0
0
0
0
0
[fopts]
0
1
0
0
[lnopts]
2
Body Text
1
[docopts]
5
2
[GramStyle]
[l1]
0
[edoc]
<:#293,9360>Macro by <+!>Charlie Pappas<-!>
<:#284,9360>
<:#284,9360>function freplace()
<:#284,9360>IF IsNewWave()
<:#284,9360> Message("Macro not available while running under HP NewWave.")
<:#284,9360> Exit Function
<:#284,9360>ENDIF
<:#284,9360>'ignorekeyboard(2)
<:#284,9360>again:
<:#284,9360>filledit(9001, strcat$(GetDocPath$(), "*.sam"))
<:#284,9360>box = dialogbox(".", "files")
<:#284,9360>if box <<<;> 1
<:#284,9360> return 0
<:#284,9360>endif
<:#284,9360>findit = getdialogfield$(8007)
<:#284,9360>replaceit = getdialogfield$(8008)
<:#284,9360>if getdialogfield$(8001) = ""
<:#284,9360> message("select files from the list")
<:#284,9360> goto again
<:#284,9360>endif
<:#284,9360>cdir = getcurrentdir$()
<:#284,9360>dim files(100)
<:#284,9360>for i = 1 to 100
<:#284,9360> file = Ucase$(strfield$(getdialogfield$(8001), i, " "))
<:#284,9360> if file = "" or file = -1
<:#284,9360> break
<:#284,9360> endif
<:#284,9360> files(i) = file
<:#284,9360>next
<:#284,9360>Count = GetOpenFileCount()
<:#284,9360>If Count <<1
<:#284,9360> Count = 1
<:#284,9360>Endif
<:#284,9360>Dim OpenFiles(Count)
<:#284,9360>GetOpenFileNames(&OpenFiles)
<:#284,9360>
<:#284,9360>for j = 1 to i - 1
file = files(j)
<:f240,2Times New Roman,255,0,0><:f240,2Times New Roman,255,0,0> ifopen = 0
<:f240,2Times New Roman,255,0,0> Count = GetOpenFileCount()
<:f240,2Times New Roman,255,0,0> IF Count <;> 0
<:f240,2Times New Roman,255,0,0> DIM Filess(Count)
<:f240,2Times New Roman,255,0,0> GetOpenFileNames(&Filess)
<:f240,2Times New Roman,255,0,0> FOR II = 1 to Count
<:f240,2Times New Roman,255,0,0> f = filess(II)
<:f240,2Times New Roman,255,0,0>pathplace = instr(0, f, "\")
<:f240,2Times New Roman,255,0,0> while pathplace <<<;> 0
<:f240,2Times New Roman,255,0,0> pathtemp = pathplace + 1
<:f240,2Times New Roman,255,0,0> pathplace = instr(pathtemp, f,"\")
<:f240,2Times New Roman,255,0,0> wend
<:f240,2Times New Roman,255,0,0> length = len(f)
<:f240,2Times New Roman,255,0,0> pathplace = right$(f, length - pathtemp + 1)
<:f240,2Times New Roman,255,0,0> if pathplace = ucase$(file) and ifopen = 0 then
<:f240,2Times New Roman,255,0,0> ifopen = 1<:f>
<:f240,2Times New Roman,255,0,0> <:f><:f240,2Times New Roman,255,0,0>endif
<:f240,2Times New Roman,255,0,0> NEXT <:f>
<:f240,2Times New Roman,255,0,0>endif
<:f240,2Times New Roman,255,0,0> if ifopen = 0 then<:f>
<:f240,2Times New Roman,255,0,0><:f> FileOpen(strcat$(cdir, file), 1, "")
replace(0, 0, 1024, findit, replaceit)
save()
fileclose()
<:f240,2Times New Roman,255,0,0>else<:f>
<:f240,2Times New Roman,255,0,0>selectwindow({file})
<:f240,2Times New Roman,255,0,0> type("<[>CtrlHome]")
<:f240,2Times New Roman,255,0,0> replace(0,0, 1024, findit, replaceit)
<:f240,2Times New Roman,255,0,0><:f><:f240,2Times New Roman,255,0,0> save()
<:f240,2Times New Roman,255,0,0> endif <:f>
next
<:#284,9360>end function
<:#284,9360>
<:#284,9360>DIALOG files
<:#284,9360>-2134376448 10 88 20 184 136 "" "" "Find & Replace Across Multiple Files"
<:#284,9360>FONT 8 "Helv"
<:#284,9360>6 58 76 8 1000 1342177280 "static" "&Search Across Files:" 0
<:#284,9360>6 6 60 8 1003 1342308352 "static" "F&ind:" 0
<:#284,9360>6 16 120 12 8007 1350631552 "edit" "" 0
<:#284,9360>6 30 60 8 1004 1342308352 "static" "&Replace With:" 0
<:#284,9360>6 40 120 12 8008 1350631552 "edit" "" 0
<:#284,9360>6 68 66 64 9001 1352728587 "listbox" "" 0
<:#284,9360>138 7 40 14 1 1342373889 "button" "OK" 0
<:#284,9360>138 23 40 14 2 1342373888 "button" "Cancel" 0
<:#284,9360>92 100 48 1 8001 1342177280 "static" "" 0
<:#284,9360>80 68 96 8 7999 1342177280 "static" "" 0
<:#284,9360>END DIALOG
<:#284,9360>
>
[Embedded]
00004382
>
[macsum] 2
freplace 0 0 18 2
files 1533 0 -1 71
[macse]
14 freplace
0 1317
13
11 00000109
0 3 "Macro not available while running under HP NewWave."
6 0
15
9
0 268
13
0 16 [X] "*.sam"
13
0 31 9001 [X]
0 26 "." "files"
13
8 1
6 1
5 1
18 1
11 00000225
5 0
15
9
0 27 8007
13
8 2
0 27 8008
13
8 3
0 27 8001
13
7 ""
18 0
11 00000352
0 3 "select files from the list"
10 00000109
0 290
13
8 4
5 100
21 5 [X]
5 1
8 6
5 100
6 6
18 2
12 00000472
10 00000624
5 1
6 6
3 0
8 6
10 00000395
0 27 8001
13
0 20 [X] "{6}" " "
13
0 18 [X]
13
8 7
6 7
7 ""
18 0
6 7
5 -1
18 0
1 2
11 00000595
10 00000624
6 6
6 7
23 5
10 00000439
0 1050
13
8 8
6 8
5 1
18 5
11 00000680
5 1
8 8
6 8
21 9 [X]
0 1051 &9
5 1
8 10
6 6
5 1
3 1
6 10
18 2
12 00000805
10 00001521
5 1
6 10
3 0
8 10
10 00000717
6 10
22 5
8 7
5 0
8 11
0 1050
13
8 8
6 8
5 0
18 3
11 00001310
6 8
21 12 [X]
0 1051 &12
5 1
8 13
6 8
6 13
18 2
12 00000996
10 00001310
5 1
6 13
3 0
8 13
10 00000918
6 13
22 12
8 14
0 808 0 "{14}" "\"
13
8 15
6 15
5 0
18 1
11 00001145
6 15
5 1
3 0
8 16
0 808 "{16}" "{14}" "\"
13
8 15
10 00001045
0 14 "{14}"
13
8 17
6 17
6 16
3 1
5 1
3 0
0 807 "{14}" [X]
13
8 15
6 15
0 18 "{7}"
13
18 0
6 11
5 0
18 0
1 1
11 00001297
5 1
8 11
10 00000961
6 11
5 0
18 0
11 00001441
0 16 "{4}" "{7}"
13
2 102 1 [X] 1 ""
2 488 1 0 0 1024 "{2}" "{3}"
2 103 1
2 147 1
10 00001508
0 796 "{7}"
0 6 "[16420]"
2 488 1 0 0 1024 "{2}" "{3}"
2 103 1
10 00000770
6 0
15
9
DIALOG files
-2134376448 10 88 20 184 136 "" "" "Find & Replace Across Multiple Files"
FONT 8 "Helv"
6 58 76 8 1000 1342177280 "static" "&Search Across Files:" 0
6 6 60 8 1003 1342308352 "static" "F&ind:" 0
6 16 120 12 8007 1350631552 "edit" "" 0
6 30 60 8 1004 1342308352 "static" "&Replace With:" 0
6 40 120 12 8008 1350631552 "edit" "" 0
6 68 66 64 9001 1352728587 "listbox" "" 0
138 7 40 14 1 1342373889 "button" "OK" 0
138 23 40 14 2 1342373888 "button" "Cancel" 0
92 100 48 1 8001 1342177280 "static" "" 0
80 68 96 8 7999 1342177280 "static" "" 0
00004407