Spell 1-2-3

Spell 1-2-3 for 1-2-3 for OS/2 Release 1.1 is a custom application that 
includes custom @functions and macro commands. It lets you check and correct 
the spelling of the text in a worksheet. With Spell 1-2-3, you can locate 
misspelled words in a current cell, a range, or an entire worksheet and correct 
the spelling errors either by editing the misspelled words or by replacing a 
misspelled word from a list of alternative words on the screen.

Note-Spell 1-2-3 detects errors in label cells only.

For more information on the custom @function and macro commands in Spell 1-2-3, 
see the section -Technical notes" later in this chapter. For information on 
creating your own applications, refer to the Creating Custom @Functions and 
Macro Commands guide.

Note-You must have Freelance Graphics for OS/2 installed to use Spell 1-2-3.

	Insert the Custom Application Samples Disk in drive A and close the 
door.

	Type A: and press ENTER.

	Type CD SPELLCHK and press ENTER.

	Type COPY *.* C:\123G and press ENTER. If C:\123G is not the path and 
name of your 1-2-3 program directory, substitute the appropriate path.

The installation procedure copies the following files to your 1-2-3 program 
directory:





Files 

SPELL.DLL

Spelling application

SPELL.WG2

Spelling worksheet

SPELL.DEF

Module definition file

SPELL.C

Source code for the spelling application



After you copy these files to your 1-2-3 program directory, you can start 1-2-3 
and attach and use Spell 1-2-3.

Note-You can move SPELL.WG2 to another directory, but the other files should 
remain in the program directory.

	Set File Directory to C:\123G, where C:\123G is your 1-2-3 program 
directory. If C:\123G is not the path and name of your 1-2-3 program directory, 
substitute the appropriate path.

	Select File Open and specify SPELL.WG2. 

	Select OK.

SPELL.WG2 appears as an icon on the desktop. You do not have to display or 
maximize the worksheet to use Spell 1-2-3. The application remains available 
until you end the work session.

Note-If you do not set your file directory path to your 1-2-3 program directory 
and you open SPELL.WG2, the following error message is displayed: -The system 
cannot open the device or file specified."

If this occurs, select OK, set your file directory to your 1-2-3 program 
directory and press CTRL+0. A copyright message appears on the screen and you 
can change the file directory path to any directory.

	Select Spell Check from the Utility menu.

	Specify the range that contains the text you want to check in the Range 
text box. The range cannot be a collection. Spell 1-2-3 examines each cell in 
the range you specify, therefore it is not recommended that an entire sheet or 
worksheet file range be used.

	Specify the character(s) you want 1-2-3 to treat as part of a word in 
the Non-Delimiters text box. For example, if a cell contains -Cost of one-time 
project preparation" and you enter hyphen (-) in the Non-Delimiters text box, 
1-2-3 checks the words -Cost", -of", -one-time", -project", and -preparation." 
If you do not enter a hyphen in the text box, 1-2-3 examines both -one" and 
-time." 

	Select Check Spelling. 1-2-3 begins to check the contents of each cell 
in the range. When 1-2-3 encounters a word that may be misspelled, a dialog box 
appears.

The upper left corner of the dialog box displays the address of the current 
cell and the current word in the cell. The Replace with text box contains the 
misspelled word. Select one of the following 
options to replace the misspelled word.





Option Description

Add to Dictionary

Adds the current word to the dictionary.

Alternatives

Allows you to replace the current word with a word in the Alternatives list 
box. Select the word you want to use as a replacement, press ENTER or tab, and 
then select Replace or Replace All (see below). If no alternatives exist, the 
list box is empty.

Cancel

Ends the search for misspelled words and returns 1-2-3 to READY mode. Any 
changes you have made to the content of the current cell are ignored.

Replace

Replaces the current word with the word in the Replace with text box.

Replace All

Replaces the current word and all remaining occurrences of the word in the 
range with the word in the Replace with text box. For the remainder of the 
current work session, the Utility Spell Check command continues to make this 
correction automatically. The current session continues until you quit 1-2-3 or 
detach Spell 1-2-3. For information on how to manually detach Spell 1-2-3, 
refer to the section -Detaching Spell 1-2-3."

Skip

Tells 1-2-3 to ignore the current word and continue searching for misspellings.

Skip All

Tells 1-2-3 to ignore remaining occurrences of the current word in the range 
and any range you specify with the Utility Spell Check until the end of the 
current work session. The current session continues until you quit 1-2-3 or 
detach Spell 1-2-3. For information on how to manually detach Spell 1-2-3, 
refer to the section -Detaching Spell 1-2-3."

Edit

Edits the misspelled word in the Replace with text box. Press enter or tab, and 
then select Replace or Replace All to use the edited word.



Note-You can reverse any changes Spell 1-2-3 makes to the worksheet by 
selecting Undo from the 1-2-3 Edit menu. For more information on Undo, refer to 
the Reference guide.

Note-To save the information in the Non-Delimiters text box for future work 
sessions, save SPELL.WG2.

Caution-If you spell check a sealed file, Spell 1-2-3 does not execute and 
displays the error message, -The spell checker encountered an error". If the 
range to be spell checked contains cells in hidden columns, rows, or sheets, 
Spell 1-2-3 stops at the cell in the hidden column, row, or sheet with the 
following error message, -The spell checker encountered an error". To avoid the 
error, display the hidden columns, rows, or sheets using SHIFT F6.

Spell 1-2-3 consists of the following components:

		LDCSPELL.DLL - the spelling engine

The spelling engine is a proprietary product of Lotus 
Development Corporation and supports a basic set of lookup and dictionary 
maintenance functions.

		SPELL.DLL - the spelling checker custom application

SPELL.DLL contains custom @functions and macros that allow you to communicate 
with the spelling engine.

Note-OS/2 applications use Dynamic Link Libraries (DLLs). You develop 
applications, such as Spell 1-2-3 by using the 
C programming language and a library and a header file provided with 1-2-3. For 
more information on creating applications, refer to Creating Custom @Functions 
and Macro Commands guide.

		SPELL.WG2 - a worksheet file containing macros

SPELL.WG2 contains the macros that add the Spell Check command to the Utility 
menu, display the Utility Spell Check and Spelling dialog boxes, and allow you 
to make selections in the dialog boxes.

Spell 1-2-3 includes a custom @function, @SPELL. Use this function to determine 
whether a word is spelled correctly. The @function has the following syntax:

@SPELL("string")

string is the text string or the address of a cell containing a text string.

The @function returns 1 (TRUE) if the string is spelled correctly; 
0 (FALSE) if the string was not found in the dictionaries or the current 
acceptable spellings list.

You communicate with the application and, indirectly, with the spelling engine, 
with a custom @function, @SPELLX. @SPELLX accepts several different sets of 
arguments that instruct the application to perform particular functions.

The following table lists these arguments and provides a description for each 
argument.





Argument Description

@SPELLX(0)

Loads LDCSPELL.DLL and initializes the spelling engine options and 
dictionaries. @SPELLX returns 1 if successful; 0 if the operation fails.

@SPELLX(1,"string")

Checks the spelling of the current word. @SPELLX returns 0 if the word is 
correctly spelled, 1 if the word is incorrectly spelled and an alternate word 
exists, 3 if the word is incorrectly spelled and no alternate word exists, or 
the alternate word if the word was incorrectly spelled and a previous call to 
accept a spelling defined an alternate word.

@SPELLX(2,"string")

Accepts string as a correctly spelled word. @SPELLX returns 1 if successful; 0 
if the operation fails.

@SPELLX(3,"string1","string2")

Corrects string1 to be string2. @SPELLX returns 1 if successful; 0 if the 
operation fails.

@SPELLX(4,"string")

Appends string to the user dictionary, CUSTOM.SPL. @SPELLX returns 1 if 
successful; 0 if the operation fails.

@SPELLX(5,"string")

Identifies each character in string not used to delimit a string. The 
alphabetic characters (A through Z) are not used as delimiters. A space is 
always a delimiter; if string contains spaces, they are ignored. @SPELLX 
returns 1 if successful; 0 if the operation fails.

@SPELLX(6,"string")

Parses string into zero or more substrings. Each substring can contain 
alphabetic characters (A through Z) and non-delimiters. @SPELLX returns the 
number of substrings if successful; -1 if the operation fails.

@SPELLX(7,n)

Returns the nth substring of the most recently parsed string if successful; 0 
if the operation fails.

@SPELLX(8,n,"string")

Sets the value of the nth substring to string. @SPELLX returns 1 if successful; 
0 if the operation fails.

@SPELLX(9)

Joins a set of substrings into a single string. The result preserves any 
delimiters in the original string and incorporates any changes to the 
substrings. @SPELLX truncates the new string to fit within a cell (the maximum 
number of characters that can fit in a cell is 511). @SPELLX returns the string 
if successful; 0 if the operation fails.

@SPELLX(10)

Returns 1 if the most recent join causes truncation; 0 if it does not cause 
truncation.



The {SPELLGUESS} macro accepts a word to spell and a range to erase and then 
suggests alternative spellings. The spelling engine provides up to 10 suggested 
alternate spellings for words that are not found in the dictionary. Some words 
do not have alternate spellings; in this case, the output range is blank.

The syntax for {SPELLGUESS} is as follows:

{SPELLGUESS "string",range}

The {PUT3} macro enters the contents of the first cell in range2 at the 
specified sheet, column, and row position in range1. The normal {PUT} macro 
only supports 2D ranges. {PUT3} supports 3D ranges. 

The syntax for {PUT3} is as follows:

{PUT3 range1,sheet-offset,column-offset,row-offset,range2}

The spelling engine uses the user dictionary, CUSTOM.SPL. You can edit this 
file. The application always requires CUSTOM.SPL.



1-2-3 attaches applications in response to the {LIBRARY-ATTACH} command. You 
can detach an application by using
{LIBRARY-DETACH}. 

To detach Spell 1-2-3, use the following command:

{library-detach "SPELL"}

Note-If you detach SPELL.DLL and select Spell Check from the Utility menu, 
SPELL.DLL is automatically re-attached. For more information on 
{LIBRARY-ATTACH} and {LIBRARY-DETACH} commands, refer to Creating Custom 
@Functions and Macro
Commands guide.

Spell 1-2-3 contains a macro that appends the Spell Check option to the Utility 
menu. You can use the {MENU-RESET} command to remove this option from the menu. 
For more information on the {MENU-RESET} command, refer to the @Functions and 
Macros guide.

