home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 1998 July & August
/
Pcwk78b98.iso
/
Smart30
/
ENGLISH
/
PRODUCTS
/
LOTUS018.DSK
/
CROSSREF.SMM
< prev
next >
Wrap
INI File
|
1992-06-17
|
6KB
|
443 lines
[ver]
4
[sty]
_macro.sty
[files]
[charset]
82
ANSI (Windows, IBM CP 1252)
[revisions]
0
[prn]
PostScript Printer
[port]
LPT1:
[lang]
1
[desc]
Generate cross references between files in a master document that has less than 8 files.
Lotus Word Processing Division
Advanced
FileOpen, MasterDocument
noautorun
708809780
36
672617318
408
3
325
2164
5
7
0
[fopts]
0
1
0
0
[lnopts]
2
Body Text
1
[docopts]
5
2
[GramStyle]
[ParaNum]
1
[l1]
0
[pg]
3
45 0 12 0 0 1 0 65535 65535 Standard 65535 0 0 0 0 0 0 0 0 0 65535 0 0 65535 0 0 0 0 0
90 0 4 0 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
91 0 12 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
[edoc]
<+@><:#284,9360>' Xref - cross reference between files in a master document. Because the field
<+@><:#284,9360>'"Pageref" can only work with bookmarks in the current file, when you need the page
<+@><:#284,9360>'number of a bookmark in another file, you can insert the powerfield
<+@><:#284,9360>'getglobalvar$("BookmarkName") after running this macro. (Insert the name of your
<+@><:#284,9360> 'bookmark in place of BookmarkName.)
<+@><:#284,9360>'
<+@><:#284,9360>'This macro will run through all files in the master, and for each bookmark it will
<+@><:#284,9360> 'determine the actual page number, then create a global variable by that same name,
<+@><:#284,9360> 'and assign the page number to it. Also the macro updates powerfields previously
<+@><:#284,9360> 'inserted
<:#284,9360>
<:#284,9360>'This version is limited to 9 files
<:#284,9360>
<:#284,9360>Declare DebugArray(Array)
<:#284,9360>define IsOKToRun(menuname) GetInfo(217, 24, %1);
<:#284,9360>
@Function@<:#293,9360>FUNCTION Xref()
IF IsNewWave()
Message("Macro not available while running under HP NewWave.")
Exit Function
ENDIF
@Subhead@result=IsOKToRun(SaveAs)
@Subhead@<:#284,9360>if result !=1 exit function
@Subhead@<:#284,9360>endif
<:#284,9360>defstr mascount;
<:#284,9360>totpages = 0
<:#284,9360>
<:#284,9360>if (0 = Assign(&mascount, GetMasterFilesCount()))
<:#284,9360> message("Not a master document")
<:#284,9360> return -1;
<:#284,9360>else
<:#284,9360>dim masfiles(mascount)
<:#284,9360>GetMasterFiles(&masfiles)
<:#284,9360>DebugArray(&MasFiles)
<:#284,9360>mascount = arraysize(&masfiles)
<:#284,9360>for i = 1 to mascount ' Generate left the last one up
<:#284,9360>ifopen = 0
<:#284,9360> Count = GetOpenFileCount()
<:#284,9360> IF Count <;> 0
<:#284,9360> DIM Filess(Count)
<:#284,9360> GetOpenFileNames(&Filess)
<:#284,9360> FOR II = 1 to Count
<:#284,9360> f = filess(II)
<:#284,9360> if f = ucase$(masfiles(i)) and ifopen = 0 then
<:#284,9360> ifopen = 1
<:#284,9360> endif
<:#284,9360> NEXT
<:#284,9360> endif
<:#284,9360> if ifopen = 0 then
<:#284,9360> FileOpen(masfiles(i), 1, "")
<:#284,9360> else
<:#284,9360> file = masfiles(i)
<:#284,9360> selectwindow(file)
<:#284,9360> endif
<:#284,9360> DarkMode(1)
<:#284,9360> type("<[>ctrlend]") ' Force load to finish
<:#284,9360> type("<[>ctrlhome]") ' Back to the top for looks
<:#284,9360> DarkMode(0)
<:#284,9360> call CreateGlobals(totpages)
<:#284,9360> totpages = totpages + evalfield("numpages")
<:#284,9360> FieldUpdateAll()
<:#284,9360>next
<:#284,9360>endif
<:#284,9360>END FUNCTION
@Function@<:#293,9360>FUNCTION CreateGlobals(totpages)
<:#284,9360>defstr bookcnt
<:#284,9360>bookcnt = getbookmarkcount()
<:#284,9360>if bookcnt = 0
<:#284,9360> return 0; ' No bookmarks, fast exit here
<:#284,9360>else
<:#284,9360>dim booknames(bookcnt)
<:#284,9360>GetBookMarkNames(&booknames)
<:#284,9360>for i = 1 to bookcnt
<:#284,9360> ' get the GetBookMarkPage returns the page number of the
<:#284,9360> ' bookmark relative to this file, use PhysicalToLogical
<:#284,9360> ' to the the logical page. Then create a global var
<:#284,9360> ' using the bookmark name, then assign that page number.
<:#284,9360> page = totpages + getbookmarkpage(booknames(i))
<:#284,9360> AllocGlobalVar(booknames(i), 1)
<:#284,9360> SetGlobalVar(booknames(i), page)
<:#284,9360>next
<:#284,9360>endif
<:#284,9360>END FUNCTION
<:#284,9360>
@Function@<:#293,9360>Function DebugArray(MasFiles)
<:#284,9360>Count = ArraySize(&MasFiles)
<:#284,9360>For t = 1 to count
<:#284,9360> Info = *MasFiles(T)
<:#284,9360> Message("{T} = {Info}")
<:#284,9360>Next
<:#284,9360>End Function
>
[Embedded]
00004727
>
[macsum] 3
Xref 0 0 12 16
CreateGlobals 966 1 5 64
DebugArray 1285 1 4 84
[macse]
14 Xref
0 1317
13
11 00000105
0 3 "Macro not available while running under HP NewWave."
6 0
15
9
0 1313 217 24 104
13
8 1
6 1
5 1
18 1
11 00000174
6 0
15
9
5 0
8 3
5 0
0 1047
13
0 805 &2 [X]
13
18 0
11 00000293
0 3 "Not a master document"
5 -1
15
9
10 00000954
6 2
21 4 [X]
0 1048 &4
16 DebugArray &4
0 1046 &4
13
8 2
5 1
8 5
6 2
6 5
18 2
12 00000442
10 00000954
5 1
6 5
3 0
8 5
10 00000367
5 0
8 6
0 1050
13
8 7
6 7
5 0
18 3
11 00000720
6 7
21 8 [X]
0 1051 &8
5 1
8 9
6 7
6 9
18 2
12 00000609
10 00000720
5 1
6 9
3 0
8 9
10 00000534
6 9
22 8
8 10
6 10
6 5
22 4
0 18 [X]
13
18 0
6 6
5 0
18 0
1 1
11 00000707
5 1
8 6
10 00000576
6 6
5 0
18 0
11 00000791
6 5
22 4
2 102 1 [X] 1 ""
10 00000822
6 5
22 4
8 11
0 796 "{11}"
0 292 1
0 6 "[16419]"
0 6 "[16420]"
0 292 0
16 CreateGlobals "{3}"
6 3
0 1289 "numpages"
13
3 0
8 3
2 267 1
10 00000409
6 0
15
9
14 CreateGlobals
0 1039
13
8 2
6 2
5 0
18 0
11 00000089
5 0
15
9
10 00000307
6 2
21 3 [X]
0 1040 &3
5 1
8 4
6 2
6 4
18 2
12 00000200
10 00000307
5 1
6 4
3 0
8 4
10 00000125
6 0
6 4
22 3
0 1049 [X]
13
3 0
8 5
6 4
22 3
0 271 [X] 1
6 4
22 3
0 264 [X] "{5}"
10 00000167
6 1
15
9
14 DebugArray
0 1046 &0
13
8 2
5 1
8 3
6 2
6 3
18 2
12 00000120
10 00000166
5 1
6 3
3 0
8 3
10 00000045
6 3
22 0
8 4
0 3 "{3} = {4}"
10 00000087
6 1
15
9
00004752