COMPUTER SYSTEM
This invention relates to a computer system, in particular, but not exclusively, for allowing conversion of local country currency values to the corresponding Euro currency values.
The invention provides a computer system including a host application for editing a document and a conversion application, said conversion application comprising:
a class which operates externally of said host application, said class being operable to convert a numerical value of a first measurement unit to a corresponding numerical value of a second measurement unit by reference to a stored conversion relationship between said first and second measurement units; and
interface means for interacting with said host application to:
I) find all occurrences in said document of any numerical value of said first measurement unit;
n) present each such value to said class for conversion to the corresponding numerical value of the second . measurement unit;
m) receive the corresponding numerical value of the second measurement unit from the class; and
iv) insert into said document said corresponding numerical value of the second measurement unit by replacing the original value and its measurement unit with the corresponding numerical value, or appending the corresponding numerical value to the original value and ts measurement unit.
Preferably both the first and second numerical measurement units are user-selectable from a pre-defined list. In an embodiment of the invention the first and second numerical measurement units are currency units, the second currency unit preferably being the Euro. Suitably, said pre-defined list is generated from a configuration file provided on the computer system.
Preferably, the conversion relationship between said first and second measurement units is stored in a data file accessible by the class. Further, preferably, the data file includes a plurality of conversion relationships between different measurement units. Most preferably, said conversion relationships between different measurement units are stored as conversion relationships between the individual units and a base unit, and the class calculates the corresponding numerical value by triangulation.
In preferred embodiments, the system further comprises means for updating said data file and/or said configuration file to correspond to a data file and/or a configuration file held on a central server.
Embodiments of the invention will now be described, by way of example", with reference to the accompanying drawings, in which:
Fig. 1 is a block schematic diagram of a stand-alone computer system embodying the invention for performing a currency conversion function;
Fig. 2 is a diagram illustrating the executable and data files on the system of Fig. 1 relevant to the present embodiment;
Fig. 3 shows a window presented to the user in use of the system of Fig. 1; and
Fig. 4 is a diagram, equivalent to that of Fig. 2, of a second embodiment of the invention in a client/server environment.
Referring to Figs. 1 and 2, the embodiment of the invention there shown comprises a stand-alone computer system 10, such as an IBM-compatible personal computer (PC) , running the
Windows 97 operating system (Windows 97 is a Trade Mark) . In this embodiment the invention is used within a word processing application 12 loaded on the PC 10, in this case Microsoft Word 97 (Microsoft Word 97 is a Trade Mark) .
The system 10 further includes a currency conversion application (EuroSymbol .exe) 14, data files (EuroSymbol.dat, EuroSymbol . cfg) 16, 18 holding currency and configuration data respectively, and a system configuration and currency update program (EuroCfg.exe) 18.
The system also includes an MS Word 97 template file (Euro. dot, not shown) . This template puts a "Euro" button between the "File" and "Edit" buttons on the Word toolbar, and also includes a macro to call the application 14 when the Euro button is selected. In this template a key combination, e.g. Alt+u, is also associated with the macro to call the application 14.
In order to use the currency conversion function, a user first inserts, or converts, his MS Word file into the Euro. dot template. He then clicks on the Euro button on the toolbar, or types the appropriate key combination, to call the application 14, which presents to the user the "EuroConverter" window seen in Fig. 3. This window generally follows the normal conventions for find-and-replace windows
in MS Word 97. The window includes a first drop down list 22 for selecting a currency unit the user wishes to convert from (the "from" currency unit) , a second drop down list 24 for selecting a currency unit the user wishes to convert to (the "to" currency unit) , a third drop down list 26 enabling the user to select Append or Replace mode, and action buttons 40- 46 providing the functions Find Next, Cancel, Append (or Replace if replace is selected in drop down list 26) and Append All (or Replace All if replace is selected in drop down list 26) .
The default values in the windows 22, 24 and 26 are determined by the EuroSymbol . cfg configuration file 18. Normally, it is expected that the default "from" currency unit will be the local country currency unit, for example
Irish Pounds IR£, and the default "to" currency unit will be the Euro. There is also an Update Data button 30 whose function will be described later.
When the user has selected the "from" currency unit in list 22 and the "to" currency unit in list 24, and when he has selected the desired mode, Append or Replace, in list 26, he clicks the Find Next button 40. In response, the application 14 searches the document to find the (next) occurrence of the "from" currency unit. When found, the user may choose to skip over that value, by clicking on the button 40 once again, or click on the button 44. In response to the latter, the application reads the associated currency value and accesses the EuroSymbol.dat currency data file 16 to determine the appropriate conversion rate between the "from" and "to" currency units.
The EuroSymbol.dat file contains the allowed currencies (i.e. those selectable in the drop down lists 22, 24) and the appropriate conversion rates between them. In the file
EuroSymbol.dat each currency unit is identified as a text
string (e.g. IR£) or special font character (e.g. the Euro symbol € ) , depending on whether the "from" currency unit is identified by a text string or special font character in the find-and-replace window, Fig. 3. On finding this text string or font character, the application 14 automatically calculates the new currency value.
Depending on whether Append or Replace is selected in drop down list 26, the converted currency (both value and currency unit identifier) is appended in brackets to the original currency, or completely replaces the original entry in the document. Thus, for example, for an assumed conversion rate of 1.5 US dollars to the Irish Pound, in the case of a replace "IR£100" would become "US$150" while in the case of an append "IR£100" would become "IR£100 (US$150)".
Instead of clicking on the button 44 the user may alternatively click on the Replace (or Append) All button 46, in which case all occurrences of values of the "from" currency unit are replaced or appended in one operation by the application 14. Finally, when all desired values are converted, the user may close the application 14 by clicking on the Cancel button 42.
The currency conversion application EuroSymbol.exe comprises a class which operates externally of the host application (in this case Microsoft Word) . In terms of object-oriented programming, a class is a template defining the methods and variables which are included in particular types of object (an object being a software package containing data and a collection of related procedures or methods which operate on the data) .
Therefore, in the class used in the described embodiment, the variables include "name" (the currency name) , "rate" (the numerical factor stored in EuroSymbol.dat linking the
particular currency with a base unit) , "symbol" (tϊ-e text symbol (s) associated with the currency in question), "amount" (the numerical value) etc. and the methods include triangulation conversion, text parsing, and formatting, etc. (referred to below) .
In alternative embodiments, such as for metric-imperial conversion engines, the methods might additionally include determination of whether the selected "from" and "to" units are dimensionally equivalent, or this could be stored in the variables, in that the unit "metres" might have an associated stored list of compatible units (e.g. inches, yards, miles) so that the user is not given the option of converting to an incompatible unit such as ounces.
The class or "conversion engine" works on pure numbers which it parses from the text of a file. The text of the file is fed to the conversion engine by an interface means designed specifically for interfacing between the Application and the conversion engine. By designing a series of different interface modules, the same conversion engine can work within a range of applications which edit documents, or it can operate as part of a stand-alone utility such as a desktop conversion calculator, etc. The interface means may include filters which only extract numbers and the associated unit data, and it also provides the graphical user interface. In the example of Microsoft Word., this interface has been designed as a dialogue box having the same appearance and functionality of the integral "Find and Replace" box.
Typically, the interface means will extract the numerical values and associated text labels and symbols, and feed these to the conversion class which uses text parsing to extract floating values and separate numerical values from symbols and unit identifiers. Format Information' is another of the features of the class which helps in interpretation of number
formats such as decimal and thousands separator symbols. The xFormat Information' is also used to format the output using the user preferences and instructions from the user interface. The outputted numbers are fed back to the interface means which inserts them into the document as replacements or appendices as appropriate.
The EuroCfg.exe program 20 provides an interface which allows the user to modify the currency and configuration files 16, 18. Using a window with drop down lists and text entry windows, this program allows the user to modify the list of "from" and "to" currencies available for conversion, to update the conversion rates in the EuroSymbol.dat data file, and to modify the default settings in the find-and-replace window, Fig. 3. The EuroCfg.exe program also has access to, and can modify if desired, a configuration startup information file 32, EuroSymbol. sin, which contains a list of directory paths which allows the application 14 to know where it and its dependent data files are located.
Figs. 4 illustrates an embodiment of the invention incorporated in a multi-user, or client/server, system, as distinct from a stand-alone single user system. In this embodiment the EuroSymbol. cfg and EuroSymbol.dat data files are replaced on a system level by EuroSymbol. scf and
EuroSymbol. sdt data files 34 and 36 respectively. These system files contain the same data as the corresponding .cfg and .dat files in the first embodiment, and are installed in a secure location on the server system. When a given user on the system, running Windows 97 with MS Word 97 on his local machine, wants to make use of the currency conversion function, these system files are initially copied from their location on the server system to a location on the users own machine and, subject to their having a later time and date as described below, are stored thereon as .cfg and .dat files.
On the local machine the operation of the currency conversion function is then as described previously.
The . scf and . sdt data files 34, 36 each have a record of the time and date of when they were last updated. In principle on a large system for financial use, the exchange rates for the different currencies would be updated at least once a day. Hence the file EuroSymbol. sdt would be updated quite regularly. This would be done by the system supervisor, or whoever had access to this file, by editing this file using EuroCfg.exe 20. The system supervisor may also wish to update the .scf file from time to time.
On using the currency converter function the user will want to use the latest conversion factors and configuration data. Thus, when the application 14 is initially called from MS Word, it automatically copies over the system .scf and .sdt files 34, 36 to the same named files on the users local machine (not at this point directly to the local .cfg and .dat files). It then compares the dates of the .sdt and .dat files with the dates of the .cfg and .scf already on the local machine from the previous use. If the local .cfg or .dat file is older that the copied system file .scf or .sdt respectively, then the local file is overwritten with the corresponding system file, the .scf extension being changed to .cfg or .sdt to .dat, as the case may be, and the new update time entered in this file. If the local file is not older, then there is no such overwriting.
A user may also request his local .cfg and .dat files 16, 18 to be updated at any time by clicking on the Update Data button 30, Fig. 3 that appears on the pop-up-menu illustrated in figure 1. This causes the application 14 to copy down the system .scf and .sdt files, compare them with the local .cfg and .dat files respectively, and overwrite the latter if older, as described above.
Although the above has described embodiments of the invention which is used for the conversion of currencies, the invention may also be used to convert the numerical values of any measurement unit, such as US Gallons, to the corresponding numerical values of a second measurement unit, such as Litres, and for replacing or appending the converted value and its measurement unit relative to the original value.
The invention is not limited to the embodiment described herein which may be modified or varied without departing from the scope of the invention.