Programming Index pageHome

 

Get me out of here! This kind of stuff gives me headaches!

WordPerfect Macros

| Mailing List Macro | Character Set Macro | Convert Directory to DOS Text |

Here are some good current WordPerfect Web resources. I recommend contacting them rather than myself, since it has been quite a while since I have actually done any freelance WordPerfect macro programming, now that I work for a software company that uses "the other" software and other languages.

If, after reading the description of the WP5.1 character set macro below, you have a use for it, feel free to download it here (remember to download both, since it is a two-part macro). These are small files and it doesn't take long:

Download: genchars.wpm charsets.wpm

 

Macro #1: Mailing List Alphabetized Printout

The following WordPerfect 6.0 macro takes the nine fields of a WordPerfect mailing list data file (1) and turns them into an alphabetized printout by merging the data file with a format file (2) and cleaning up the results. It was originally written as part of a much larger WordPerfect 5.1 mailing list management macro for a 286 computer, then converted to 6.0 for Windows 95 and cleaned up.

1. A typical FIG address data record in the WordPerfect mailing data file looks as follows, with nine fields (code, title, first name, last name, company, street address, city and state, 5-digit zip, 4-digit zip extension):

====================================================================
C2{END FIELD}
{END FIELD}
Joe{END FIELD}
Alexander{END FIELD}
{END FIELD}
45 Dead End Street{END FIELD}
Somewhere, CA{END FIELD}
90000{END FIELD}
-0000{END FIELD}
{END RECORD}
====================================================================

2. The format file into which the data is merged is as follows:



PAGEOFF FIELD(4), IFBLANK(2)FIELD(3)ELSE FIELD(2) FIELD(3)ENDIF

			FIELD(1)	IF BLANK(5)FIELD(6)ELSE FIELD(5) 

					FIELD(6)ENDIF

					FIELD(7) FIELD(8)FIELD(9) 


A page numbering code is included in the document initial codes file so that pages print out numbered.

3. The resulting printout of the macro looks like this (I am showing just the head and first two addresses of a printout):


1

ALPHABETICAL MAILING LIST

File alphabetized:c:\office\wpwin\wpdocs\Kosenko\mail1.dat

Date: December 12, 1996

Number of address records: 85

Alexander, Joe
			C2		45 Dead End Street
					Somewhere, CA 9000-0000
Kosenko, Peter
			A		2001 Hiding Place
					Somewhere, CA 90000

Here is the 6.0 macro that did it. It is not a "ready to use" macro. You will notice that it has many features that are peculiar to the FIG mailing list only. However, a generic macro might be developed from it.

//Description: Generates Alphabetical Listing



Local (mode; mail1; mail2; lastname) 

ASSIGN (mode; 1) 

CloseNoSave ()

DISPLAY(OFF!) 

NOTFOUND (Off!) 



//The following routine prompts for last name (personal mailing list), FIG (FIG mailing list),
or any other mailing list entered into the inventory list of of mailing lists.



GETSTRING (lastname; "Please Enter Last Name or FIG."; "Last Name")



//The following routine adds other lists to the inventory of alphabetizable lists; see
LABEL (cont1); the "mode" variable exists in case lists need slightly different
treatments. 



IF (lastname="FIG") ASSIGN (mode; 2) GO (cont1) ENDIF

IF (lastname="SITE") ASSIGN (mode; 3) GO (cont1) ENDIF

IF (lastname="a") ASSIGN (mode; 4) GO (cont1) ENDIF

IF (lastname="LACMA") ASSIGN (mode; 5) GO (cont1) ENDIF

IF (lastname="new") ASSIGN (mode; 6) GO (cont1) ENDIF

IF (lastname="walsh.dat") ASSIGN (mode; 7) GO (cont1) ENDIF



//The following routine checks personal list name spellings; this could be made case insensitive,
so that accidentally leaving the Caps Lock on would not matter.  DOS does not care. 



LABEL(retry) 

IF(lastname="OConnell") GO(cont1) ENDIF 

IF(lastname="Amato") GO(cont1) ENDIF 

IF(lastname="August") GO(cont1) ENDIF 

IF(lastname="Blaustein") GO(cont1) ENDIF 

IF(lastname="Brown") GO(cont1) ENDIF

IF(lastname="Chene") GO(cont1) ENDIF 

IF(lastname="deHeras") GO(cont1) ENDIF 

IF(lastname="de Heras") GO(cont1) ENDIF 

IF(lastname="Donaldson")  GO(cont1) ENDIF 

IF(lastname="Elgart") GO(cont1) ENDIF 

IF(lastname="Hendler") GO(cont1) ENDIF 

IF(lastname="Hoekzema") GO(cont1) ENDIF 

IF(lastname="Humble") GO(cont1) ENDIF 

IF(lastname="Johns") GO(cont1) ENDIF 

IF(lastname="Kosenko") GO(cont1) ENDIF 

IF(lastname="Lane") GO(cont1) ENDIF 

IF(lastname="Lubner") GO(cont1) ENDIF 

IF(lastname="Madans") GO(cont1) ENDIF 

IF(lastname="Martin") GO(cont1) ENDIF 

IF(lastname="Mississippi") GO(cont1) ENDIF 

IF(lastname="Namiki") GO(cont1) ENDIF 

IF(lastname="Urmston") GO(cont1) ENDIF 

IF(lastname="Walsh") GO(cont1) ENDIF 

IF(lastname="Wolff") GO(cont1) ENDIF 

IF(lastname="Ziment") GO(cont1) ENDIF 

GETSTRING(lastname; "Please reenter the last name using Uppercase/lowercase spelling (e.g., Kosenko, de Heras, Martin)."; "Name Misspelled or Miscapitalized")
GO(retry)

//The following routine opens a particular mailing list file and assigns the file and
pathname to the "data" variable. 



LABEL(cont1) 


IF (mode=1) FileOpen ("c:\office\wpwin\wpdocs\"+lastname+"\mail1.dat") 

ASSIGN (data; "c:\office\wpwin\wpdocs\"+lastname+"\mail1.dat") ENDIF

IF (mode=2) FileOpen ("c:\office\wpwin\wpdocs\mail\figlist\maillist.dat") 

ASSIGN (data; "c:\office\wpwin\wpdocs\mail\figlist\maillist.dat") ENDIF

IF (mode=3) FileOpen ("c:\office\wpwin\wpdocs\mail\figlist\site.dat")

ASSIGN (data; "c:\office\wpwin\wpdocs\mail\figlist\site.dat") ENDIF

IF (mode=4) FileOpen ("c:\office\wpwin\wpdocs\mail\figlist\a.dat")

ASSIGN (data; "c:\office\wpwin\wpdocs\mail\figlist\a.dat") ENDIF

IF (mode=5) FileOpen ("c:\office\wpwin\wpdocs\mail\figlist\lacma.a.dat")

ASSIGN (data; "c:\office\wpwin\wpdocs\mail\figlist\lacma.dat") ENDIF

IF (mode=6) FileOpen ("c:\office\wpwin\wpdocs\mail\figlist\new.dat")
ASSIGN (data; "c:\office\wpwin\wpdocs\mail\figlist\new.dat") ENDIF

IF (mode=7) FileOpen ("c:\office\wpwin\wpdocs\mail\figlist\walsh.dat")

ASSIGN (data; "c:\office\wpwin\wpdocs\mail\figlist\walsh.dat") ENDIF



//The following routine sorts the mailing list alphabetically by last name, first name, and zip,
and merges the sorted data with the format file.



PosDocBottom ASSIGN(recs; ?Page-2) 

SortKeys ({4; 1; 1; Alphanumeric!; Ascending!; 3; 1; 1; Alphanumeric!; Ascending!; 8; 1; 1;
Alphanumeric!; Ascending!}) 

SortType (MergeSort!) 

SortAction (Sort!) 

SortCaseOrder (LowercaseFirst!) 

Sort ()

FileSave ( ) CloseNoSave ()

MergeRun(FormFile!; "c:\office\wpwin\wpdocs\mail\formats\alphlist.1"; DataFile!; data;
ToCurrentDoc!)

HardPageBreak

Type("+")

PosDocTop ReplaceConfirm(No!) SearchString("]") ReplaceString("]")

ReplaceForward(Regular!) 

PosDocTop

Center Type ("ALPHABETICAL MAILING LIST") EnterKey EnterKey 

Center Type ("File alphabetized:"+data) EnterKey EnterKey

Center Type ("Date: ")  DateText EnterKey EnterKey 

Center Type ("Number of address records: "+recs) EnterKey EnterKey 



//The following routine searches for the first instance of a letter at the beginning of a line
and inserts a page break, if desired, so that the A's, B's, C's, etc. begin on a new page. 



LABEL(loop1) 

CHAR(quest1; "Alphabetical Sections Divided? (Y/N)") ASSIGN(quest1; NTOC(quest1) ) 

SWITCH(quest1) CASEOF "y": GO(sect) CASEOF "Y": GO(sect) CASEOF "n": GO(nosect) 

CASEOF "N": GO(nosect) 

DEFAULT: GO(loop1) ENDSWITCH 

LABEL(sect) 

NOTFOUND(ON!) ONNOTFOUND(nextletter) 

FORNEXT(num; 66; 90; 1) 

SearchString(""+NTOC(num) ) SearchNext(Regular!) 

PosCharPrevious DeleteCharPrevious HardPageBreak Type("$")

LABEL(nextletter) ENDFOR 

LABEL(nosect) 

NOTFOUND (OFF!) 

PosDocTop PosPageNext    

LABEL(loop2) 

IF(?RightChar="+") GO(exit) ENDIF 

IF(?RightChar="$") PosPageNext GO(loop2) ENDIF 

LABEL (loop3) 

IF(?RightCode=4576) PosLineUp PosLineBeg GO(loop3) 

ELSE DeleteCharPrevious HardPageBreak PosPageNext GO(loop2) 

ENDIF

LABEL(exit) 

PosDocTop 

ReplaceConfirm(No!) SearchString("$") ReplaceString("") ReplaceForward(Regular!) 

PosDocBottom DeleteCharPrevious DeleteCharPrevious

Macro #2: Viewing Character Sets and Inserting Characters in WordPerfect 5.1 for DOS

Until April of 1996 I was working in WP5.1 and DOS 4.0 on a loaner 286 machine, since my employers did not believe in buying computers and new software. If you, too, are lucky enough to be using WordPerfect 5.1 for DOS, you are aware that 5.1 is not completely WYSIWYG (what you see is what you get) when it comes to character sets.

First, WP5.1 does not have a character set selection menu. You have to look in the book or the CHARACTR.DOC file and type in key numbers with the "Ctrl + V" command ("4,19", for example, gets you the cent sign). Even then, not all characters display on the screen; many turn up as solid rectangles. WordPerfect 5.1 recommends that you use the view option on the print menu (Shift + F7, 6) to check how the characters display before printing to make sure that you got the right ones in the right places.

All well and fine, but what if while you are typing you have a lot of special (foreign and mathematical) characters and just can't remember all those number combinations? You have to look into the WordPerfect CHARACTER.DOC page by page until you find it, write it down, and go back to your document and enter the character key.

One solution is to create a Character Set Viewing macro that displays a character document in the View Document window and lets you choose the character right then and there for entry into your document.

In the process of creating this macro, I thought I would also create a "quick list" of characters, without the verbal descriptions that the WordPerfect Character Document provides, so that viewers could see more characters at a time and select by sight. First I began by typing out all the number combinations in a 4 parallel columns with 10 key number combinations per column. After each, I placed a tab, then inserted the character itself with the "Ctrl + V" command. Then it occured to me to create a macro to create the "quick character set" document.

Since the HTML is ASCII only (except for a limited number of other characters), I can show you only the portion of the ASCII character set that WordPerfect assigns to its "0" or "keyboard" set (it assigns other ASCII characters to other sets; you'll notice that 0,1 through 0, 32, and 0, 127 and above are "empty" or "null"):



Character Set 0

0,0
0,1			0,11			0,21			0,31		
0,2			0,12			0,22			0,32	 	
0,3			0,13			0,23			0,33		!	
0,4			0,14			0,24			0,34		"	
0,5			0,15			0,25			0,35		#	
0,6			0,16			0,26			0,36		$	
0,7			0,17			0,27			0,37		%	
0,8			0,18			0,28			0,38		&	
0,9			0,19			0,29			0,39		'	
0,10			0,20			0,30			0,40		(	

0,41		)	0,51		3	0,61		=	0,71		G	
0,42		*	0,52		4	0,62		>	0,72		H	
0,43		+	0,53		5	0,63		?	0,73		I	
0,44		,	0,54		6	0,64		@	0,74		J	
0,45		-	0,55		7	0,65		A	0,75		K	
0,46		.	0,56		8	0,66		B	0,76		L	
0,47		/	0,57		9	0,67		C	0,77		M	
0,48		0	0,58		:	0,68		D	0,78		N	
0,49		1	0,59		;	0,69		E	0,79		O	
0,50		2	0,60		<	0,70		F	0,80		P
0,81		Q	0,91		[	0,101		e	0,111		o
0,82		R	0,92		\	0,102		f	0,112 		p
0,83		S	0,93		]	0,103		g	0,113		q
0,84		T	0,94		^	0,104		h 	0,114		r
0,85		U	0,95		_	0,105		i	0,115		s
0,86		V	0,96		`	0,106		j	0,116		t
0,87		W	0,97		a	0,107		k	0,117		u
0,88		X	0,98		b	0,108		l	0,118		v
0,89		Y	0,99		c	0,109		m	0,119		w
0,90		Z	0,100 		d	0,110		n	0,120		x
0,121		y	0,122		z	0,123		{	0,124		|
0,125		}	0,126		~

There are actually two macros involved in the process of viewing character sets: (1) the macro (GENCHARS.WPM) that generates the character set document; this macro needs to be used only once. And (2) the macro (CHARSETS.WPM) that displays the quick character sets while you are working in WordPerfect (or alternately, displays the WordPerfect CHARACTR.DOC. While the programs have comments written into them, you might want to check the "fine points" in the notes after them.

I. GENCHARS.WPM (generates the character set document).



{DISPLAY OFF}
WordPerfect 5.1 Character Sets{Tab}{Enter}{Tab}{Enter}

{;}1. The following routine generates character sets 0 through 12.  It's variable "last" (assigned in the call
 routine) is the last character of the set.~

{FOR}num1~0~12~1~
	{CALL}assign1~
	Character Set {VARIABLE}num1~{Tab}{Enter}{Tab}{Enter}
	{FOR}num2~0~260~1~
		{VARIABLE}num1~,{VARIABLE}num2~{Tab}{^V}
{VARIABLE}num1~,{VARIABLE}num2~{Enter}{Enter}
		{IF}{VARIABLE}num2~={VARIABLE}last~~{BREAK}{END IF}
	{END FOR}
{Tab}{Enter}{Tab}{Enter}
{END FOR}
{Home}{Home}{Down}{Indent}

{;}2. The following routine determines the length of the key (0,15 is 4 characters long, and 12,246 is 6
characters long, for example). If the key is smaller than 5 characters, the routine inserts another tab
between the key and the character in order to even out columns.  It presumes that you have a standard
ruler with 5-space tabs; if not, you will have to change your ruler back before running the macro.~

{Home}{Home}{Up}
{ASSIGN}num3~0~
{LABEL}keylength~
{IF}{SYSTEM}right~=49664~{GO}cleanup1~{END IF}
{IF}{SYSTEM}right~=49410~
	{IF}{VARIABLE}num3~<5~ {Tab}{Down}{Home}{Left} {ASSIGN}num3~0~ {GO}keylength~ {ELSE} {Down}{Home}{Left} {ASSIGN}num3~0~ {GO}keylength~ {END IF} {ELSE} {ASSIGN}num3~{VARIABLE}num3~+1~ {Right} {END IF} {GO}keylength~ {;}3. The following routine replaces [Tab][Hrt] with [Hrt] through four cycles, just in case there are any multiple Tabs followed by Hard Returns.~ {LABEL}cleanup1~ {FOR}num1~1~4~1~ {Replace}n{Tab}{Enter} {Replace}{Enter} {Search} {Home}{Home}{Up} {END FOR} {;}4. The following routine defines a 4-column format before each character set and shuts columns off after the set.~ {LABEL}columns~ {FOR}num1~0~12~1~ {Search}Character Set {VARIABLE}num1~{Search} {Search}{VARIABLE}num1~{Search}{Home}{Left} {Columns/Tables}131224{Enter}{Enter}1 {IF}{VARIABLE}num1~="12~{BREAK}{END" IF} {Search}Character{Search}{Home}{Left} {Columns/Tables}12 {END FOR} {Home}{Home}{Down} {Left}{Left}{Left} {Column/Tables}12 {;}5. The following routine breaks the columns of the previous routine into columns of 10.~ {Home}{Home}{Up} {FOR}num1~0~12~1~ {CALL}assign1~ {FOR}num2~11~{VARIABLE}last~~10~ {Search}{VARIABLE}num1~,{VARIABLE}num2~{Search}{Word Left}{HPg} {END FOR} {Home}{Home}{Up} {END FOR} {;}6. The following routine starts a separate page for each character set, except 0.~ {Home}{Home}{Up} {FOR}num1~1~12~1~ {Search}Character Set {VARIABLE}num1~{Search}{Home}{Left}{HPg} {END FOR} {;}7. The following routine spaces out large graphic charcters in sets 3 and 7 that would otherwise overlap in the view screen~ {Home}{Home}{Up} {FOR}num1~0~87~1~ {Search}3,{VARIABLE}num1~{Search}{Home}{Left}{Enter} {END FOR} {FOR}num1~0~228~1~ {Search}7,{VARIABLE}num1~{Search}{Home}{Left}{Enter} {END FOR} {GO}exit~ {;}8. The following subroutine assigns the number of the last character of a set to the variable "last." Since it is used twice in the program, it has been condensed into a subroutine.~ {LABEL}assign1~ {IF}{VARIABLE}num1~="0~{ASSIGN}last~126~{END" IF} {IF}{VARIABLE}num1~="1~{ASSIGN}last~233~{END" IF} {IF}{VARIABLE}num1~="2~{ASSIGN}last~27~{END" IF} {IF}{VARIABLE}num1~="3~{ASSIGN}last~87~{END" IF} {IF}{VARIABLE}num1~="4~{ASSIGN}last~84~{END" IF} {IF}{VARIABLE}num1~="5~{ASSIGN}last~34~{END" IF} {IF}{VARIABLE}num1~="6~{ASSIGN}last~234~{END" IF} {IF}{VARIABLE}num1~="7~{ASSIGN}last~228~{END" IF} {IF}{VARIABLE}num1~="8~{ASSIGN}last~209~{END" IF} {IF}{VARIABLE}num1~="9~{ASSIGN}last~43~{END" IF} {IF}{VARIABLE}num1~="10~{ASSIGN}last~149~{END" IF} {IF}{VARIABLE}num1~="11~{ASSIGN}last~184~{END" IF} {IF}{VARIABLE}num1~="12~{ASSIGN}last~254~{END" IF} {RETURN} {;}9. The following screen instructs you how to save the file after the macro terminates~ {LABEL}exit~ {TEXT}text~{Home}{Enter}{Enter}{Enter}{Enter}{Enter} Save this file as{Enter}{Enter} CHARSETS.WPD{Enter}{Enter} In your WP51 program directory.{Enter}{Enter} Remember that you will have to change the pathname of this file in the{Enter} CHARSETS.WPM macro to the pathname of the directory in which your{Enter} WordPerfect program files reside.{Enter}{Enter} After copying the CHARSETS.WPM macro to your WordPerfect 5.1 MACROS directory,{Enter} you can access the macro for editing by pressing Ctrl + F10, selection 2 for edit.{Enter} Once inside the macro editor, cursor to the C:\WP51\CHARSETS.WPD and{Enter} C:\WP51\CHARACTR.DOC and change to pathnames to yours.{Enter}{Enter} Press Enter to Continue.~ {Enter} {Quit} 

Notes

1. Your version of WordPerfect 5.x may well have more than 12 character sets, and more characters per set than mine. To find out, you can run a simplified version of this section of the macro that expands the range that it covers. This is how I discovered that my version has 12 sets, the highest number of characters being 254. In the following code I have increased "num1", the character set number, from 12 to 20, and "num2", the key number, from 260 to 300):

Test Macro



	{FOR}num1~0~20~1~
		Character Set {VARIABLE}num1~{Enter}{Enter}
		{FOR}num2~0~300~1~
			{VARIABLE}num1~,{VARIABLE}num2~{Tab}{^V}
	{VARIABLE}num1~,{VARIABLE}num2~{Enter}{Enter}
		{END FOR}
	{Enter}{Enter}
	{END FOR}

You will notice that this part of the actual program inserts {Tab}{Enter} rather than simply {Enter} at the end of header lines and empty (space) lines. This is because the routine that follows reads every line of the text, stopping at the first Tab and recording the number of characters up to that point. This means that each and every line (even blank ones) must have at least one Tab.

2. You will notice that this routine uses the {SYSTEM}right~ function to identify the first Tab of a line. If the character is a Tab, {SYSTEM}right~ returns the numeric value 49410. You will also notice that I have had the program put an {Indent} code at the end of the file. This is so that the loop stops when {SYSTEM}right~ reads it and returns the numeric value 49664. This little trick of using characters as "markers" was one that I came up with to get around certain limitations of a very simplified macro program. For reasons of syntax, characters that return numeric values are preferable to values that return string values ([Hrt], for example, returns itself, [Hrt]).

3. Routine 3 is labeled "cleanup1" because I was thinking of a second cleanup that would remove ASCII keys "0,0" through "0,33", which do not exist because WordPerfect assigns them to other WordPerfect character sets. But then I thought people might wonder why they weren't there, so I left the keys to prove that they actually have no characters associated with them. For the same reason, I have left character set 12 in the character set document, even though it will not display characters in the view window unless you have defined them (these are User Defined characters).

4. You'll notice the {BREAK} in the {FOR} routine when {VARIABLE}num1~ is 12. This is because there is no "Character Set" head to be found after the last character set. Inserting the Column Off there has to be done outside of the {FOR} loop.

5. If you ran this program with {DISPLAY ON}, you would see that even after the columns have been defined, each character set is still just one long column. Hence this routine seeks out the keys 11, 21, 31, 41, etc., goes to the beginning of the line and inserts a Hard Page Break to create a new column (all columns have 10 keys, except the first, which has 11 because keys begin with 0).

If you do not put {VARIABLE}last~ in the ending number slot of the {FOR}num2~ statement, you will find that the routine keeps searching past the end of the 0 character set into the 10 character set (which also has a 0). I spent a fruitless hour trying to figure out other ways around this until using {VARIABLE}last~ in the {FOR} statement occured to me.

6. This is a fairly obvious routine. You want character sets to fall on a new page so that you can eventually view them one at a time in the view window.

7. The comment in the program says it all.

8. See note #1 to find out how I discovered what the number of the last character in a set was.

9. The program shows the following screen before exiting:

Save this file as

CHARSETS.WPD

In your WP51 program directory.

Remember that you will have to change the pathname of this file in the CHARSETS.WPM macro to the pathname of the directory in which your WordPerfect program files reside.

After copying the CHARSETS.WPM macro to your WordPerfect 5.1 MACROS directory, you can access the macro for editing by pressing Ctrl + F10, selection 2 for edit. Once inside the macro editor, cursor to the C:\WP51\CHARSETS.WPD and C:\WP51\CHARACTR.DOC and change to pathnames to yours.

Press Enter to Continue.

II. CHARSETS.WPM macro (displays character sets and inserts a character into the document being typed)

The macro can be accessed two ways: (1) by Alt + F10 plus the name CHARSETS, or (2) by pressing Alt + c (a keyboard macro) if you copy it to the filename ALTC.WPM in your WordPerfect macro directory.




{DISPLAY ON}
{Switch}
{LABEL}menu1~
{CHAR}menu1~{Del to EOP}{^N}{Del to EOP}
{^P}{^S}{^E}1. Quick View (no character names)
{^P}{^S}{Home}2. Full View (character names)

{;}1. Select which character document to view.~

{^P}{^S}{Enter}Enter Selection: ~
{CASE}{VARIABLE}menu1~~
	1~quick~
	2~full~
	{OTHERWISE}menu1~~
{LABEL}quick~
{Enter}
{ASSIGN}mode~1~
{GO}menu2~
{LABEL}full~
{Enter}
{ASSIGN}mode~2~

{;}Select the Character Set.~

{LABEL}menu2~
{TEXT}menu2~{Del to EOP}{^N}{Del to EOP}
{^P}{^S}{^E}Character Sets
{^P}{^S}{^G}0. ASCII space through tilde
{^P}{^S}{Home}1. Multinational 1
{^P}{^S}{Tab}2. Multinational 2
{^P}{^S}{Enter}3. Box Drawing
{^P}{^S}{Del to EOL}4. Typographic Symbols
{^P}{^S}{Del to EOP}5. Iconic Symbols
{^P}{^S}{^M}6. Math/Scientific
{^P}{^S}{^N}7. Math/Scientific Extension
{^P}{^S}{^O}8. Greek
{^P}{^S}{^P}9. Hebrew
{^P}{^S}{^Q}10. Cyrillic
{^P}{^S}{^R}11. Japanese Kana
{^P}{^S}{^S}12. User Defined
{^P}{^S}{^U}Enter Selection (then press Enter): ~

{;}Assign the search value based on the menu selection above.~

[CASE}{VARIABLE}menu2~~
	0~search1~
	1~search1~
	2~search1~
	3~search1~
	4~search1~
	5~search1~
	6~search1~
	7~search1~
	8~search1~
	9~search1~
	10~search1~
	11~search1~
	12~search1~
	{OTHERWISE}menu2~~
{LABEL}search1~
{IF}{VARIABLE}menu2~=0~{ASSIGN}search1~ASCII~{END IF}
{IF}{VARIABLE}menu2~=1~{ASSIGN}search1~Multinational 1~{END IF}
{IF}{VARIABLE}menu2~=2~{ASSIGN}search1~Multinational 2~{END IF}
{IF}{VARIABLE}menu2~=3~{ASSIGN}search1~Box Drawing~{END IF}
{IF}{VARIABLE}menu2~=4~{ASSIGN}search1~Typographic Symbols~{END IF}
{IF}{VARIABLE}menu2~=5~{ASSIGN}search1~Iconic Symbols~{END IF}
{IF}{VARIABLE}menu2~=6~{ASSIGN}search1~Math/Scientific~{END IF}
{IF}{VARIABLE}menu2~=7~{ASSIGN}search1~Math/Scientific Extension~{END IF}
{IF}{VARIABLE}menu2~=8~{ASSIGN}search1~Greek~{END IF}
{IF}{VARIABLE}menu2~=9~{ASSIGN}search1~Hebrew~{END IF}
{IF}{VARIABLE}menu2~=10~{ASSIGN}search1~Cyrillic~{END IF}
{IF}{VARIABLE}menu2~=11~{ASSIGN}search1~Japanese Kana~{END IF}
{IF}{VARIABLE}menu2~=12~{ASSIGN}search1~User Defined~{END IF}

{;}Display Character Set in the Document View window.~

{Search}{VARIABLE}search1~{Search}
{Print}6
{TEXT}text~
{^P}{Home}{^B}To navigate the view screen, first press Enter,
{^P}{Home}{^C}then use the Arrow keys, the Page Up and Page
{^P}{Home}{^D}Down Keys, and the menu at the bottom of the screen.
{^P}{Home}{^E}To select a character, press F7.
{^P}{^N}{^G}Press Enter to Continue.~
{Enter}
{PAUSE KEY}{Exit}~

{;}Query for character insertion.~

{LABEL}quest1~{Home}
{^P}{^N}{^B}Do you wish to insert a character? Y/N: ~
{Enter}
{Exit}
{CASE}{VARIABLE}quest1~~
	y~insert~
	Y~insert~
	n~exit~
	N~exit~
	{OTHERWISE}quest1~~

{;}Enter key numbers.~

{LABEL}insert~
{TEXT}key~
{^P}{^N}{^B}{^N}{^P}Enter the key numbers x,y (no spaces): {^O}{^P}~
{Exit}
{Switch}
{^V}{VARIABLE}key~{Enter}

{;}Close the Character Set document and quit.~

{LABEL}exit~
{IF}"{VARIABLE}quest1~"="Y"|"{VARIABLE}quest1~"="y"~
	{Switch}
	{Exit}ny
{ELSE}
	{Exit}
	{Exit}ny
{END IF}
{QUIT}


The macro can be assigned to the keyboard (Alt + Key starts the macro). I chose the C key for "character." Use the DOS prompt command:

copy c:\wp51\macros\charsets.wpm altc.wpm

| Books Edited | Writing | Web Design | Programming | Guitar | Links |


 

E-mail Peter the answers to all his questions

E-mail