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.

limo prices to midway Crystal Lake west of Randal .. Lockport Chicago limo O’Hare
In The News:

Creating an email alias can help clean up your inbox by organizing emails based on purpose, like creating different aliases for shopping, newsletters and work.
A multipurpose robotic system promises to transform how items are stacked onto pallets, aiming to maximize space utilization and reduce shipping costs.
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 number of people affected by a UnitedHealth data breach in February 2024 was actually higher than previously reported and was the largest medical data breach in U.S. history.
A phishing campaign uses Google Calendar to schedule fake meeting invitations that appear legitimate, redirecting targets to phishing sites.
Toll road text scam: Fake messages claim unpaid fees, seek payment via fraudulent links. Kurt “CyberGuy" Knutsson says this scam is becoming increasingly sophisticated and widespread.
Kurt “CyberGuy" Knutsson says these steps ensure that your friends and family get to the exact moment you want them to see. Try it out and streamline your sharing experience.
Tech expert Kurt “CyberGuy" Knutsson offers tips on how to protect your identity: Be vigilant, monitor accounts, use smart security, know theft response.
Tech expert Kurt “CyberGuy" Knutsson says cybercriminals are exploiting iMessage phishing protection, tricking users to reactivate links.
It's hard to imagine life without in-flight Wi-Fi these days – but sky-high web surfing comes with its own set of privacy concerns. Here's how to protect yourself.
Over 400,000 cases of credit card fraud were reported in 2024 to the Federal Trade Commission. The CyberGuy explains how to protect against becoming another victim.
A nondescript metal box transforms into a fully functional electric motorcycle that blurs the line between vehicle and urban infrastructure.
Many apps unrelated to location still ask users for tracking permission, and Texas Attorney General Ken Paxton has filed a lawsuit seeking to end this alleged practice by Allstate.
Stay up to date on the latest AI technology advancements and learn about the challenges and opportunities AI presents now and for the future.
Melody, the artificial intelligence-powered robot, is life-sized and represents a move toward creating robots that resemble people in appearance and interaction.
Here are five easy smartphone rules from the National Security Agency that you can follow to better protect your mobile device from hackers and scammers.
A U.S. robotics company has developed "Jennie," a robotic pet powered by artificial intelligence that's designed to comfort those facing mental health challenges.
Healthcare records for more than 184 million Americans were breached in 2024, but you can take steps to minimize that risk. Kurt the CyberGuy explains.
The Skyrider X1 from Rictor claims to be the "first amphibious flying passenger motorcycle," and it combines land and air travel in one sleek design.
Stay up to date on the latest AI technology advancements and learn about the challenges and opportunities AI presents now and for the future.
Home inventory and restoration apps help itemize and track every item in your home in the event you have to make an insurance claim after a natural disaster.
The White House launched a new cybersecurity safety label, the U.S. Cyber Trust Mark, intended to help consumers make informed decisions on smart device safety.
Today's tech can help make life so much easier — if you know how to use it. Here are a few tips on the quickest and best ways to make your phone, laptop and other devices work for you.
Tech expert Kurt “CyberGuy" Knutsson offers Windows 11 restart fixes: Update drivers, run system scans and check hardware.
Sony and Honda's Afeela 1 EV launches with advanced tech and entertainment for $89,900. Tech expert Kurt “CyberGuy" Knutsson gives his takeaways.

An Introduction to .NET Framework

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

Do You Want Your Own Fully Programmable ERP? - Part 1

We are in a transition phase in the Managerial Administration... Read More

Linux Dual Boot-How To Format

Just the thought of a duel-boot scares many people away,... Read More

Know Linux

Linux essentials:It's free for download but you have to pay... 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

Lotus Domino: Reports and Connectors ? Crystal Reports, XML, ODBC/JDBC, OLE

Lotus Notes Domino is very efficient in electronic document workflow... Read More

Microsoft Great Plains Integration Manager ? Working With Text File

Microsoft Business Solutions main middle market ERP application - Microsoft... Read More

Great Plains Dexterity Customization Options ? Overview For Developers

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

Did You Ever Want to Completely Erase Everything on Your Computer?

Did you ever want to erase everything on your computer?... Read More

Accounts Payable: A Powerful Document Management and Workflow Solution

Accounts payable is just one area of office management where... Read More

Microsoft Great Plains Installation ? Overview for IT Director/Controller

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

Think Of This

Think of this, first we had the HAM Radio, then... Read More

Crystal Reports for Microsoft Great Plains

Microsoft Business Solutions ? Great Plains is designed to meet... Read More

Microsoft CRM and No-Frills Cadillacs

In today's business world it's all but impossible to escape... Read More

Microsoft Great Plains & CRM in Transportation & Logistics ? Overview

Microsoft Business Solutions Great Plains and MS CRM (client relation... Read More

Microsoft Great Plains: Data Conversion & Migration Scenarios ? Overview for Consultant

Microsoft Business Solutions Great Plains serves multiple industries in the... Read More

Free Program Removes Spyware not Detected by Premium Security Scan

What is Spyware?Spyware monitors your surfing habits and sends the... Read More

Microsoft Great Plains, Navision, Axapta ? Selection Considerations

During the years of our consulting practice, which comes back... Read More

Reduce TCO: The Java Database Way

TCO (Total Cost Ownership) is the buzzword in... Read More

Windows Screensavers Explained

In this article you will find some background information about... Read More

Microsoft Great Plains Oil & Gas ? Implementation & Customization Highlights

Microsoft Great Plains serves the wide spectrum of horizontal markets.... Read More

Recent Studies Show that 9 out of 10 PCs Are Infected with Spyware

Spyware and malware are large problems for Internet users today... Read More

Groupware and Online Collaboration: Collaboration Series #4

This article is the fourth of a series of articles... Read More

Make 2005 the Year You Save Time!

Today's business world is fast-paced. No matter what it is... Read More

Microsoft CRM for Large Corporation ? Security

Microsoft Business Solutions CRM proved to be reliable solution in... Read More

taxi o'hare Auburn ..