Mercury consists of a set of utilities that extend the power of GAUSS,
especially in terms of message and data communication between Gauss and
an external application. Mercury has four main components:
Provides Gauss functionality for Excel. Given a set
of data in an Excel Workbook, Gauss will take the data, process it, and
return the results to the specified cells in the spreadsheet.
A set of communication and message tools
for developers who need to link Gauss to an external application using
custom interfaces.
Mercury provides a means of communicating data or strings between Gauss
objects and the Window clipboard. For example, a section of a spreadsheet
could be selected and copied to the clipboard in the usual fashion. This
data could then be pasted directly into a Gauss matrix (x) using the Gauss
command:
x = paste;
Similarly, a Gauss matrix, x,could be copied to the clipboard using the
command:
call copy(x);
x could then be pasted into a spreadsheet or wordprocessor. For the former,
if x were an n by k matrix, then the spreadsheet array would also be n
rows by k column For the wordprocessor, the matrix has the form of tab
delineated elements, again with n rows and k columns.
Excel Support
Excel_Link is an interface which binds an Excel application with Gauss
-- in effect providing the functionality of dynamic data exchange. Data
from the current spreadsheet is made available to Gauss using the Gauss
command:
x = excelget(sheet, range);
and thus the components of the spreadsheet are simply an extension of the
Gauss workspace. After processing the data, results can be placed back
into the spreadsheet using the command:
call excelput(rslt, sheet, range);
Hence all the power of Gauss is available for mathematical computation
and analysis, while the spreadsheet provides the advantages of data presentation
and charting. The net effect is to have the functionality of Gauss within
Excel. The Excel_Link application includes a working example, a Windows
help system, and the full source code. Click the image for a screen shot
of Excel_Link, and here for the Gauss code.
Communication Support Tools
Mercury provides a library of communication and messaging tools for
programmers who wish to make use of the power of Gauss as part of an integrated
system in which data and message transfer to and from Gauss is required,
and which is to be controlled by an external application. These tools consist
of a set of libraries and DLLs on the Gauss side, and a set of Visual Basic
libraries and standard Windows APIs on the external side. These libraries
permit sending messages, parameters, strings, values and data between the
external application and Gauss, as well as routines for status checking
status. A demonstration Visual Basic project -- VB_Link -- is included
which shows how these calls are implemented. Click the image for a screen
shot of this demonstration project. In addition, the Visual Basic project
for Excel_Link is also included. While we have used VB for demonstrating
these procedures, the ideas can be ported to any program that can access
the Windows APIs -- for example C++, Delphi, Powerbuilder, etc. The code
and DLL files are provided on a royalty free basis for use in your application.
Creating Gauss Compliant DLLs
Extensions to the GAUSS language is possible through custom DLLs. In
effect, any code that one can write in C can become a Gauss procedure.
Not only does this provide for really fast DO loops, but it also gives
the programmer low level control over the operating system through the
Windows APIs. In effect, this makes Gauss an open system. For example,
the interface between Gauss and Gaussx, as well as all the components of
Mercury rely on these extensions. A demonstration DLL project -- Testdll
-- shows how such C code is written, and a step by step tutorial on how
to create your own DLLs, running under Microsoft VC++, is also provided.