home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 1998 July & August
/
Pcwk78b98.iso
/
Smart30
/
ENGLISH
/
PRODUCTS
/
LOTUS018.DSK
/
MASTRDOC.SMM
< prev
next >
Wrap
INI File
|
1992-06-05
|
11KB
|
670 lines
[ver]
4
[sty]
_macro.sty
[files]
[charset]
82
ANSI (Windows, IBM CP 1252)
[revisions]
0
[prn]
PostScript Printer
[port]
LPT1:
[lang]
1
[desc]
Browse files of a master document
Lotus Word Processing Division
Advanced
Define, MasterDoc
autorun
707773333
14
676166658
156
5
0
0
0
0
0
[fopts]
0
1
0
0
[lnopts]
2
Body Text
1
[docopts]
5
2
[GramStyle]
[ParaNum]
1
[l1]
0
[pg]
5
40 0 17 512 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
82 0 17 512 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
126 0 16 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
136 0 5 512 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
163 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
[edoc]
<:#568,9360>' Master File Browser - these macros will allow the user to "Next" and "Prev" through the files
<:#568,9360>' of a master document. We add a cascading menu off the file menu. Here they can "INIT" ,
<:#284,9360>' Next and Prev.
<:#284,9360>' We keep the filenames in a global array.
<:#284,9360>
<:#284,9360>DEFINE GlobID "MasterFiles"
<:#284,9360>DEFINE GlobIDC "MasterCount"
<:#284,9360>DEFINE GetFile(which) GetGlobalArray$(GlobID, %1)
<:#284,9360>DEFINE MaxID() GetGlobalArray$(GlobIDC, 1)
<:#284,9360>DEFINE SetMaxID(max) SetGlobalArray(GlobIDC, 1, %1)
<:#284,9360>DEFINE SetFile(index, name) SetGlobalArray(GlobID, %1, %2)
<:#284,9360>declare AlreadyOpened(p1)
<:#284,9360>Declare OpenOne(p1)
<:#284,9360>
<:#284,9360>' AddOurMenu - This just adds us to the menu
<:#284,9360>
@Function@<:#293,9360>FUNCTION AddOurMenu()
<:#284,9360>IF IsNewWave()
<:#284,9360> Message("Macro not available while running under HP NewWave.")
<:#284,9360> Exit Function
<:#284,9360>ENDIF
<:#284,9360>'singlestep(0)
<:#284,9360>AllocGlobalVar("Init",1)
<:#284,9360>SetGlobalVar("Init",0)
<:#284,9360>
<:#284,9360>menu = "&File"; ' Which menu
<:#284,9360>submenu = "&Master Browser"; ' Our name
<:#284,9360>DeleteMenu(1, menu, Submenu); ' Delete old if there
<:#284,9360>
<:#284,9360>InsertCascadeMenu(1, menu, 8, submenu)
<:#284,9360>
<:#284,9360>InitMac = StrCat$(GetRunningMacroFile$(), "!OpenMaster")
<:#568,9360>AddCascadeMenuItem(1, menu, submenu, "&Init", InitMac, "Inititalize Browser new master file")
<:#284,9360>
<:#284,9360>NextMac = StrCat$(GetRunningMacroFile$(), "!NextMaster")
<:#568,9360>AddCascadeMenuItem(1, menu, submenu, "&Next_Master", NextMac, "Next Master File")
<:#284,9360>
<:#284,9360>PrevMac = StrCat$(GetRunningMacroFile$(), "!PrevMaster")
<:#568,9360>AddCascadeMenuItem(1, menu, submenu, "&Prev_Master", PrevMac, "Previous Master File")
END FUNCTION<:p<* >>
<:#284,9360>
<:#568,9360>' OpenMaster - Get the list of files for a master document, then load them into the global array
<:#284,9360>
@Function@<:#293,9360>FUNCTION OpenMaster()
<:#284,9360>'singlestep(0)
<:#284,9360>defstr mascount;
<:#284,9360>if (0 = Assign(&mascount, GetMasterFilesCount()))
<:#284,9360> message("The current document is not a master.")
<:#284,9360> return -1;
<:#284,9360>endif
<:#284,9360>AllocGlobalVar(GlobID, mascount) ' Where we keep the names
<:#284,9360>AllocGlobalVar(GlobIDC, 1) ' How we know how many
<:#284,9360>SetGlobalVar("Init",1)
<:#284,9360>dim masfiles(mascount) ' load our local array
<:#284,9360>GetMasterFiles(&masfiles) ' then transfer them to the
<:#284,9360>for i = 1 to mascount ' Global array
<:#284,9360> SetFile(i, UCase$(masfiles(i))) ' Upper case all for compares later
<:#284,9360>next
<:#284,9360>SetMaxID(mascount)
<:#284,9360>
<:#284,9360>' Now load the first master file.
<:#284,9360>
<:#284,9360>fname = masfiles(1)
<:#284,9360>if (AlreadyOpened(fname))
<:#284,9360> SelectWindow(fname)
<:#284,9360>else
<:#284,9360> OpenOne(masfiles(1))
<:#284,9360>endif
<:#284,9360>END FUNCTION
<:#284,9360>
<:#284,9360>' IsCurrentAMaster - is the active window one of the master files?
<:#284,9360>' RETURN 0 if not one of the master files otherwise its ordered number
<:#284,9360>
@Function@<:#293,9360>FUNCTION IsCurrentAMaster()
<:#284,9360>cur = UCase$(GetOpenFileName$()) ' Upper case the current
<:#284,9360>for i = 1 to MaxID() ' Run though all master files
<:#284,9360> if (cur = GetFile(i)) ' Found one?
<:#284,9360> return i ' Yes, return its index
<:#284,9360> endif
<:#284,9360>next
<:#284,9360>return 0; ' Not found.
END FUNCTION<:p<* >>
<:#284,9360>
<:#568,9360>' NextMaster - Called from the menu. Get the active window's file, determine if its part of the
<:#284,9360>' master file, if so either open or select the next file.
<:#284,9360>'
@Function@<:#293,9360>FUNCTION NextMaster()
<:#284,9360>Declare AlreadyOpened(p1)
<:#284,9360>InitStat = GetGlobalVar$("Init")
<:#284,9360>If InitStat = 0
<:#284,9360> Message("Please select the Init function")
<:#284,9360> Exit Function
<:#284,9360>Endif
<:#284,9360>id = IsCurrentAMaster() ' The active window part of master document?
<:#284,9360>if (0 != id AND id << MaxID())
<:#284,9360>
<:#284,9360> ' NOTE the parentheses around the id + 1, is required for the define's parameter
<:#284,9360> ' substitution. Without the parentheses there would be 3 parameters, not 1!
<:#284,9360>
<:#284,9360> fname = GetFile((id + 1)) ' Get the next one
<:#284,9360> if NOT AlreadyOpened(fname) ' If its not opened
<:#284,9360> OpenOne(fname) ' Open it
<:#284,9360> else
<:#284,9360> SelectWindow(fname) ' Otherwise just select it
<:#284,9360> endif
<:#284,9360>elseif (0 = id)
<:#284,9360> Message("The current file is not part of the selected master file.")
<:#284,9360>else
<:#284,9360> Message("No more files.")
<:#284,9360>endif
<:#284,9360>END FUNCTION
<:#284,9360>
<:#284,9360>' PrevMaster - select the previous file.
<:#284,9360>
@Function@<:#293,9360>FUNCTION PrevMaster()
<:#284,9360>InitStat = GetGlobalVar$("Init")
<:#284,9360>If InitStat = 0
<:#284,9360> Message("Please select the Init function")
<:#284,9360> Exit Function
<:#284,9360>Endif
<:#284,9360>
<:#284,9360>id = IsCurrentAMaster()
<:#284,9360>if (id <;> 1)
<:#284,9360> fname = GetFile((id - 1))
<:#284,9360> if NOT AlreadyOpened(fname)
<:#284,9360> OpenOne(fname)
<:#284,9360> else
<:#284,9360> SelectWindow(fname)
<:#284,9360> endif
<:#284,9360>elseif (0 = id)
<:#284,9360> Message("The current file is not part of the selected master file.")
<:#284,9360>else
<:#284,9360> Message("This is the first file in the master document.")
<:#284,9360>endif
<:#284,9360>END FUNCTION
<:p<* >>
<:#240,9360>' AlreadyOpened - is the passed file already open?
<:#240,9360>' RETURN TRUE is so.
<:#240,9360>
@Function@<:#240,9360>FUNCTION AlreadyOpened(fname)
<:#240,9360>filecnt = GetOpenFileCount()
<:#240,9360>dim files(filecnt)
<:#240,9360>GetOpenFileNames(&files) ' Get the list of files
<:#240,9360>for i = 1 to filecnt
<:#240,9360> if (fname = files(i)) ' match?
<:#240,9360> return 1; ' Is is open.
<:#240,9360> endif
<:#240,9360>next
<:#240,9360>return 0; ' No open
<:#240,9360>END FUNCTION
<:#240,9360>
<:#480,9360>' OpenOne - Open a file, give it its own window, if we dont already have 9 open.
<:#240,9360>
@Function@<:#240,9360>FUNCTION OpenOne(fname)
<:#240,9360>cnt = GetOpenFileCount()
<:#240,9360>if (cnt << 9)
<:#240,9360> openopt = 1
<:#240,9360>else
<:#240,9360> openopt = 129
<:#240,9360>endif
<:#240,9360>FileOpen(fname, openopt, "")
<:#240,9360>END FUNCTION
<:#284,9360>
>
[Embedded]
00008040
>
[macsum] 7
AddOurMenu 0 0 6 16
OpenMaster 572 0 5 43
IsCurrentAMaster 1096 0 3 73
NextMaster 1358 0 4 86
PrevMaster 1871 0 4 114
AlreadyOpened 2373 1 4 139
OpenOne 2603 1 3 153
[macse]
14 AddOurMenu
0 1317
13
11 00000111
0 3 "Macro not available while running under HP NewWave."
6 0
15
9
0 271 "Init" 1
0 264 "Init" 0
7 "&File"
8 1
7 "&Master Browser"
8 2
0 521 1 "{1}" "{2}"
0 528 1 "{1}" 8 "{2}"
0 802
13
0 16 [X] "!OpenMaster"
13
8 3
0 525 1 "{1}" "{2}" "&Init" "{3}" "Inititalize Browser new master file"
0 802
13
0 16 [X] "!NextMaster"
13
8 4
0 525 1 "{1}" "{2}" "&Next_Master" "{4}" "Next Master File"
0 802
13
0 16 [X] "!PrevMaster"
13
8 5
0 525 1 "{1}" "{2}" "&Prev_Master" "{5}" "Previous Master File"
6 0
15
9
14 OpenMaster
5 0
0 1047
13
0 805 &1 [X]
13
18 0
11 00000127
0 3 "The current document is not a master."
5 -1
15
9
0 271 "MasterFiles" "{1}"
0 271 "MasterCount" 1
0 264 "Init" 1
6 1
21 2 [X]
0 1048 &2
5 1
8 3
6 1
6 3
18 2
12 00000304
10 00000373
5 1
6 3
3 0
8 3
10 00000229
6 3
22 2
0 18 [X]
13
0 272 "MasterFiles" "{3}" [X]
10 00000271
0 272 "MasterCount" 1 "{1}"
5 1
22 2
8 4
16 AlreadyOpened "{4}"
13
11 00000485
0 796 "{4}"
10 00000512
5 1
22 2
16 OpenOne [X]
6 0
15
9
14 IsCurrentAMaster
0 267
13
0 18 [X]
13
8 1
5 1
8 2
0 273 "MasterCount" 1
13
6 2
18 2
12 00000158
10 00000238
5 1
6 2
3 0
8 2
10 00000061
6 1
0 273 "MasterFiles" "{2}"
13
18 0
11 00000225
6 2
15
9
10 00000125
5 0
15
9
6 0
15
9
14 NextMaster
0 265 "Init"
13
8 1
6 1
5 0
18 0
11 00000118
0 3 "Please select the Init function"
6 0
15
9
16 IsCurrentAMaster
13
8 2
5 0
6 2
18 1
6 2
0 273 "MasterCount" 1
13
18 5
1 1
11 00000372
6 2
5 1
3 0
0 273 "MasterFiles" [X]
13
8 3
16 AlreadyOpened "{3}"
13
1 3
11 00000346
16 OpenOne "{3}"
10 00000359
0 796 "{3}"
10 00000501
5 0
6 2
18 0
11 00000479
0 3 "The current file is not part of the selected master file."
10 00000501
0 3 "No more files."
6 0
15
9
14 PrevMaster
0 265 "Init"
13
8 1
6 1
5 0
18 0
11 00000118
0 3 "Please select the Init function"
6 0
15
9
16 IsCurrentAMaster
13
8 2
6 2
5 1
18 3
11 00000329
6 2
5 1
3 1
0 273 "MasterFiles" [X]
13
8 3
16 AlreadyOpened "{3}"
13
1 3
11 00000303
16 OpenOne "{3}"
10 00000316
0 796 "{3}"
10 00000490
5 0
6 2
18 0
11 00000436
0 3 "The current file is not part of the selected master file."
10 00000490
0 3 "This is the first file in the master document."
6 0
15
9
14 AlreadyOpened
0 1050
13
8 2
6 2
21 3 [X]
0 1051 &3
5 1
8 4
6 2
6 4
18 2
12 00000146
10 00000206
5 1
6 4
3 0
8 4
10 00000071
6 0
6 4
22 3
18 0
11 00000193
5 1
15
9
10 00000113
5 0
15
9
6 1
15
9
14 OpenOne
0 1050
13
8 2
6 2
5 9
18 5
11 00000081
5 1
8 3
10 00000093
5 129
8 3
2 102 1 "{0}" "{3}" ""
6 1
15
9
00008065