Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!decwrl!sun-barr!cs.utexas.edu!uunet!microsoft!t-atulb From: t-atulb@microsoft.UUCP (Atul Butte) Newsgroups: comp.sys.mac.programmer Subject: Re: compiling your own Excel(2.2) functions Keywords: excel call register serial compuserve Message-ID: <7133@microsoft.UUCP> Date: 28 Jul 89 02:06:56 GMT References: <8007@spool.cs.wisc.edu> Reply-To: t-atulb@microsoft.UUCP (Atul Butte) Organization: Microsoft Corp., Redmond WA Lines: 45 In article <8007@spool.cs.wisc.edu> engber@thylacine.CS.WISC.EDU (Mike Engber) writes: > >The new version of Excel, 2.2, advertises that you can compile functions >and import them for use in Excel. Any of the 2.2 owners care to comment? > - is it documented in the manual (if not how do you get docs) > - what all is involved > - can functions accept/return array arguments > - can I use LightSpeed Pascal or C or will I need MPW > >It sounds like a really nice feature, but I haven't heard anything about it >except for one sentence in my upgrade letter so I'm suspicious. > >-ME Don't be suspicious; it's true :-)! I have sent sample external routines to comp.binaries.mac along with the source code used to produce them. The sample set of external routines is called the Serial Library, and with it, you can control the serial ports (i.e. a modem) through an Excel macro. Along with the external routines is a sample macro using the routines called CompuServe. This macro, given a list of stock symbols, will log onto CompuServe and download the latest information on those stocks. Documentation for the library is provided in a Word 4.0 formatted file. The source code is being distributed in another posting. I'll try to answer your questions: You can use either MPW or Think C, Pascal or any compiler to create the external routines. Each external routine must be placed in a CODE resource with a unique number and name. The CALL macro command opens a resource file and loads in the CODE resource with the given name. The REGISTER command takes the data returned by the CALL command and uses it to find the address and parameters for the external routine. On page 267 of the Functions and Macros book, you will see a list of parameter types which the external routines can accept and return. The only array type available is code K: an array of floating point values. Atul Butte Microsoft Corporation uunet!microsoft!t-atulb