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 useApplication (A1; "WordPerfect"; Default; "UK")
If (?DocBlank) Condition executed if document blank // Go to subroutine oninput go(oninput) endif
// Select data block left of insertion pointSelectwordprevious ()// Condition executed if no data foundIf (?SelectedText="") // Go to subroutine error go(error) endif // Convert selected data block to a tableTableconvertfrom (type: tabularcolumns!)// Set default table styleTableCellNumberFormat (FormatType: General!)// Turn off Update associated charts optionTableupdateassociatedcharts (state: off!)// Insert an equal sign left of data blockType (text: "=") Tablecalculate () // Calculate formula values in the table
// If formula syntax is invalid go to elseIf(?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 definedIf(currency) // Specify format data as currency [£00.00] TableCellNumberFormat (FormatType: Currency!) TableCellNumberNegativeNumber (NegDisplayType: Minus!)Endif
// Condition executed if negatives definedIf(negatives) // Specify negative format [(9)] Tablecellnumbernegativenumber (negdisplaytype: parentheses!)Endif
// Specify commas are not usedTableCellNumberUseCommas (State: No!)
// Condition executed if commas definedIf(commas) // Specify format data using commas [2,000] TableCellNumberUseCommas (State: Yes!)Endif
// Select the table. Tableselecton (selectionmode: table!)// Select all cells in the current tableSelecttable ()// Delete table convert contents to documentTabledeletetable (delwhat: converttotabs!)// Move insertion point to end of data bockPosWordNext ()// Go to subroutine end Go(end)// If formula syntax is invalid thenElseendif
// Identify the subroutine errorLabel(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 documentTabledeletetable (delwhat: converttotabs!)// Delete character right of the insertion pointDeleteCharNext () // Go to subroutine endGo(end)
// Identify subroutine oninput.Label(oninput) // Display error message box in event of blank documentMessageBox (; "AUTOMATH UNABLE TO COMPLY"; "No input provided! Sequence terminated."; IconStop!)
// Identify the subroutine endLabel (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.
|
|
|
Navision Attain Database Access Via C/odbc In Asp.net Application
Navision Software was purchased by Microsoft and now it is supported by Microsoft Business Solutions together with Microsoft Great ...(related: Software)
Free Software: How Not To Get More Than You Bargained For!
I completed an experiment recently. I wanted to find out exactly what software I could get free on the Internet. My main focus was for software to include utilities and useful home business applications.I completed various searches for free software and related keywords on the leading search engines.What I found were thousands of web sites, proclaiming for you to be able to download software for free. Or at least a "try before you buy" basis.What I found was stunning.It seems once I downloaded a few of these ...(related: Software)
What Is A Document Manager Without Version History?
Document Manager and Version HistoryIn previous articles I have discussed the usefulness of a document manager, such as groupware, in organizing document sharing. I have also discussed the role that a Version History plays in a good document manager. In this article I wish to elaborate on Version History and its ability to make or break your document manager. The reason a document manager benefits so much from Version History is that Version History presents a visual flow chart of the editorial ...(related: Software)
The Importance Of Timely Timesheets
Whether you are a small consultancy firm, a medium sized accountancy practice, or a code warrior for hire in a back room of your house then you have at least one thing in common: you are in business to get paid quickly, and for the work you have done. Timesheets are the usual method for tracking time you spent working and thus are the key to timely invoice generation. Timely invoice generation and despatch is impo...(related: Software)
Computer Based Language Development And Spell-checking
Language development computer:Computer-based method for aiding language development seems like an interesting idea, the trick with this would be in getting the computer to take on part of the role of the human in the checking process.In all computer aided learning applications aimed at the very young, there is a danger that the computer may be seen as a replacement for a human instructor, however computer are notorious for not volunteering information or inability to deal with erratic behaviour. Getting this right would be a real challenge. As it seems now certain that inappropriate language teaching (...(related: Software)
Microsoft Great Plains Remote Support - Overview
Microsoft Great Plains is now standard mid-market ERP application, serving the whole spectrum of businesses. In the case of mid-size business we usually see strong IT team with SQL querying skills plus accounting department is already trained to use Great Plains and needs minimal help in figuring out on how to use new Great Plains version and features. In this situation company may leverage it's work force strength and minimize ERP application support cost. This is the goal of Microsoft Business Solutions and the philosophy of future computer systems. In this situation - in our opinion - there is no need to have expensive local support when consultants are coming to you on regular basis and spend at least four hours onsite, charging somewhat close to $200 per hour.Also, please take into consideration the fact that consulting ...(related: Software)
Bridging The Gap Between Paper And Data
The cornerstone of successful automated office systems is the ability to convert printed information into electronic d...(related: Software)
Microsoft Crm Integration With Ibm Lotus Notes Domino ? Machinery Dealership Example
IBM Lotus Notes with Domino email server is traditional document workflow management solution for large corporate business, where you need audit trail on approval cycle and decision making. Microsoft Business Solutions CRM is very cost efficient solution to automate sales process. It might be surprising, but we see good strata of clients who are willing to deploy and integrate both systems: MS CRM and Lotus Domino. In our opinion these clients are balancing ERP platform risks and trying to protect and deploy investments into Lotus licenses, while deploying new and already leading CRM solution ? Microsoft CRM. In this small article we'll give you the integration example ? European division of o...(related: Software)
Microsoft Crm Customization ? Programming Closed Email Activity
Microsoft CRM is CRM answer from Microsoft and attempt to get market share from Siebel, Oracle and others traditional Client Relationship Management System vendors. Microsoft CRM uses all the spectrum of Microsoft recent technologies: .Net, MS Excha...(related: Software)
Microsoft C# Vs. Vb.net
Hi, Guys,I believe a lot of programmers are trying to speculate which Microsoft language is the language of the future .Net applications. We did some research here and we think that at this moment Microsoft doesn't have an answer or a direction - they just try to place both VB.net and C#.net into competition with each other and see who will be the winner over time.Example - Microsoft CRM SDK - Microsoft says - they will have examples in both languages: C# and VB - but for now C# seems to be the winner and if you are vb.net programmer - it is really hard for you to program Microsoft CRM SDK.The other example is more favorable for VB.net. If you plan to program M...(related: Software)
site-map - Copyright © 2008 | Contact Webmaster | All Rights Reserved. | Software