Corel WordPerfect 7 Macro Programming Example

Case study:
A secretary using Corel WordPerfect 7 is often required to carry out calculations and insert the values into invoices or other documents.

She does this by entering calculations into either a real calculator and transcribing the answer, or the Microsoft calculator and copying then pasting the result into the document. Doing this affects her productivity as this process increases the time taken to complete work and wastes time in correcting inevitable errors that occur.

Proposal:
A secretary has asked for software to be written which enables her to do calculations and, if required, convert standard numbers to values of currency as a simple operation within Corel WordPerfect 7.

Feasibility study:
Having analysed the problem outlined above this operation is ideally suited for automation. A solution based on a macro would be advisable to the existing methods in place. The saving in time and increased productivity makes the proposed system a practical and effective alternative to the current manual system.

User Requirements:
The user needs to enter calculations into a new or existing document at different stages throughout the creation of the text. The user also requires that the macro does not change the formatting of the document in any way.

The user requires the ability to select the following options for formatting the output: 1) Displaying a sum in standard numbers or currency.
2) Displaying a sum using a minus sign or brackets to show negative figures.
3) Optional use of commas where required.

Specification:
Applications software to be used: Corel WordPerfect 7.

Purposes of using macro: Calculate the sum of any numerical data specified by the user.

Data to be embedded in macro: Any numerical data entered by the user.

Use of macro: Accelerate processing of data therefore increasing productivity, by cutting out the additional keystrokes needed to run the calculation manually.

Solution:
A macro that uses the table feature in Corel WordPerfect 7 to carry out the required mathematical operations then insert the result in place of a calculation entered as a formula. This solution will take between one to three seconds to complete any operation, running on a correctly configured and fully operational system of the description specified below.

Design of the system
Taking into consideration the needs of the user and the resources available in the execution of the macro in this environment. I have derived an algorithm that meets all the requirements outlined above. The specification for the stand alone programmable system needed is as follows:

Typical configurations required:
16 Megabytes of RAM.
Microsoft compatible mouse.
Corel WordPerfect 7.
The macro file.
155 MHZ Pentium processor.
1 Gbyte hard disk capacity or Windows 98.
Microsoft compatible keyboard.
DOS 6.0 or better.
Windows 95

Method of input:
Keyboard, numerical characters or key pad. Capture method: Transfer to clipboard. Input data: Any numerical data entered by the user. Output data: The sum of a calculation in numerical form.

Method of output: To VDU at the point of input data.

Using this specification I have written an algorithm that makes effective use of the resources available in Corel WordPerfect 7.

Algorithm for applications software macro:
[1] Check for input.
[a] Exit if none found.
[2] Select formula.
[3] Create a one cell table.
[4] Insert an equals sign before the formula.
[5] Calculate the table.
[6] Verify that result is not invade.
[a] Exit if error found (=5+6e).
[7] Request user input (formatting).
[a] Exit at user request (presses cancel).
[b] Revert operations & clean up.
[8] Format the output:
[a] Standard numeric.
[b] Currency.
[c] Use commas.
[d] Use negative format.
[8] Delete the table leaving the solution in place of the originally entered formula.Software development

The solution to the algorithm stated above in the form of a macro that meets all the requirements identified in the analysis is as follows:

Macro script:
// Macro: Automath.wcm // Written in: Perfect Script // Purpose: Calculate the sum of numerical data // Compiled: 5/09/04 // ? 1998 Michael Hart //================================================= // Identify compiler, application to use Application (A1; "WordPerfect"; Default; "UK")

If (?DocBlank) Condition executed if document blank // Go to subroutine oninput go(oninput) endif

// Select data block left of insertion point Selectwordprevious () // Condition executed if no data found If (?SelectedText="") // Go to subroutine error go(error) endif // Convert selected data block to a table Tableconvertfrom (type: tabularcolumns!) // Set default table style TableCellNumberFormat (FormatType: General!) // Turn off Update associated charts option Tableupdateassociatedcharts (state: off!) // Insert an equal sign left of data block Type (text: "=") Tablecalculate () // Calculate formula values in the table

// If formula syntax is invalid go to else If(?CellFormula) // Display menu dialog box DialogShow(5001;"WordPerfect") // Condition executed if user presses cancel If(MacroDialogResult = 2) // Revert the last operations Undo(1) // Move insertion point to end of data bock PosWordNext () // Go to subroutine end Go(end) Endif

// Condition executed if currency is defined If(currency) // Specify format data as currency [?00.00] TableCellNumberFormat (FormatType: Currency!) TableCellNumberNegativeNumber (NegDisplayType: Minus!) Endif

// Condition executed if negatives defined If(negatives) // Specify negative format [(9)] Tablecellnumbernegativenumber (negdisplaytype: parentheses!) Endif

// Specify commas are not used TableCellNumberUseCommas (State: No!)

// Condition executed if commas defined If(commas) // Specify format data using commas [2,000] TableCellNumberUseCommas (State: Yes!) Endif

// Select the table. Tableselecton (selectionmode: table!) // Select all cells in the current table Selecttable () // Delete table convert contents to document Tabledeletetable (delwhat: converttotabs!) // Move insertion point to end of data bock PosWordNext () // Go to subroutine end Go(end) // If formula syntax is invalid then Else endif

// Identify the subroutine error Label(error) // Display error message box in event of invalid formula MessageBox (; "AUTOMATH UNABLE TO COMPLY"; "Invalid data exists in formula. Sequence terminated."; IconStop!) // Delete table convert contents to document Tabledeletetable (delwhat: converttotabs!) // Delete character right of the insertion point DeleteCharNext () // Go to subroutine end Go(end)

// Identify subroutine oninput. Label(oninput) // Display error message box in event of blank document MessageBox (; "AUTOMATH UNABLE TO COMPLY"; "No input provided! Sequence terminated."; IconStop!)

// Identify the subroutine end Label (end) // End macro Quit //====================================================

Implementation:
Preliminary diagnostics: After running the macro on a system of the same specification to that of the system it is intended to be implemented, the preliminary diagnostic tests show the operational time to remain within the range predicted during the analysis.

The following tests were performed to confirm that the macro meets all of the requirements under real conditions.

Tests to be applied: Test # one of basic macro: 1) Find an individual that knows nothing about this macro.

2) Observation of this individual doing the following:

[a] Easily using the instructions.

[b] Load Corel WordPerfect 7.

[c] Enter valid numerical data.

[d] Access the macro file.

[e] Run the macro.

[f] Repeat steps [c] to [e] using all possible combinations of the options. Ideally, the individual should be able to do the above with no assistance.

3) Observation of the macro running as intended in all conditions.

Basic test conditions: Valid Input: Output: Invalid Input: output: [a] 5-5 0 [a][nothing] Error [b] 2+2 4 [b] qwerty Error [c] 2-4 -2 [c] 2gh+32 Error [d] 100*200 20000 [d] !"?$% Error [e] 50/1 50 [e] 1+4-1$ Error [f] 1+2-3*4/5 0.6 [f] one*two Error [g] 12345 ?12,345.00 [g] a1-d3 Error (??)

Test # two of debugged version:

1) Release the software on the LINK bulletin board system (run by Legalease) for evaluation by it's users. (the LINK is a special network for lawyers who often need maths functions in written work).

2) Collect commentary from the people willing to help.

3) Investigate and implement any changes or revisions necessary.

Maintenance:
Commas appear in values of currency regardless of the settings. This bug has been successfully corrected.

I am the website administrator of the Wandle industrial museum (http://www.wandle.org). Established in 1983 by local people to ensure that the history of the valley was no longer neglected but enhanced awareness its heritage for the use and benefits of the community.

Chicago limo Skokie ..
In The News:

An artificial intelligence-powered home security system can fire paintballs and tear gas at trespassers. The camera identifies human faces and animals.
Technology expert Kim Komando gives her tips and tricks on enhancing your user experience a smartphone and other devices you use everyday.
A new camera called NUCA uses artificial intelligence to create deepfake photos of subjects by stripping away clothing in close to real time.
The Kimberley Kube trail-ready camper has a compact but spacious design and combines luxury, functionality and ruggedness for a weekend getaway.
Stay up to date on the latest AI technology advancements and learn about the challenges and opportunities AI presents now and for the future.
Emails instructing you to reset your password for an account may be legitimate, or they may be scams. Kurt "CyberGuy" Knutsson explains.
Northrop Grumman's Manta Ray uncrewed underwater vehicle aims to revolutionize undersea missions — it glides through the ocean without human assistance.
Learn how to work Google's calendar application to streamline and organize your daily tasks from technology expert Kim Komando.
If you do not want Facebook to have automatic access to your private photos, follow our tips to protect yourself. Kurt “CyberGuy" Knutsson shows you how.
Kurt “CyberGuy" Knutsson goes into detail about Apple’s recent iOS update that allows iPhone users to instantly translate spoken language simply by using the Action Button.
Safeguarding your digital life with a reliable physical backup isn't just a precaution, it's a necessity. Kurt “CyberGuy" Knutsson provides the essential backup checklist.
Kurt “CyberGuy" Knutsson reveals how a Redditor exposed false recycling claims at their apartment, highlighting a report that only 21% of U.S. recyclables are processed.
Kurt "CyberGuy" Knutsson offers a travel toolkit featuring five technology tools to help you with booking flights and hotels for your summer vacation.
The bubble behind the clock on your iPhone can appear in different colors. Kurt "CyberGuy" Knutsson explains what each of those colors mean.
Scammers are using the power of artificial intelligence to mimic voices of people and are using the fake voices to commit crimes, like kidnappings.
Stay up to date on the latest AI technology advancements and learn about the challenges and opportunities AI presents now and for the future.
Tech guru Kurt "CyberGuy" Knutsson explains the science behind the Invisibility Shield, a 6-foot shield that makes people become invisible.
The International Olympic Committee on Friday announced plans to use AI in various Olympic aspects, including athlete identification, training and judging.
Tech guru Kurt "CyberGuy" Knutsson explains an easy trick to avoid squinting while working or surfing the web by zooming in on your personal computer.
Streaming giant Roku has recently been targeted by a pair of cyberattacks, and the company confirmed over a half million Roku accounts were compromised.
The Land Aircraft Carrier combines an all-terrain, six-wheeled vehicle with a two-seat aircraft, which features electric vertical takeoff and landing.
The European Union has sent TikTok a "request for information" on the video sharing platform's newest app, TikTok Lite, under the Digital Services Act, with the aim to clean up social media.
Stay up to date on the latest AI technology advancements and learn about the challenges and opportunities AI presents now and for the future.
The FBI is warning the public about a recent phishing scam via text that claims its targets owe money in Pennsylvania for unpaid road toll charges.
Your Apple Music settings may be revealing to your contacts what you're listening to. Kurt "CyberGuy" Knutsson explains the process to change those settings.

Great Plains Dexterity Customization Options ? Overview For Developers

Looks like Microsoft Great Plains becomes more and more popular,... Read More

Microsoft Business Solutions Partner ? How to Launch New IT Consulting Practice

In the new era of internet marketing the problem of... Read More

Simple Solution for Php Includes - IFrames

I have recently created my first Php program. I wanted... Read More

Hubris - Definition: Microsofts Passport

Before September of 1995, Microsoft ignored the Internet because their... Read More

Groove Network. Are you in it?

If you are in a business that passes documents around... Read More

Microsoft Great Plains Installation ? Overview for IT Director/Controller

Microsoft Great Plains is main mid-market application from Microsoft Business... Read More

Programming Environments And The Software Production Process

Introduction: The creating of a computer program involves a number... Read More

Software Upgrades Arent Always the Best Move

When my daughter was getting into AOL instant messaging (AIM)... Read More

Introduction To ISDN, Part II

In the previous ISDN article, we looked at how and... Read More

A Simple Guide To Wikis

A wiki is an editable text-based website. But you don't... Read More

Linux for Home Users

Hey Guys! Don't raise your eyebrows or fear by hearing... Read More

Great Plains Bill of Materials Setup & Customization for Process Manufacturing ? Overview

Microsoft Great Plains has full-featured Manufacturing suite of modules: Capacity... Read More

An Introduction to .NET Framework

.Net Framework is a platform or development environment to seamlessly... Read More

The Secret of the Layer Styles Dialogue

When you double-click a layer in the Layer Palette, you... Read More

Microsoft Great Plains Implementation & Customization: Computer Parts Retailer Example

Microsoft Great Plains fits to majority of horizontals and retail... Read More

Microsoft CRM for Corporate Business ? Working Offline

If your company has regional and worldwide operations, you might... Read More

MicroWorld Releases New Version of MailScan Ver. 4.5 - Antivirus and Content Security Software

MicroWorld Technologies, Inc. the leading solutions provider in the area... Read More

Microsoft CRM Integration with Lotus Notes Domino: Messaging Connector ? Future Directions

IBM Lotus Notes Domino and Microsoft CRM (Client Relation Management)... Read More

Microsoft Great Plains SOP: Sales Order Processing

Microsoft Business Solutions Great Plains is marketed for mid-size companies... Read More

What is Spyware? Are You Being Watched?

Find out why Spyware Removal from computers is important and... Read More

What is a Document Manager without Version History?

Document Manager and Version HistoryIn previous articles I have discussed... Read More

Microsoft Great Plains - Typical Problems And Fixes ? Overview For IT Administrators

How to delete the user? This is the first problem... Read More

Microsoft Great Plains 8.0 Brazilian Version ? Overview For International Consultant

Microsoft Great Plains has substantial mid-market share in the USA... Read More

Why Java RDBMS?

It is a well known fact that Java as a... Read More

Spyware Statistics -- Whats New in May 2005?

Although statistics often is blamed for various deadly sins --... Read More

limo O'Hare Bonfield ..