home *** CD-ROM | disk | FTP | other *** search
INI File | 1992-10-29 | 27.5 KB | 1,878 lines |
- [ver]
- 4
- [sty]
-
- [files]
- [charset]
- 82
- ANSI (Windows, IBM CP 1252)
- [revisions]
- 0
- [prn]
- NEC Silentwriter LC890XL
- [port]
- LPT2:
- [lang]
- 1
- [desc]
- Ascend Find Name, uses DDE to get name from Ascend Address and Phone module
-
-
-
-
- 720372016
- 24
- 719679532
- 1104
- 7
- 0
- 0
- 0
- 0
-
-
-
-
-
-
- 0
- [fopts]
- 0
- 1
- 0
- 0
- [lnopts]
- 2
- Body Text
- 1
- [docopts]
- 5
- 3
- [GramStyle]
-
- [tag]
- Body Text
- 2
- [fnt]
- TimesNewRomanPS
- 240
- 0
- 49152
- [algn]
- 1
- 1
- 0
- 0
- 0
- [spc]
- 33
- 273
- 1
- 0
- 0
- 1
- 100
- [brk]
- 4
- [line]
- 8
- 0
- 1
- 0
- 1
- 1
- 1
- 10
- 10
- 1
- [spec]
- 0
- 0
-
- 0
- 1
- 1
- 0
- 0
- 0
- 0
- [nfmt]
- 280
- 1
- 2
- .
- ,
- $
- Body Text
- 0
- 0
- [tag]
- Body Single
- 3
- [fnt]
- TimesNewRomanPS
- 240
- 0
- 49152
- [algn]
- 1
- 1
- 0
- 0
- 0
- [spc]
- 33
- 273
- 1
- 0
- 0
- 1
- 100
- [brk]
- 4
- [line]
- 8
- 0
- 1
- 0
- 1
- 1
- 1
- 10
- 10
- 1
- [spec]
- 0
- 0
-
- 0
- 1
- 1
- 0
- 0
- 0
- 0
- [nfmt]
- 280
- 1
- 2
- .
- ,
- $
- Body Single
- 0
- 0
- [tag]
- Bullet
- 4
- [fnt]
- TimesNewRomanPS
- 240
- 0
- 49152
- [algn]
- 1
- 1
- 0
- 288
- 288
- [spc]
- 33
- 273
- 1
- 0
- 0
- 1
- 100
- [brk]
- 4
- [line]
- 8
- 0
- 1
- 0
- 1
- 1
- 1
- 10
- 10
- 1
- [spec]
- 0
- 0
- <*0>
- 360
- 1
- 1
- 0
- 0
- 0
- 0
- [nfmt]
- 272
- 1
- 2
- .
- ,
- $
- Bullet
- 0
- 0
- [tag]
- Bullet 1
- 5
- [fnt]
- TimesNewRomanPS
- 240
- 0
- 49152
- [algn]
- 1
- 1
- 288
- 288
- 288
- [spc]
- 33
- 273
- 1
- 0
- 0
- 1
- 100
- [brk]
- 4
- [line]
- 8
- 0
- 1
- 0
- 1
- 1
- 1
- 10
- 10
- 1
- [spec]
- 0
- 0
- <*5>
- 0
- 1
- 1
- 0
- 0
- 0
- 0
- [nfmt]
- 280
- 1
- 2
- .
- ,
- $
- Bullet 1
- 0
- 0
- [tag]
- Number List
- 6
- [fnt]
- TimesNewRomanPS
- 240
- 0
- 49152
- [algn]
- 1
- 1
- 360
- 360
- 360
- [spc]
- 33
- 273
- 1
- 0
- 0
- 1
- 100
- [brk]
- 4
- [line]
- 8
- 0
- 1
- 0
- 1
- 1
- 1
- 10
- 10
- 1
- [spec]
- 0
- 0
- <*:>.
- 360
- 1
- 1
- 0
- 0
- 0
- 0
- [nfmt]
- 272
- 1
- 2
- .
- ,
- $
- Number List
- 0
- 0
- [tag]
- Subhead
- 7
- [fnt]
- TimesNewRomanPS
- 240
- 0
- 49155
- [algn]
- 1
- 1
- 0
- 0
- 0
- [spc]
- 33
- 273
- 1
- 72
- 72
- 1
- 100
- [brk]
- 4
- [line]
- 8
- 0
- 1
- 0
- 1
- 1
- 1
- 10
- 10
- 1
- [spec]
- 0
- 2
-
- 0
- 1
- 1
- 0
- 0
- 0
- 0
- [nfmt]
- 272
- 1
- 2
- .
- ,
- $
- Subhead
- 0
- 0
- [tag]
- Title
- 8
- [fnt]
- Arial MT
- 360
- 0
- 16385
- [algn]
- 4
- 1
- 0
- 0
- 0
- [spc]
- 33
- 446
- 1
- 144
- 72
- 1
- 100
- [brk]
- 16
- [line]
- 8
- 0
- 1
- 0
- 1
- 1
- 1
- 10
- 10
- 1
- [spec]
- 0
- 1
-
- 0
- 1
- 1
- 0
- 0
- 0
- 0
- [nfmt]
- 272
- 1
- 2
- .
- ,
- $
- Title
- 0
- 0
- [lay]
- Standard
- 513
- [rght]
- 15840
- 12240
- 1
- 1440
- 1440
- 1
- 1440
- 1440
- 0
- 1
- 0
- 1
- 0
- 2
- 1
- 1440
- 10800
- 12
- 1
- 720
- 1
- 1440
- 1
- 2160
- 1
- 2880
- 1
- 3600
- 1
- 4320
- 1
- 5040
- 1
- 5760
- 1
- 6480
- 1
- 7200
- 1
- 7920
- 1
- 8640
- [hrght]
- [lyfrm]
- 1
- 11200
- 0
- 0
- 12240
- 1440
- 0
- 1
- 3
- 1 0 0 0 0 0 0
- 0
- 0
- 1
- [frmlay]
- 1440
- 12240
- 1
- 1440
- 72
- 1
- 792
- 1440
- 0
- 1
- 0
- 1
- 1
- 0
- 1
- 1440
- 10800
- 1
- 3
- 9360
- [txt]
- >
- [frght]
- [lyfrm]
- 1
- 13248
- 0
- 14400
- 12240
- 15840
- 0
- 1
- 3
- 1 0 0 0 0 0 0
- 0
- 0
- 2
- [frmlay]
- 15840
- 12240
- 1
- 1440
- 792
- 1
- 14472
- 1440
- 0
- 1
- 0
- 1
- 1
- 0
- 1
- 1440
- 10800
- 2
- 2
- 4680
- 3
- 9360
- [txt]
-
- >
- [elay]
- [l1]
- 0
- [edoc]
- <+@><:#278,9360>' Ascend Find Name
-
- <+@><:#278,9360>' Franklin Quest Co.
-
- <+@><:#278,9360>' Copyright </i> 1992
-
- <+@><:#278,9360>
-
- <+@><:#278,9360>' This Macro accesses Franklin Quest's Ascend for Windows through DDE (Dynamic
-
- <+@><:#278,9360>' Data Exchange) to link names from Ascend's Address and Phone module into
-
- <+@><:#278,9360>' Ami Professional documents.
-
- <+@><:#278,9360>
-
- <+@><:#278,9360>
-
- <+@><:#278,9360>' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' '
-
- <+@><:#278,9360>' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' '
-
- <+@>Function Main()
-
- <+@><:#278,9360> Declare SetupDDE();
-
- <+@> Declare CloseDDE();
-
- <+@> Declare FreeGlobals();
-
- <+@><:#278,9360> Declare AscendGetNameDialog();
-
- <+@>
-
- <+@> Defstr n, result, a$, DDEChannel, errorMsg$, macroPath$;
-
- <+@><:#278,9360>
-
- <+@><:#278,9360> ' Global Variables
-
- <+@><:#278,9360> AllocGlobalVar("DDEChannel", 1);
-
- <+@><:#278,9360> AllocGlobalVar("names$", 5);
-
- <+@><:#278,9360> AllocGlobalVar("records$", 5);
-
- <+@> AllocGlobalVar("errorMsg$", 1);
-
- <+@> AllocGlobalVar("length", 1);
-
- <+@> AllocGlobalVar("currentButton", 1);
-
- <+@>
-
- <+@><:#278,9360> SetGlobalVar("errorMsg$", "An error occurred.");
-
- <+@><:#278,9360>
-
- <+@><:#278,9360> Onerror reportError;
-
- <+@><:#278,9360>
-
- <+@><:#278,9360> if (SetupDDE() = 0) then ' Establish DDE communications
-
- <+@><:#278,9360> FreeGlobals();
-
- <+@> Message("Couldn't initiate DDE communications with Ascend.", "DDE error");
-
- <+@><:#278,9360> Exit Function;
-
- <+@><:#278,9360> endif
-
- <+@>
-
- <+@> DDEChannel = GetGlobalVar$("DDEChannel");
-
- <+@>
-
- <+@> result = MultiDecide("This macro uses Ascend's Phone Filter. Do you want to modify the filter?",
-
- <+@> YesNoCancelButton + QuestionIcon, "Ascend Find Name");
-
- <+@> if result = 2 then ' Cancel
-
- <+@> FreeGlobals();
-
- <+@> Exit Function;
-
- <+@> elseif result = 6 then
-
- <+@> a$ = DDEReceive$(DDEChannel, "SetFilter");
-
- <+@> a$ = DDEReceive$(DDEChannel, "UseFilter::On");
-
- <+@> endif
-
- <+@>
-
- <+@> n = AscendGetNameDialog();
-
- <+@> if n <;> 0 then
-
- <+@> a$ = DDEReceive$(DDEChannel,strcat$("SetActiveRecord:",GetGlobalArray$("records$", n)));
-
- <+@> CloseDDE();
-
- <+@> FreeGlobals();
-
- <+@>
-
- <+@> ' Now run the Ascend Insert Field macro
-
- <+@> macroPath$ = strcat$(GetMacPath$(), "ASCAMI2.SMM!Main");
-
- <+@> Calli macroPath$();
-
- <+@> else
-
- <+@> CloseDDE();
-
- <+@> FreeGlobals();
-
- <+@> endif
-
- <+@>
-
- <+@><:#278,9360> Exit Function;
-
- <+@><:#278,9360>
-
- <+@><:#278,9360>reportError:
-
- <+@><:#278,9360> CloseDDE();
-
- <+@>
-
- <+@> errorMsg$ = GetGlobalVar$("errorMsg$");
-
- <+@> Message(errorMsg$, "Ascend Find Name");
-
- <+@>
-
- <+@> FreeGlobals();
-
- <+@><:#278,9360>End Function
-
- <+@><:#278,9360>
-
- <+@><:#278,9360>
-
- <+@><:#278,9360>
-
- <+@><:#278,9360>
-
- <+@><:#278,9360>' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' '
-
- <+@><:#278,9360>' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' '
-
- <+@><:#278,9360>Function FreeGlobals()
-
- <+@> FreeGlobalVar("DDEChannel");
-
- <+@> FreeGlobalVar("names$");
-
- <+@> FreeGlobalVar("records$");
-
- <+@> FreeGlobalVar("errorMsg$");
-
- <+@> FreeGlobalVar("length");
-
- <+@> FreeGlobalVar("currentButton");
-
- <+@>End Function
-
- <+@>
-
- <+@>
-
- <+@>
-
- <+@>
-
- <+@>' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' '
-
- <+@>' SetErrorMessage() sets the global error message to the given string and returns
-
- <+@>' the previous value
-
- <+@>' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' '
-
- <+@>Function SetErrorMessage$(msg$)
-
- <+@> SetErrorMessage = GetGlobalVar$("errorMsg$");
-
- <+@> SetGlobalVar("errorMsg$", msg$);
-
- <+@>End Function
-
- <+@>
-
- <+@>
-
- <+@>
-
- <+@>
-
- <+@>' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' '
-
- <+@>' SetupDDE() establishes the DDE connection with Ascend.
-
- <+@>' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' '
-
- <+@>Function SetupDDE()
-
- <+@> Defstr DDEChannel, oldMsg$;
-
- <+@><:#278,9360>
-
- <+@> ' Prepare error message
-
- <+@> oldMsg$ = SetErrorMessage$("Cannot initiate DDE connection with Ascend.");
-
- <+@>
-
- <+@><:#278,9360> SetupDDE = 1;
-
- <+@><:#278,9360>
-
- <+@><:#278,9360> DDEChannel = DDEInitiate("Ascend", "Phone");
-
- <+@><:#278,9360> if (DDEChannel = 0) ;
-
- <+@><:#278,9360> SetupDDE = 0;
-
- <+@><:#278,9360> Endif
-
- <+@><:#278,9360>
-
- <+@><:#278,9360> SetGlobalVar("DDEChannel", DDEChannel);
-
- <+@>
-
- <+@> ' Restore error Message
-
- <+@> oldMsg$ = SetErrorMessage$(oldMsg$);
-
- <+@><:#278,9360>End Function
-
- <+@><:#278,9360>
-
- <+@><:#278,9360>
-
- <+@><:#278,9360>
-
- <+@><:#278,9360>
-
- <+@>' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' '
-
- <+@>' CloseDDE() closes the DDE connection with Ascend.
-
- <+@>' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' '
-
- <+@><:#278,9360>Function CloseDDE()
-
- <+@><:#278,9360> Defstr DDEChannel;
-
- <+@><:#278,9360>
-
- <+@><:#278,9360> DDEChannel = GetGlobalVar$("DDEChannel");
-
- <+@><:#278,9360> DDETerminate(DDEChannel);
-
- <+@><:#278,9360> SetGlobalVar("DDEChannel", 0);
-
- <+@><:#278,9360>End Function
-
- <+@><:#278,9360>
-
- <+@><:#278,9360>
-
- <+@><:#278,9360>
-
- <+@><:#278,9360>
-
- <+@>' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' '
-
- <+@>' FixName$() fixes the given name by determining if the name is a last name or a
-
- <+@>' company name. If it is a last name, it appends a comma and then the first name to it
-
- <+@>' and appends the company name, in parentheses, to that.
-
- <+@><:#278,9360>' If it is a company name, it appends the first and last name in parentheses.
-
- <+@>' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' '
-
- <+@>Function FixName(which)
-
- <+@> Defstr DDEChannel, localName$, localRecord$, fixLast$, fixFirst$, fixComp$, oldMsg$;
-
- <+@>
-
- <+@> ' Prepare error message
-
- <+@> oldMsg$ = SetErrorMessage$("Can't resolve name from Ascend.");
-
- <+@>
-
- <+@><:#278,9360> DDEChannel = GetGlobalVar$("DDEChannel");
-
- <+@>
-
- <+@><:#278,9360> localName$ = GetGlobalArray$("names$", which);
-
- <+@><:#278,9360> localRecord$ = GetGlobalArray$("records$", which);
-
- <+@><:#278,9360>
-
- <+@><:#278,9360> fixLast$ = DDEReceive$(DDEChannel, strcat$("GetRec:", localRecord$, ":Last"));
-
- <+@><:#278,9360> fixFirst$ = DDEReceive$(DDEChannel, strcat$("GetRec:", localRecord$, ":First"));
-
- <+@><:#556,9360> fixComp$ = DDEReceive$(DDEChannel, strcat$("GetRec:", localRecord$, ":Company"));
-
- <+@><:#278,9360>
-
- <+@><:#278,9360> if localName$ = fixLast$ then
-
- <+@><:#278,9360> if fixFirst$ <<<;> " " then
-
- <+@><:#278,9360> localName$ = strcat$(localName$ ", ", fixFirst$);
-
- <+@><:#278,9360> endif
-
- <+@><:#278,9360> if fixComp$ <<<;> " " then
-
- <+@><:#278,9360> localName$ = strcat$(localName$, " (", fixComp$, ")");
-
- <+@><:#278,9360> endif
-
- <+@><:#278,9360> elseif localName$ = fixComp$ then
-
- <+@><:#278,9360> if fixFirst$ <<<;> " " then
-
- <+@><:#278,9360> localName$ = strcat$(localName$, " (", fixFirst$);
-
- <+@><:#278,9360> if fixLast$ <<<;> " " then
-
- <+@><:#278,9360> localName$ = strcat$(localName$, " ", fixLast$);
-
- <+@><:#278,9360> endif
-
- <+@><:#278,9360> localName$ = strcat$(localName$, ")");
-
- <+@><:#278,9360> elseif fixLast$ <<<;> " " then
-
- <+@><:#278,9360> localName$ = strcat$(localName$, " (", fixLast$, ")");
-
- <+@><:#278,9360> endif
-
- <+@><:#278,9360> endif
-
- <+@>
-
- <+@> SetGlobalArray("names$", which, localName$);
-
- <+@> SetGlobalArray("records$", which, localRecord$);
-
- <+@>
-
- <+@> ' Restore error message
-
- <+@> oldMsg$ = SetErrorMessage$(oldMsg$);
-
- <+@><:#278,9360>End Function
-
- <+@><:#278,9360>
-
- <+@><:#278,9360>
-
- <+@><:#278,9360>
-
- <+@><:#278,9360>
-
- <+@><:#278,9360>
-
- <+@>' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' '
-
- <+@>' SetupNamesArray() prepares the list box for the Ascend Get Names dialog. The list box
-
- <+@>' will show all of Ascend's Address and Phone entries that start with the given letter.
-
- <+@>' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' '
-
- <+@>Function SetupNamesArray(letter$)
-
- <+@> Defstr DDEChannel, letter2$, length, dde$, oldDde$, colon, j, oldMsg$, diff;
-
- <+@>
-
- <+@> ' Prepare error message
-
- <+@> oldMsg$ = SetErrorMessage$("Can't set up list box for Ascend Names dialog");
-
- <+@>
-
- <+@> ' The letter A represents everything before the letter A as well, such as numbers.
-
- <+@><:#278,9360> ' So, if letter$ is A, ignore it.
-
- <+@> ' Since we only want to show two letters at a time, we need to set the following
-
- <+@><:#278,9360> ' letter as a limit.
-
- <+@><:#278,9360> if letter$ = "A" or letter$ = "a" then
-
- <+@><:#278,9360> letter$ = "";
-
- <+@> letter2$ = "b";
-
- <+@> elseif letter$ = "Z" or letter$ = "z" then
-
- <+@><:#278,9360> letter2$ = "ZZZZZZZZZZZZZZZZZZZ";
-
- <+@><:#278,9360> else
-
- <+@> letter2$ = chr$(asc(letter$) + 1);
-
- <+@><:#278,9360> endif
-
- <+@><:#278,9360>
-
- <+@><:#278,9360> HourGlass(1);
-
- <+@><:#278,9360>
-
- <+@><:#278,9360> DDEChannel = GetGlobalVar$("DDEChannel");
-
- <+@><:#278,9360>
-
- <+@> ' Count the Address and Phone entries from Ascend.
-
- <+@> length = DDEReceive$(DDEChannel, strcat$("CountKey::", letter$, ":", letter2$));
-
- <+@> SetGlobalVar("length", length);
-
- <+@>
-
- <+@> if length <;> 0 then
-
- <+@> ' Redimension our global arrays for the correct amount of entries.
-
- <+@> FreeGlobalVar("names$");
-
- <+@> FreeGlobalVar("records$");
-
- <+@> AllocGlobalVar("names$", length);
-
- <+@> AllocGlobalVar("records$", length);
-
- <+@><:#278,9360>
-
- <+@><:#278,9360> ' Get the first entry
-
- <+@><:#278,9360> dde$ = DDEReceive$(DDEChannel, strcat$("SearchKey::", letter$));
-
- <+@><:#278,9360> colon = InStr(0, dde$, ":");
-
- <+@> SetGlobalArray("names$", 1, Right$(dde$, Len(dde$) - colon));
-
- <+@> SetGlobalArray("records$", 1, Left$(dde$, colon - 1));
-
- <+@><:#278,9360> oldDde$ = dde$;
-
- <+@><:#278,9360> FixName(1);
-
- <+@><:#278,9360>
-
- <+@><:#278,9360> ' Get the remaining entries
-
- <+@><:#278,9360> for j = 2 to length
-
- <+@> ' Inform user of long wait
-
- <+@> diff = length - j + 1;
-
- <+@> StatusBarMsg("Reading Phone information: {diff}");
-
- <+@><:#278,9360>
-
- <+@><:#278,9360> dde$ = DDEReceive$(DDEChannel, strcat$("NextKey:", oldDde$));
-
- <+@> colon = InStr(0, dde$, ":");
-
- <+@> SetGlobalArray("names$", j, Right$(dde$, Len(dde$) - colon));
-
- <+@> SetGlobalArray("records$", j, Left$(dde$, colon - 1));
-
- <+@><:#278,9360> oldDde$ = dde$;
-
- <+@><:#278,9360> FixName(j);
-
- <+@><:#278,9360> next
-
- <+@><:#278,9360>
-
- <+@><:#278,9360> StatusBarMsg("");
-
- <+@> endif
-
- <+@><:#278,9360>
-
- <+@><:#278,9360> HourGlass(0)
-
- <+@>
-
- <+@> ' Restore error message
-
- <+@> oldMsg$ = SetErrorMessage$(oldMsg$);
-
- <+@>End Function
-
- <+@>
-
- <+@>
-
- <+@>
-
- <+@>
-
- <+@>
-
- <+@>' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' '
-
- <+@>' LetterCallBack() is the dialog call-back procedure for the letter buttons
-
- <+@>' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' '
-
- <+@>Function LetterCallBack(hdlg, item, value)
-
- <+@> Defstr handle, length, j, oldMsg$;
-
- <+@>
-
- <+@> ' Prepare error message
-
- <+@> oldMsg$ = SetErrorMessage$("Can't update list box.");
-
- <+@>
-
- <+@> if GetGlobalVar$("currentButton") = item then
-
- <+@> Exit Function
-
- <+@> endif
-
- <+@>
-
- <+@> SetGlobalVar("currentButton", item);
-
- <+@>
-
- <+@> handle = GetDlgItem(hdlg, 9000); ' Get the list box's window handle
-
- <+@> AppSendMessage(handle, 0x0405, 0, 0); ' Clear the list box
-
- <+@>
-
- <+@> SetDlgItemText(hdlg, 9000, "Reading Phone information . . . ");
-
- <+@>
-
- <+@> SetupNamesArray(chr$(item - 20 + asc("a"))); ' recalculate names
-
- <+@>
-
- <+@> AppSendMessage(handle, 0x0405, 0, 0); ' Clear the list box
-
- <+@>
-
- <+@> length = GetGlobalVar$("length"); ' Count the names
-
- <+@> for j = 1 to length
-
- <+@> SetDlgItemText(hdlg, 9000, GetGlobalArray$("names$", j)); ' Add to list box
-
- <+@> next
-
- <+@>
-
- <+@> ' Restore error message
-
- <+@> oldMsg$ = SetErrorMessage$(oldMsg$);
-
- <+@>End Function
-
- <+@>
-
- <+@>
-
- <+@>
-
- <+@>
-
- <+@>
-
- <+@>' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' '
-
- <+@>' AscendGetNameDialog() presents the user with a dialog to select a name from
-
- <+@>' Ascend's Address and Phone directory.
-
- <+@>' The return value in the index into the global names$ and records$ arrays that
-
- <+@>' corresponds to the selected entry, or -1 if they cancel.
-
- <+@>' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' '
-
- <+@>Function AscendGetNameDialog()
-
- <+@> Defstr result, oldMsg$, j, length, theName$;
-
- <+@>
-
- <+@> ' Prepare error message
-
- <+@> oldMsg$ = SetErrorMessage$("Error with Ascend Names dialog.");
-
- <+@>
-
- <+@><:#278,9360> AscendGetNameDialog = -1;
-
- <+@>
-
- <+@> ' Prepare names and add to list box
-
- <+@> SetupNamesArray("a");
-
- <+@> length = GetGlobalVar$("length");
-
- <+@> for j = 1 to length
-
- <+@> FillList(GetGlobalArray$("names$", j));
-
- <+@> next
-
- <+@>
-
- <+@> ' Set call-back procedure for the letter buttons
-
- <+@> for j = 20 to 45
-
- <+@> SetDlgCallBack(j, "LetterCallBack");
-
- <+@> next
-
- <+@>
-
- <+@> FillEdit(20, TRUE);
-
- <+@> SetGlobalVar("currentButton", 20);
-
- <+@>
-
- <+@> result = DialogBox(".", "AscendGetName");
-
- <+@> if result =1 then
-
- <+@> ' length may have changed in the call-back procedure
-
- <+@> length = GetGlobalVar$("length");
-
- <+@>
-
- <+@> ' Figure out the number of the name they selected
-
- <+@> theName$ = GetDialogField$(9000);
-
- <+@> for j = 1 to length
-
- <+@> if theName$ = GetGlobalArray$("names$", j) then
-
- <+@> AscendGetNameDialog = j;
-
- <+@> break;
-
- <+@> endif
-
- <+@> next
-
- <+@> endif
-
- <+@>
-
- <+@> ' Restore error message
-
- <+@> oldMsg$ = SetErrorMessage$(oldMsg$);
-
- <+@>End Function
-
- <+@><:#278,9360>
-
- <+@><:#278,9360>
-
- DIALOG AscendGetName
-
- -2134900736 30 81 63 277 143 "" "" "Ascend Find Name"
-
- FONT 8 "Helv"
-
- 232 18 40 14 1 1342373889 "button" "OK" 0
-
- 232 37 40 14 2 1342373888 "button" "Cancel" 0
-
- 163 18 18 13 20 1342373897 "button" "&A" 0
-
- 163 31 18 13 21 1342177289 "button" "&B" 0
-
- 163 44 18 13 22 1342177289 "button" "&C" 0
-
- 163 57 18 13 23 1342177289 "button" "&D" 0
-
- 163 70 18 13 24 1342177289 "button" "&E" 0
-
- 163 83 18 13 25 1342177289 "button" "&F" 0
-
- 163 96 18 13 26 1342177289 "button" "&G" 0
-
- 163 109 18 13 27 1342177289 "button" "&H" 0
-
- 163 122 18 13 28 1342177289 "button" "&I" 0
-
- 186 18 18 13 29 1342177289 "button" "&J" 0
-
- 186 31 18 13 30 1342177289 "button" "&K" 0
-
- 186 44 18 13 31 1342177289 "button" "&L" 0
-
- 186 57 18 13 32 1342177289 "button" "&M" 0
-
- 186 70 18 13 33 1342177289 "button" "&N" 0
-
- 186 83 18 13 34 1342177289 "button" "&O" 0
-
- 186 96 18 13 35 1342177289 "button" "&P" 0
-
- 186 109 18 13 36 1342177289 "button" "&Q" 0
-
- 186 122 18 13 37 1342177289 "button" "&R" 0
-
- 209 18 18 13 38 1342177289 "button" "&S" 0
-
- 209 31 18 13 39 1342177289 "button" "&T" 0
-
- 209 44 18 13 40 1342177289 "button" "&U" 0
-
- 209 57 18 13 41 1342177289 "button" "&V" 0
-
- 209 70 18 13 42 1342177289 "button" "&W" 0
-
- 209 83 18 13 43 1342177289 "button" "&X" 0
-
- 209 96 18 13 44 1342177289 "button" "&Y" 0
-
- 209 109 18 13 45 1342177289 "button" "&Z" 0
-
- 6 5 145 10 1000 1342308352 "static" "Select an Ascend Address and Phone Entry:" 0
-
- 6 18 150 119 9000 1352859651 "listbox" "" 0
-
- END DIALOG
-
- >
-
- [Embedded]
- 00021240
- >
- [macsum] 10
- Main 0 0 7 11
- FreeGlobals 1041 0 1 79
- SetErrorMessage$ 1181 1 2 95
- SetupDDE 1267 0 3 106
- CloseDDE 1510 0 2 131
- FixName 1597 1 8 148
- SetupNamesArray 2484 1 10 197
- LetterCallBack 3766 3 5 269
- AscendGetNameDialog 4347 0 6 309
- AscendGetName 5123 0 -1 352
- [macse]
- 14 Main
- 0 271 "DDEChannel" 1
- 0 271 "names$" 5
- 0 271 "records$" 5
- 0 271 "errorMsg$" 1
- 0 271 "length" 1
- 0 271 "currentButton" 1
- 0 264 "errorMsg$" "An error occurred."
- 20 00000942
- 16 SetupDDE
- 13
- 5 0
- 18 0
- 11 00000324
- 16 FreeGlobals
- 0 3 "Couldn't initiate DDE communications with Ascend." "DDE error"
- 6 0
- 15
- 9
- 0 265 "DDEChannel"
- 13
- 8 4
- 5 3
- 5 32
- 3 0
- 0 21 "This macro uses Ascend's Phone Filter. Do you want to modify the filter?" [X] "Ascend Find Name"
- 13
- 8 2
- 6 2
- 5 2
- 18 0
- 11 00000553
- 16 FreeGlobals
- 6 0
- 15
- 9
- 10 00000652
- 6 2
- 5 6
- 18 0
- 11 00000652
- 0 10 "{4}" "SetFilter"
- 13
- 8 3
- 0 10 "{4}" "UseFilter::On"
- 13
- 8 3
- 16 AscendGetNameDialog
- 13
- 8 1
- 6 1
- 5 0
- 18 3
- 11 00000901
- 0 273 "records$" "{1}"
- 13
- 0 16 "SetActiveRecord:" [X]
- 13
- 0 10 "{4}" [X]
- 13
- 8 3
- 16 CloseDDE
- 16 FreeGlobals
- 0 295
- 13
- 0 16 [X] "ASCAMI2.SMM!Main"
- 13
- 8 6
- 16 "{6}"
- 10 00000930
- 16 CloseDDE
- 16 FreeGlobals
- 6 0
- 15
- 9
- 16 CloseDDE
- 0 265 "errorMsg$"
- 13
- 8 5
- 0 3 "{5}" "Ascend Find Name"
- 16 FreeGlobals
- 6 0
- 15
- 9
- 14 FreeGlobals
- 0 266 "DDEChannel"
- 0 266 "names$"
- 0 266 "records$"
- 0 266 "errorMsg$"
- 0 266 "length"
- 0 266 "currentButton"
- 6 0
- 15
- 9
- 14 SetErrorMessage$
- 0 265 "errorMsg$"
- 13
- 8 2
- 0 264 "errorMsg$" "{0}"
- 6 1
- 15
- 9
- 14 SetupDDE
- 16 SetErrorMessage$ "Cannot initiate DDE connection with Ascend."
- 13
- 8 2
- 5 1
- 8 0
- 0 8 "Ascend" "Phone"
- 13
- 8 1
- 6 1
- 5 0
- 18 0
- 11 00000169
- 5 0
- 8 0
- 0 264 "DDEChannel" "{1}"
- 16 SetErrorMessage$ "{2}"
- 13
- 8 2
- 6 0
- 15
- 9
- 14 CloseDDE
- 0 265 "DDEChannel"
- 13
- 8 1
- 0 9 "{1}"
- 0 264 "DDEChannel" 0
- 6 0
- 15
- 9
- 14 FixName
- 16 SetErrorMessage$ "Can't resolve name from Ascend."
- 13
- 8 8
- 0 265 "DDEChannel"
- 13
- 8 2
- 0 273 "names$" "{0}"
- 13
- 8 3
- 0 273 "records$" "{0}"
- 13
- 8 4
- 0 16 "GetRec:" "{4}" ":Last"
- 13
- 0 10 "{2}" [X]
- 13
- 8 5
- 0 16 "GetRec:" "{4}" ":First"
- 13
- 0 10 "{2}" [X]
- 13
- 8 6
- 0 16 "GetRec:" "{4}" ":Company"
- 13
- 0 10 "{2}" [X]
- 13
- 8 7
- 6 3
- 6 5
- 18 0
- 11 00000522
- 6 6
- 7 " "
- 18 1
- 11 00000442
- 0 16 "{3}" ", " "{6}"
- 13
- 8 3
- 6 7
- 7 " "
- 18 1
- 11 00000509
- 0 16 "{3}" " (" "{7}" ")"
- 13
- 8 3
- 10 00000781
- 6 3
- 6 7
- 18 0
- 11 00000781
- 6 6
- 7 " "
- 18 1
- 11 00000714
- 0 16 "{3}" " (" "{6}"
- 13
- 8 3
- 6 5
- 7 " "
- 18 1
- 11 00000676
- 0 16 "{3}" " " "{5}"
- 13
- 8 3
- 0 16 "{3}" ")"
- 13
- 8 3
- 10 00000781
- 6 5
- 7 " "
- 18 1
- 11 00000781
- 0 16 "{3}" " (" "{5}" ")"
- 13
- 8 3
- 0 272 "names$" "{0}" "{3}"
- 0 272 "records$" "{0}" "{4}"
- 16 SetErrorMessage$ "{8}"
- 13
- 8 8
- 6 1
- 15
- 9
- 14 SetupNamesArray
- 16 SetErrorMessage$ "Can't set up list box for Ascend Names dialog"
- 13
- 8 9
- 6 0
- 7 "A"
- 18 0
- 6 0
- 7 "a"
- 18 0
- 1 2
- 11 00000188
- 7 ""
- 8 0
- 7 "b"
- 8 3
- 10 00000330
- 6 0
- 7 "Z"
- 18 0
- 6 0
- 7 "z"
- 18 0
- 1 2
- 11 00000285
- 7 "ZZZZZZZZZZZZZZZZZZZ"
- 8 3
- 10 00000330
- 0 40 "{0}"
- 13
- 5 1
- 3 0
- 0 39 [X]
- 13
- 8 3
- 0 296 1
- 0 265 "DDEChannel"
- 13
- 8 2
- 0 16 "CountKey::" "{0}" ":" "{3}"
- 13
- 0 10 "{2}" [X]
- 13
- 8 4
- 0 264 "length" "{4}"
- 6 4
- 5 0
- 18 3
- 11 00001225
- 0 266 "names$"
- 0 266 "records$"
- 0 271 "names$" "{4}"
- 0 271 "records$" "{4}"
- 0 16 "SearchKey::" "{0}"
- 13
- 0 10 "{2}" [X]
- 13
- 8 5
- 0 808 0 "{5}" ":"
- 13
- 8 7
- 0 14 "{5}"
- 13
- 6 7
- 3 1
- 0 807 "{5}" [X]
- 13
- 0 272 "names$" 1 [X]
- 6 7
- 5 1
- 3 1
- 0 806 "{5}" [X]
- 13
- 0 272 "records$" 1 [X]
- 6 5
- 8 6
- 16 FixName 1
- 5 2
- 8 8
- 6 4
- 6 8
- 18 2
- 12 00000884
- 10 00001215
- 5 1
- 6 8
- 3 0
- 8 8
- 10 00000809
- 6 4
- 6 8
- 3 1
- 5 1
- 3 0
- 8 10
- 0 789 "Reading Phone information: {10}"
- 0 16 "NextKey:" "{6}"
- 13
- 0 10 "{2}" [X]
- 13
- 8 5
- 0 808 0 "{5}" ":"
- 13
- 8 7
- 0 14 "{5}"
- 13
- 6 7
- 3 1
- 0 807 "{5}" [X]
- 13
- 0 272 "names$" "{8}" [X]
- 6 7
- 5 1
- 3 1
- 0 806 "{5}" [X]
- 13
- 0 272 "records$" "{8}" [X]
- 6 5
- 8 6
- 16 FixName "{8}"
- 10 00000851
- 0 789 ""
- 0 296 0
- 16 SetErrorMessage$ "{9}"
- 13
- 8 9
- 6 1
- 15
- 9
- 14 LetterCallBack
- 16 SetErrorMessage$ "Can't update list box."
- 13
- 8 7
- 0 265 "currentButton"
- 13
- 6 1
- 18 0
- 11 00000137
- 6 3
- 15
- 9
- 0 264 "currentButton" "{1}"
- 0 44 "{0}" 9000
- 13
- 8 4
- 0 1036 "{4}" 1029 0 0
- 0 43 "{0}" 9000 "Reading Phone information . . . "
- 6 1
- 5 20
- 3 1
- 0 40 "a"
- 13
- 3 0
- 0 39 [X]
- 13
- 16 SetupNamesArray [X]
- 0 1036 "{4}" 1029 0 0
- 0 265 "length"
- 13
- 8 5
- 5 1
- 8 6
- 6 5
- 6 6
- 18 2
- 12 00000473
- 10 00000533
- 5 1
- 6 6
- 3 0
- 8 6
- 10 00000398
- 0 273 "names$" "{6}"
- 13
- 0 43 "{0}" 9000 [X]
- 10 00000440
- 16 SetErrorMessage$ "{7}"
- 13
- 8 7
- 6 3
- 15
- 9
- 14 AscendGetNameDialog
- 16 SetErrorMessage$ "Error with Ascend Names dialog."
- 13
- 8 2
- 5 -1
- 8 0
- 16 SetupNamesArray "a"
- 0 265 "length"
- 13
- 8 4
- 5 1
- 8 3
- 6 4
- 6 3
- 18 2
- 12 00000233
- 10 00000282
- 5 1
- 6 3
- 3 0
- 8 3
- 10 00000158
- 0 273 "names$" "{3}"
- 13
- 0 25 [X]
- 10 00000200
- 5 20
- 8 3
- 5 45
- 6 3
- 18 2
- 12 00000369
- 10 00000411
- 5 1
- 6 3
- 3 0
- 8 3
- 10 00000293
- 0 41 "{3}" "LetterCallBack"
- 10 00000336
- 0 31 20 1
- 0 264 "currentButton" 20
- 0 26 "." "AscendGetName"
- 13
- 8 1
- 6 1
- 5 1
- 18 0
- 11 00000728
- 0 265 "length"
- 13
- 8 4
- 0 27 9000
- 13
- 8 5
- 5 1
- 8 3
- 6 4
- 6 3
- 18 2
- 12 00000642
- 10 00000728
- 5 1
- 6 3
- 3 0
- 8 3
- 10 00000567
- 6 5
- 0 273 "names$" "{3}"
- 13
- 18 0
- 11 00000715
- 6 3
- 8 0
- 10 00000728
- 10 00000609
- 16 SetErrorMessage$ "{2}"
- 13
- 8 2
- 6 0
- 15
- 9
- DIALOG AscendGetName
- -2134900736 30 81 63 277 143 "" "" "Ascend Find Name"
- FONT 8 "Helv"
- 232 18 40 14 1 1342373889 "button" "OK" 0
- 232 37 40 14 2 1342373888 "button" "Cancel" 0
- 163 18 18 13 20 1342373897 "button" "&A" 0
- 163 31 18 13 21 1342177289 "button" "&B" 0
- 163 44 18 13 22 1342177289 "button" "&C" 0
- 163 57 18 13 23 1342177289 "button" "&D" 0
- 163 70 18 13 24 1342177289 "button" "&E" 0
- 163 83 18 13 25 1342177289 "button" "&F" 0
- 163 96 18 13 26 1342177289 "button" "&G" 0
- 163 109 18 13 27 1342177289 "button" "&H" 0
- 163 122 18 13 28 1342177289 "button" "&I" 0
- 186 18 18 13 29 1342177289 "button" "&J" 0
- 186 31 18 13 30 1342177289 "button" "&K" 0
- 186 44 18 13 31 1342177289 "button" "&L" 0
- 186 57 18 13 32 1342177289 "button" "&M" 0
- 186 70 18 13 33 1342177289 "button" "&N" 0
- 186 83 18 13 34 1342177289 "button" "&O" 0
- 186 96 18 13 35 1342177289 "button" "&P" 0
- 186 109 18 13 36 1342177289 "button" "&Q" 0
- 186 122 18 13 37 1342177289 "button" "&R" 0
- 209 18 18 13 38 1342177289 "button" "&S" 0
- 209 31 18 13 39 1342177289 "button" "&T" 0
- 209 44 18 13 40 1342177289 "button" "&U" 0
- 209 57 18 13 41 1342177289 "button" "&V" 0
- 209 70 18 13 42 1342177289 "button" "&W" 0
- 209 83 18 13 43 1342177289 "button" "&X" 0
- 209 96 18 13 44 1342177289 "button" "&Y" 0
- 209 109 18 13 45 1342177289 "button" "&Z" 0
- 6 5 145 10 1000 1342308352 "static" "Select an Ascend Address and Phone Entry:" 0
- 6 18 150 119 9000 1352859651 "listbox" "" 0
- 00021265
-