Copyright: Copyright (c) Novell, Inc. 1994.
Citation: If copying a macro example, you will need to edit the example before running the macro.


Contents

Click an icon or a title to find information.

Macro Command Index  Product, programming, and system variable macro commands

Concepts  Information about macros, dialog boxes, coaches, macro examples, and Macro Facility

Search  Index of help topics and features

Additional Help  Glossary, Macros Included with Presentations, Print Topics, and Presentations Help file


Macro Command Index

This index contains help on each macro command.  Programming commands are in uppercase letters, and product commands are in both uppercase and lowercase letters.  For more information on using programming and product commands, see Macro Basics and Creating Macros .

// (Comment)

A

AboutDlg

AcquireImage

AcquireImageDlg

AcquireImageSelect

AddArc

AddBackground

AddBackgroundDlg

AddLayout

AddLayoutDlg

AddPolyCurve

AddPolyLine

AddRoundedRect

AddSlide

AddSlideDlg

AddTextBox

AirBrush

AlignCenterLeftRight

AlignObjectsBottom

AlignObjectsCenter

AlignObjectsLeft

AlignObjectsRight

AlignObjectsTop

AlignObjectsTopBottom

APPACTIVATE

APPEXECUTE

APPEXECUTEEXT

APPLICATION

ApplicationMaximize

ApplicationMinimize

ApplicationMove

ApplicationRestore

ApplicationSize

APPLOCATE

ASSERT

ASSIGN

AssignBackgroundDlg

AssignLayoutBackground

B

BackgroundGetNext

BackgroundGetPrevious

BackgroundNext

BackgroundPrevious

Backspace

BEEP

BeginAcquireImageArea

BeginAcquireImageFixedSize

BeginAirBrush

BeginArrow

BeginBezier

BeginBitmap

BeginBulletChart

BeginCircle

BeginCircularArc

BeginClosedCurve

BeginCurve

BeginDataChart

BeginEllipse

BeginEllipticalArc

BeginFloodFill

BeginFreehand

BeginLine

BeginOrgChart

BeginPaintBrush

BeginPaintDropper

BeginPaintEraser

BeginPolygon

BeginRectangle

BeginRegularPolygon

BeginRetrieveFigure

BeginRoundedRectangle

BeginSelect

BeginSelectArea

BeginSelectiveReplace

BegOfLine

BIFFILEPATH

BIFINFO

BIFREAD

BIFWRITE

BitmapBlur

BitmapBrightness

BitmapCancel

BitmapContrast

BitmapCreate

BitmapEmboss

BitmapEqualize

BitmapMosaic

BitmapRain

BitmapReturn

BitmapSaturation

BitmapSharpen

BitmapSmooth

BitmapSpecialEffectsDlg

BitmapSpikeRemoval

BitmapStereogram

BitmapTrace

BitmapTraceContours

BitmapUndo

BitmapWind

BitmapZoom

BlackAndWhite

BlendDlg

BlendObjects

BoxAttributesDlg

BREAK

BrushAttributesDlg

BulletChartAttrEnd

BulletChartAttrStart

C

CALL

CANCEL

CapBeginSentence

CASE

CASE CALL

CHAIN

CHARLEN

CHARPOS

ChartArea

ChartAttributesDlg

ChartAutoRedraw

ChartBar

ChartBoxAttributesDlg

ChartClearAll

ChartClearDlg

ChartClose

ChartCopy

ChartCreate

ChartCreateBullet

ChartCreateDlg

ChartCreateOrg

ChartCreateOrgDlg

ChartCut

ChartDataAxisDlg

ChartDataColWidthDlg

ChartDataExcludeDlg

ChartDataFillDlg

ChartDataFormatDlg

ChartDataFormulasDlg

ChartDataFrameDlg

ChartDataGridTickDlg

ChartDataIncludeDlg

ChartDataLabelsDlg

ChartDataLayoutDlg

ChartDataLegendDlg

ChartDataPerspectiveDlg

ChartDataRecalc

ChartDataSeriesDlg

ChartDataSortDlg

ChartDataStatisticsDlg

ChartDataTitlesDlg

ChartDeleteDlg

ChartEdit

ChartEditCellDlg

ChartFillAttributesDlg

ChartFontAttributesDlg

ChartFontDlg

ChartGallery

ChartGalleryDlg

ChartGotoCell2

ChartGotoCellDlg

ChartHiLo

ChartInsertDataDlg

ChartLine

ChartLineAttributesDlg

ChartOpenFileDlg

ChartOrDataWindowNext

ChartPaste

ChartPasteTranspose

ChartPie

ChartRadar

ChartSaveAsDlg

ChartScatter

ChartSelectAll

ChartSelectBox

ChartSelectFrameBase

ChartSelectGTA

ChartSelectNext

ChartSelectPieWedge

ChartSelectPrev

ChartSelectSeries

ChartSelectText

ChartSetAbove

ChartSetAxisTitleHorz

ChartSetAxisTitleVert

ChartSetBack

ChartSetBelow

ChartSetBottom

ChartSetCenter

ChartSetCreateSize

ChartSetFront

ChartSetHide

ChartSetHorz

ChartSetInside

ChartSetLabels

ChartSetLeft

ChartSetLegend

ChartSetLinear

ChartSetLog

ChartSetOutside

ChartSetRight

ChartSetStagger

ChartSetTitleLeft

ChartSetTitleRight

ChartSetTop

ChartSetUnStagger

ChartSetVert

ChartSetY1

ChartSetY2

ChartSurface

ChartTable

ChartTitlesDisplay

ChartToggle3D

ChartToggleHorzVert

ChartToggleTable

ChartViewDatasheet

ChartViewOrgOutline

ClearBackground

ClearBitmap

ClearDocument

ClearDrawing

ClearLayout

ClearMaster

ClearMasterDlg

ClearPresentation

ClearPresentationDlg

ClearSlide

ClipboardCopy

ClipboardCut

ClipboardPaste

CLOSEFILE

COACHANIMATE

COACHFILTERADD

COACHFILTERDESTROY

COACHFILTERDISABLE

COACHFILTERENABLE

COACHGETREGIONINFO

COACHMESSAGEBOX

COACHMESSAGEBOXCLOSE

COACHPROMPT

COACHPROMPTCLOSE

COACHREMOVEDIALOGFILTER

COACHSETDIALOGFILTER

ColorAttributesDlg

CombineObjects

ConnectorsDlg

ContourText

ContourTextAttributesDlg

COPYFILE

CopyMarquee

CopySelectedSlides

CREATEDIRECTORY

CrosshairCursor

CTON

CutMarquee

D

DatasheetBlockMode

DatasheetColWidth

DatasheetDateFmt

DatasheetDelete

DatasheetDown

DatasheetExclude

DatasheetExport

DatasheetFillDates

DatasheetFillNumbers

DatasheetFormula

DatasheetGoto

DatasheetHome

DatasheetImport

DatasheetImportOptions

DatasheetImportText

DatasheetInclude

DatasheetInput

DatasheetInsert

DatasheetLeft

DatasheetNumericFmt

DatasheetPgDn

DatasheetPgLeft

DatasheetPgRight

DatasheetPgUp

DatasheetRight

DatasheetUp

DateCode

DateFormat

DateFormatDlg

DateText

DDEEXECUTE

DDEEXECUTEEXT

DDEINITIATE

DDEPOKE

DDEREQUEST

DDETERMINATE

DDETERMINATEALL

DECLARE

DEFAULTUNITS

DefineBulletsDlg

Delete

DeleteAlignBars

DeleteBackground

DELETEDIRECTORY

DELETEFILE

DeleteKeyboard

DeleteLayout

DeleteMenu

DeleteObjects

DeleteSelectedSlides

DeleteToBegOfWord

DeleteToEndOfWord

DeleteWord

DelToDocBottom

DelToEndOfLine

DetachTemplate

DIALOGADDCHECKBOX

DIALOGADDCOLORWHEEL

DIALOGADDCOMBOBOX

DIALOGADDCONTROL

DIALOGADDCOUNTER

DIALOGADDEDITBOX

DIALOGADDFILENAMEBOX

DIALOGADDFRAME

DIALOGADDGROUPBOX

DIALOGADDHLINE

DIALOGADDHOTSPOT

DIALOGADDICON

DIALOGADDLISTBOX

DIALOGADDLISTITEM

DIALOGADDPOPUPBUTTON

DIALOGADDPUSHBUTTON

DIALOGADDRADIOBUTTON

DIALOGADDSCROLLBAR

DIALOGADDTEXT

DIALOGADDVIEWER

DIALOGADDVLINE

DIALOGDEFINE

DIALOGDESTROY

DIALOGDISMISS

DIALOGDISPLAY

DIALOGHANDLE

DIALOGSHOW

DIALOGUNDISPLAY

DIMENSIONS

DISCARD

DisplaySettingsDlg

DLLCALL

DLLCALL PROTOTYPE

DLLFREE

DLLLOAD

DocPrevious

DocumentBottom

DocumentFormSettings

DocumentMaximize

DocumentMinimize

DocumentMove

DocumentNext

DocumentPageColor

DocumentRestore

DocumentSize

DocumentTop

DOESDIRECTORYEXIST

DOESFILEEXIST

DoubleSmartQuote

DraftMode

DrawingSizeDlg

DrawingSizeSettings

E

EditBackground

EditLayouts

EditOleObject

EditSelectedBitmap

EditSlides

ENDAPP

EndOfLine

EndOfSentenceSpacing

EnvBackgroundTitle

EnvCapBeginSentence

EnvChartDataWin

EnvChartDisplay

EnvChartType

EnvColorPalette

EnvCurrentBackgroundNumber

EnvCurrentFilename

EnvCurrentLayoutNumber

EnvCurrentMode

EnvCurrentSlideNumber

EnvCurrentTool

EnvDoubleSmartQuoteClose

EnvDoubleSmartQuoteOpen

EnvDoubleSmartQuoteState

EnvEndOfSentenceSpacing

EnvIrregularCap

EnvIsCommandValid

EnvLayoutTitle

EnvLeftChar

EnvNumberOfBackgrounds

EnvNumberOfDocuments

EnvNumberOfLayouts

EnvNumberOfSlides

EnvOpenDocuments

EnvPaths

EnvQuickCorrect

EnvRightChar

EnvSelectedText

EnvSingleSmartQuoteClose

EnvSingleSmartQuoteOpen

EnvSingleSmartQuoteState

EnvSingleSpaceInSentence

EnvSlideTitle

EnvTemplate

EnvTextChartType

EnvUseRegQuotesWithNumbers

EraseMarquee

ERROR

EXISTS

ExportBMP

ExportCGM

ExportEPS

ExportPCX

ExportTIFF

ExportWMF

F

FigureReturn

FigureReturnAll

File1Open

File2Open

File3Open

File4Open

FileClose

FILEERROR

FileExit

FILEFIND

FILEISEOF

FileOpen

FileOpenDlg

FILEPOSITION

FILEREAD

FileRetrieve

FileSave

FileSaveAs

FileSaveAsDlg

FILESIZE

FILETRUNCATE

FILEWRITE

FillAttributes

FillAttributesDlg

FindReplaceTextDlg

FloodFill

FOR-ENDFOR

FOREACH-ENDFOR

FORNEXT-ENDFOR

FRACTION

FUNCTION-ENDFUNC

FUNCTION PROTOTYPE

G

GalleryOptions

GalleryOptionsDlg

GetAttrDlg

GetAttributes

GETCURRENTDIRECTORY

GETFILEATTRIBUTES

GETFILEDATEANDTIME

GETNUMBER

GETSTRING

GETUNITS

GLOBAL

GO

GoToKeysDlg

GotoPositionDlg

Grammatik

GroupObjects

H

HardReturn

HelpCoachDlg

HelpHowDoI

HelpIndex

HelpKeyboard

HelpMacros

HelpTransition

HelpWhatIs

I

IF-ELSE-ENDIF

IFPLATFORM-ENDIFPLATFORM

INCLUDE

INDIRECT

InhibitInput

InsertFileDlg

INTEGER

InvertColors

IrregularCap

J

JustifyCenter

JustifyLeft

JustifyRight

K

KerningDlg

KeyboardCopy

KeyboardCreate

KeyboardEdit

KeyboardRename

KeyboardSelect

KEYSTRING

L

LABEL

LanguageDlg

LayoutGetNext

LayoutGetPrevious

LayoutNext

LayoutPrevious

LineAttributes

LineAttributesDlg

LineSpacingDlg

LOCAL

M

MacroFilePlay

MacroPause

MacroPlayDlg

MacroRecord

MacroStop

Mail

MailSystem1

MakeRuntime

MakeRuntimeDlg

MarkAsStaff

MasterGalleryDlg

MENU

MenuCopy

MenuCreate

MenuEdit

MENULIST

MenuRename

MenuSelect

MESSAGEBOX

MirrorObjectsHorizontally

MirrorObjectsVertically

MMPLAY

MMSPEAK

MMSPEAKCLIPBOARD

MMSTOPSPEECH

ModifyFigure

ModifyObjects

MOUSE STRING

MoveBackward

MoveForward

MoveSelectedSlides

MoveToBack

MoveToFront

N

NameLayoutDlg

NEST

NEWDEFAULT

NewDocumentDlg

NewDrawingCreate

NewPresentationCreate

NewPresentationDlg

NEXT

NormalText

NOTFOUND

NTOC

NUMSTR

O

ObexAddressBookDlg

ObexPollDlg

ObexPublishDlg

ObjectAreaSelect

ObjectMove

ObjectPointSelect

ObjectScale

ObjectSetFillBackground

ObjectSetFillForeground

ObjectSetFillPattern

ObjectSetFillState

ObjectSetFrameState

ObjectSetLineBackground

ObjectSetLineForeground

ObjectSetLinePattern

ObjectSetLineStyle

ObjectSetLineWidth

Ole20InsertObjectDlg

OleBrowseLinksDlg

OleChartCloseFile

OleChartExit

OleChartUpdateFile

OleCloseFile

OleExit

OleInsertfromFile

OleInsertObject

OlePlayInformation

OlePlaySettings

OleSaveAsDlg

OleUpdateFile

ONCANCEL

ONCANCEL CALL

ONDDEADVISE CALL

ONERROR

ONERROR CALL

ONNOTFOUND

ONNOTFOUND CALL

OPENFILE

OrgBoxOptionsDlg

OrgChartFontAttrsDlg

OrgChartFontDlg

OrgChartLayoutDlg

OutlineObject

OutlineRevealCodes

OverrideSlideDlg

P

PageColorDlg

PageFormatDlg

PaintBrush

PaintDropMarquee

PaintDropper

PaintEraser

PaintEscapeUndo

PaintMoveMarquee

PasteMarquee

PasteObject

PasteSpecialOle20Dlg

PAUSE

PERSIST

PERSISTALL

PlaySlideShow

PlaySlideShowDlg

PointerPosition

PRActivate

PreferenceBackupDlg

PreferenceDateTime

PreferenceDateTimeDlg

PreferenceEnvironmentDlg

PreferenceFormSettings

PreferenceKeyboardDlg

PreferenceLOFDlg

PreferenceMenuDlg

PreferencePageColor

PreferencePresentationDlg

PreferencePrintDlg

PreferencesDlg

PreferenceToolbarDlg

PrintDlg

PrintDocument

PROCEDURE-ENDPROC

PROCEDURE PROTOTYPE

PROMPT

PutAttributes

Q

Quick3D

Quick3DDlg

QuickCorrect

QuickCorrectAddItem

QuickCorrectDeleteItem

QuickCorrectDlg

QuickCorrectOptions

QuickWarp

QuickWarpDlg

QUIT

R

RealizeFontChanges

Redo

RedrawChart

RefreshScreen

REGIONADDLISTITEM

REGIONENABLEWINDOW

REGIONGETCHECK

REGIONGETSELECTEDTEXT

REGIONGETWINDOWTEXT

REGIONISVISIBLE

REGIONMOVEWINDOW

REGIONREMOVELISTITEM

REGIONRESETLIST

REGIONSELECTLISTITEM

REGIONSETCHECK

REGIONSETFOCUS

REGIONSETWINDOWTEXT

REGIONSHOWWINDOW

RENAMEDIRECTORY

RENAMEFILE

REPEAT-UNTIL

ReplaceMasters

ResetColorTable

RetrieveChartStyle

RetrieveColorPalette

RetrieveColorPaletteDlg

RetrieveFigure

RetrieveFigureDlg

RetrieveOutline

RetrieveStyleDlg

RETURN

RevealCodes

RotateObject

RotateObjects

RotateObjectsAroundAnchor

RotateObjectsDlg

RulerGridOptionsDlg

RUN

RunShowExpert

RunShowfile

S

SaveChartStyle

SaveColorPalette

SaveColorPaletteDlg

SaveFigureGalleryToWPG

SaveShowSlidesToWPG

SaveShowSlideToWPG

SaveStyleDlg

SaveWithEvenBorders

ScreenDown

SelectAllObjects

SelectBegOfLine

SelectDocBottom

SelectDocTop

SelectDown

SelectEndOfLine

SelectiveReplace

SelectLeft

SelectLikeObjects

SelectPrinterDlg

SelectRight

SelectScreenDown

SelectScreenUp

SelectTextChart

SelectUp

SelectWordLeft

SelectWordRight

SENDKEYS WAIT

SeparateObject

SetAirbrushDensity

SetAxisOptions

SetBackgroundName

SetBackgroundNameDlg

SetBarStyle

SetBitmapTransparency

SetBorder

SetBrushShape

SetBrushWidth

SetBulletColor

SetBulletDefinition

SetBulletLayout

SetChartAttrsBold

SetChartAttrsItalic

SetChartAttrsUnderline

SetChartFont

SetChartTitlePos

SetColorAttributes

SetConnector

SETCURRENTDIRECTORY

SetExplodeDistance

SETFILEATTRIBUTES

SETFILEDATEANDTIME

SetFontFace

SetFontGradient

SetFontOutline

SetFontPattern

SetFrameOptions

SetGradient

SetGridSnapOptions

SetGridTickOptions

SetHLOStyle

SetLabelOptions

SetLayoutSizes

SetLayoutTitle

SetLegendOptions

SetLevelFont

SetLevelGradient

SetLevelPattern

SetLineAttributes

SetLineSpacing

SetOrgChartBox

SetOrgChartLayout

SetOrgChartTop

SetPageNumbering

SetPaintMarquee

SetPaletteColor

SetPattern

SetPerspectiveOptions

SetPieLabelOptions

SetPieStyle

SetProportionalPies

SetRadarView

SetSeriesOptions

SetSlideCDAudio

SetSlideLinkFile

SetSlideLinks

SetSlideNotes

SetSlideOptions

SetSlideOverride

SetSoundControl

SetSoundOptions

SetTableBlend

SetTableSurfaceColor

SetTableSurfaceOptions

SetTemplateAll

SetTemplateCurrent

SetTemplateRange

SetTextChartBox

SetTextFillAttributes

SetTextLineAttributes

SetTitleString

SetViewOptions

ShadowAttributes

ShadowAttributesDlg

ShowBackground

ShowGrid

ShowLayout

ShowRuler

ShowSlide

ShowToolbar

SilhouetteObject

SingleSmartQuote

SingleSpaceInSentence

SizeObjectsAroundAnchor

SizeObjectsByLeftBottomDlg

SizeObjectsByLeftTopDlg

SizeObjectsByRightBottomDlg

SizeObjectsByRightTopDlg

SkewObject

SkewObjectsAroundAnchor

SkewObjectsAtBottomDlg

SkewObjectsAtLeftDlg

SkewObjectsAtRightDlg

SkewObjectsAtTopDlg

SlideCDAudioDlg

SlideFirst

SlideGetLast

SlideGetNext

SlideLast

SlideLayoutReApply

SlideNext

SlidePrevious

SlideSelect

SlideSetCurrent

SlideShowList

SlideShowOutline

SlideShowSlide

SlideShowSort

SlideTransitionsDlg

SnapToGrid

SortSpreadsheetData

SoundControlDlg

SoundOptionsDlg

SpaceObjectsHorizontally

SpaceObjectsVertically

SpeakerNotesDlg

SPEED

Speller

StretchObjectsAroundAnchor

StretchObjectsByBottomDlg

StretchObjectsByLeftDlg

StretchObjectsByRightDlg

StretchObjectsByTopDlg

STRLEN

STRNUM

STRPOS

STRUNIT

SUBCHAR

SUBSTR

SWITCH-ENDSWITCH

SwitchDocument

T

TemplateChartCreateDlg

TemplateDlg

TextAttributesDlg

TextBlock

TextBold

TextBoxCreate

TextChartNext

TextChartPrevious

TextDown

TextEditExit

TextFontDlg

TextInsertMode

TextItalic

TextKerning

TextLayoutBackTab

TextLayoutCenter

TextLayoutDoubleIndent

TextLayoutFlushRight

TextLayoutHangingIndent

TextLayoutIndent

TextLeft

TextLineCreate

TextReplace

TextRight

TextScreenTop

TextSearch

TextTab

TextToCurvesCmd

TextUnderline

TextUp

Thesaurus

TOLOWER

ToolbarCopy

ToolbarCreate

ToolbarDelete

ToolbarEdit

ToolbarRename

ToolbarSelect

TOUPPER

Type

U

UndeleteDlg

Undo

UNITSTR

UnselectAllObjects

USE

UseRegQuotesWithNumbers

V

VARERRCHK

ViewPrevious

W

WAIT

WHILE-ENDWHILE

WindowsCascade

WindowsTile

WordLeft

WordPerfectCharactersDlg

WordRight

WritingTool1

X

No index entries for this letter

Y

No index entries for this letter

Z

ZoomArea

ZoomIn

ZoomOut

ZoomPercent100

ZoomPercent150

ZoomPercent200

ZoomPercent50

ZoomPercent75

ZoomToBox

ZoomToDrawingArea

ZoomToObjects

ZoomToPage

ZoomToSlideShowSize


Concepts

     	Macro Basics

Macro concepts, variables, constants, operators, expressions, control statements, conventions, and hints

     	Macro Facility

WordPerfect's Macro Facility application

     	Creating Macros

Recording, playing, editing, and writing macros

     	Dialog Boxes

Dialog box controls, modal dialog boxes, modeless dialog boxes, and creating a dialog box

     	Coach Overview

Writing coaches

     	Assigning Macros

Assigning macros to a Toolbar, menu bar, or keyboard key

     	Macro Examples

MENU and ASSERT, callback functions, and Dynamic Data Exchange

     	Reserved Words

Words that cannot be user-defined

     	DDE Conversations

Using Dynamic Data Exchange to execute macro commands in another application


Additional Help

Glossary  Computer language definitions

Macros Included with Presentations  Macros included with Presentations 3.0

Print Topics  Print multiple Help topics

Presentations Help  Presentations 3.0 Help file


Print Topics

Purpose

You can print one or several Help topics.

Steps

To print a single Help topic,

1	Display the topic.

2	Choose the Print button at the top of the Help window.

or

Choose Print Topic from the File menu.

To print several topics,

1	Choose Print Topics from the File menu.

2	Choose from the following sequences of topics:

Presentations product commands A-B

Presentations product commands C

Presentations product commands D

Presentations product commands E-F

Presentations product commands G-N

Presentations product commands O-R

Presentations product commands S

Presentations product commands T-Z

Presentations system variables

Programming Commands

3	Select the topics you want to print.

4	Choose Print.

Each topic is printed one at a time.


Macros Included with Presentations

The following list contains a brief description of the macros that are included with Presentations 3.0.

Macro Name and Description

     	CHNGFNT.WCM

Changes the default fonts in a slide show.

     	MASTCONV.WCM

Converts Presentations 2.0 slide show masters to Presentations 3.0 format.

     	PALETTE.WCM

Formats a color palette for printing.


Reserved Words

You should not use reserved words as names for variables, arrays, labels, functions, or procedures.

A

ADDRESS

AND

ANSISTRING

APPACTIVATE

APPEXECUTE

APPEXECUTEEXT

APPLICATION

APPLOCATE

ASSERT

ASSERTCANCEL

ASSERTERROR

ASSERTNOTFOUND

ASSIGN

B

BEEP

BOOL

BREAK

C

CALL

CANCEL

CANCELCONDITION

CANCELOFF

CANCELON

CASE

CASEOF

CENTIMETERS

CHAIN

CHARLEN

CHARPOS

CLOSEFILE

COACHANIMATE

COACHFILTERADD

COACHFILTERDESTROY

COACHFILTERDISABLE

COACHFILTERENABLE

COACHGETREGIONINFO

COACHMESSAGEBOX

COACHMESSAGEBOXCLOSE

COACHPROMPT

COACHPROMPTCLOSE

COACHREMOVEDIALOGFILTER

COACHSETDIALOGFILTER

CONTINUE

COPYFILE

CREATEDIRECTORY

CTON

D

DDEEXECUTE

DDEEXECUTEEXT

DDEINITIATE

DDEPOKE

DDEREQUEST

DDETERMINATE

DDETERMINATEALL

DECLARE

DEFAULT

DEFAULTUNITS

DIGIT

DIMENSIONS

DISCARD

DIV

DLLCALL

DLLFREE

DLLLOAD

DOESDIRECTORYEXIST

DOESFILEEXIST

DWORDDDEEXECUTE

E

ELSE

ENDAPP

ENDFOR

ENDFUNC

ENDIF

ENDIFPLATFORM

ENDPROC

ENDPROMPT

ENDSWITCH

ENDWHILE

ERROR

ERRORCONDITION

ERROROFF

ERRORON

ERRORNUMBER

EXISTS

F

FALSE

FILE

FILEERROR

FILEFIND

FILEISEOF

FILEPOSITION

FILEREAD

FILESIZE

FILETRUNCATE

FILEWRITE

FOR

FOREACH

FORNEXT

FRACTION

FUNCTION

G

GETCURRENTDIRECTORY

GETFILEATTRIBUTES

GETFILEDATEANDTIME

GETNUMBER

GETSTRING

GETUNITS

GLOBAL

GO

H

HIWORD

I

IF

IFPLATFORM

INCHES

INCLUDE

INDIRECT

INPUT

INTEGER

L

LABEL

LENGTH

LETTER

LOCAL

LOWORD

M

MENU

MENULIST

MILLIMETERS

MOD

N

NEST

NEWDEFAULT

NEXT

NOT

NOTFOUND

NOTFOUNDCONDITION

NOTFOUNDOFF

NOTFOUNDON

NTOC

NUMSTR

O

OEMSTRING

OFF

ON

ONCANCEL

ONDDEADVISE

ONERROR

ONNOTFOUND

OPENFILE

OR

P

PAUSE

PERSIST

PERSISTALL

POINTS

POSITION

PROCEDURE

PROMPT

PROTOTYPE

Q

QUIT

R

REAL

REGIONADDLISTITEM

REGIONENABLEWINDOW

REGIONGETCHECK

REGIONGETSELECTEDTEXT

REGIONGETWINDOWTEXT

REGIONISVISIBLE

REGIONMOVEWINDOW

REGIONREMOVELISTITEM

REGIONRESETLIST

REGIONSELECTLISTITEM

REGIONSETCHECK

REGIONSETFOCUS

REGIONSETWINDOWTEXT

REGIONSHOWWINDOW

RENAMEDIRECTORY

RENAMEFILE

REPEAT

RETURN

RETURNCANCEL

RETURNERROR

RETURNNOTFOUND

RUN

S

SENDKEYS

SPEED

STRING

STRLEN

STRNUM

STRPOS

STRUNIT

SUBCHAR

SUBSTR

SWITCH

T

TOLOWER

TOUPPER

TRUE

U

UNITSTR

UNTIL

USE

V

VALUE

VARERRCHK

VARERRCHKOFF

VARERRCHKON

VOID

W

WAIT

WHILE

WORD

WPSTRING

WPUNITS

WP1200THS

X

XOR


Glossary

A

Active

ANSI Character Set

Application

Argument

ASCII Character Set

B

BIF (Binary Initialization File)

Bitmap

Button

C

Character Expression

Check Box

Choose

Click

Clipboard

Codes

Color Wheel

Command

Command Button

Compile

Conditional Statement

Control Menu

Control-Menu Box

Counter

CUA Keyboard

Current Cell, Current File, Current Table

Current Directory

D

DDE (Dynamic Data Exchange)

Default

Desktop

Dialog Box

Dialog Units

Directory

DOS

Double-Click

Drag

Driver

E

Edit Box

Enumerated Type

Extension

F

File

File Format

Filename

G

Group

I

INI File

Incrementing Button

Input Focus

Insertion Point

K

Kerning

L

Link

List Box

Loop

M

Macro

Macro Command

Measurement Expression

Memory

Menu

Message Box

N

Numeric Equivalent

Numeric Expression

O

OLE (Object Linking and Embedding)

Operator

P

Parameter

Path

Pixel

Point Size

Popup List

Port

Printer Driver

Product Prefix

Prompt

R

Radio Button

Relational Expression

Reveal Codes

Root Directory

Run-Time

S

Scroll

Scroll Bar

Select

Selection Cursor

Sizing Handle

Shared Code

Sort Key

Spreadsheet Import

Spreadsheet Link

Status Bar

Syntax

T

Text Box (Dialog Box)

Text File

Title Bar

Toggle

U

User-defined Dialog Box

V

Value Set Member

Variable

W

Wildcard

Window

Window Handle


Active

An application, window, or dialog box that is currently in use.  Windows highlights the caption bar or dialog frame.


ANSI Character Set

The 256 characters of the American National Standards Institute.  Used by WordPerfect for Windows.


Application

A software program, such as a word processing or spreadsheet program.


Argument

A variable, constant, or expression required by a command or function.


ASCII Character Set

The American Standard Code for Information Interchange is one of the standard formats for representing characters.  The ASCII character set contains 128 characters, which are the first 128 characters of the ANSI character set.


BIF (Binary Initialization File)

A file that contains run-time options for a WordPerfect application.  BIF replaces the standard text initialization files (INI) commonly used by Windows applications.


Bitmap

A graphics file format that represents images as a pattern of pixels (dots).


Button

A graphic representation of a command or option.


Character Expression (string)

One or more characters enclosed in quotation marks, which identifies the characters as text, not a variable.


Check Box

A graphic representation where the user turns an option on or off by selecting or deselecting the box.  An X in the box indicates the option is on.


Choose

To click a menu item or dialog box option that initiates an immediate action.  See Select.


Click

To press and release the mouse button.


Clipboard

An area of memory, also called a buffer, where text and commands can be stored for further action.  Clipboard contents are erased when you exit Windows.


Codes

Formatting commands that specify computer and printer functions.  Reveal Codes displays codes.


Color Wheel

A dialog box graphic where the user selects a color.


Command

An instruction given to a computer.


Command Button

A button in a dialog box which carries out an action OK, Exit, or Cancel.  A thick, dark border indicates the default button.


Compile

To translate program code into machine language and check for syntax errors.  The program automatically compiles macros the first time they are played.  Each time a macro is edited and saved, it must be recompiled before it can be played.


Conditional Statement

A statement created with macro programming commands such as IF and WHILE.  A conditional statement contains expressions such as text, numbers, or variables to be evaluated.  Macro execution can be affected by the "condition" of these expressions at the time they are evaluated.


Control Menu

The menu to open, close, maximize, minimize, or restore a window or dialog box.  To display a control menu, click the control-menu box or press Alt+Spacebar.


Control-Menu Box

A small rectangular button in the upper left corner of a window or dialog box.  Click a control-menu box to display the control menu; double-click to close the window or dialog box.  Several windows can be open at the same time, each with its own control-menu box.


Counter

A dialog box element where the user specifies values with incrementer and decrementer buttons.


CUA Keyboard

Common User Access (CUA) standard keyboard.  The Presentations 3.0 for Windows default keyboard is CUA compliant.


Current Cell, Current File, Current Table

The cell, document, or table where the insertion point is.


Current Directory

The directory where a file will be saved if you do not specify another.


DDE (Dynamic Data Exchange)

A connection between two files created by two different Windows applications that support DDE.  You can transfer information from one file to the other through the link.  If both files are open, transferred information can be updated automatically when information changes in the source file.


Default

A setting, value, or response provided by the application unless an alternative is specified.  You can change some Presentations defaults for all future documents in Preferences.  Other options change a default for the active document only.


Desktop

The screen background and environment for all Windows applications.


Dialog Box

A window that displays warnings and messages, and options for the user to select.  Dialog boxes have a title bar and a control menu, but not a menu bar.  They can be moved to different positions on the screen.  Most dialog boxes must be closed before you can work in the document window, but a few (such as Edit Toolbar) allow you to move between the window and the dialog box.


Dialog Units

A vertical unit that equals 1/8 the font height, or a horizontal unit that equals 1/4 the font width.  Dialog boxes are positioned and sized in dialog units.


Directory

A group of files or directories under one identifying title.

The root directory is the directory on a disk drive to which all other directories are related.

A default directory is where files are saved to or opened and retrieved from if you do not specify a pathname.  Not all features in Presentations have the same default directory; many defaults can be customized.

A directory tree is a diagram of how directories and subdirectories relate to each other.


DOS

Disk Operating System.  Software that directs the flow of data between disk drives and your computer.  An application needs an operating system to function.


Double-Click

To click the mouse button twice in rapid succession.


Drag

Press and hold down the left mouse button while moving the mouse.


Driver

A set of commands that runs a peripheral device such as a printer or monitor.


Edit Box

An element in a dialog box where a user can type text.


Enumerated Type (enum)

The parameters for some product commands accept only certain predefined words known as "enumerated types."  Enumerated types end with exclamation points and have numeric equivalents.  For example, DisplayMode parameter accepts only Text!, Graphics!, or FullPage!.


Extension

The optional three-letter identifier that may be added to any filename.


File

A document or other type of information saved under an identifying name.


File Format

The pattern in which a file is organized.  Each application creates documents in a unique format not accessible by other applications.  Those source documents must be converted to the new application’s format.


Filename

The name given to a file on disk.  The name may be up to eight characters long, with an  optional three letter extension, such as MYLETTER.ANN.


Group

A set of related options in a dialog box, often with its own subtitle.


INI File

A file that stores setup and startup information for Windows applications.


Incrementing Button

A button that lets you specify an amount by clicking the mouse instead of typing numbers.


Input Focus

The window or control receiving the keyboard or mouse action has input focus.  Controls include radio buttons, push buttons, and edit boxes.


Insertion Point

The blinking vertical bar in the current document window or dialog box.  It indicates where text will appear when you type.


Kerning

Increasing or decreasing space between a pair of characters.


Link

See DDE and Spreadsheet Link.


List Box

A dialog control that displays a list of mutually-exclusive items.


Loop

A set of programming commands that repeat.


Macro

A series of commands and keystrokes written and/or recorded in its own file to be compiled, then replayed as needed.


Macro Command

An instruction for Presentations to carry out.  The instruction can be in the form of a programming command or a product command.  Many macro commands must be used together with other macro commands to be successful in giving a complete instruction.


Measurement Expression

A number followed by a unit of measure (", i, c, m, p, w).


Memory

The temporary data storage area for a computer or printer.


Menu

A list of commands that can be applied to the active window or application.


Message Box

A dialog box that displays information, a warning, or error message, or asks for confirmation before completing a command.


Numeric Equivalent

The number that represents an enumerated type.


Numeric Expression (numeric)

A number on which mathematical operations may be performed.  Numeric expressions are not enclosed in quotation marks.


OLE (Object Linking and Embedding)

A feature that copies information from one document to another (embedding), through a "live" link.  When the original document changes, the embedded copy reflects the changes.


Operator

A symbol or word that performs a function on one or more expressions.  Operators compare expressions, link words together, and perform mathematical functions.


Parameter

Contains data to pass to the compiler or pass between subroutines.


Path

The location of a certain file or directory in a computer disk drive or on a network.  A path includes the drive, the root directory, and any subdirectory names.  Each name is separated by a backslash (\).  For example, C:\PRWIN30\SLIDES refers to the SLIDES subdirectory in the PRWIN30 directory on the C drive.


Pixel

The smallest unit of display on a computer screen.


Point Size

The unit of measure for font sizes.  One point equals 1/72".


Popup List

A list of options displayed when a popup button is clicked.  Most popup buttons are marked by double triangles and display mutually exclusive options.  The button itself shows the selected option.  Other popup lists, marked by single triangles, show the feature name rather than the selected option.  On the ruler bar, popup list buttons have no triangular markings.  Some display the selected option and others display the feature name.


Port

A connection device between a computer and another component such as a printer or modem.


Printer Driver

Software commands that enable an application to communicate with a printer.


Product Prefix

A two-character expression that specifies a product for a macro command.


Prompt

A message box that displays information for the user.


Radio Button

Represents one item in a list of mutually exclusive options.


Relational Expression

An expression that evaluates parameters with only two possible states: TRUE and FALSE.


Reveal Codes

A feature that displays text and formatting codes in the document window.


Root Directory

See Directory.


Run-Time

Execution time.  Run-time errors occur during macro execution.  Run-time options are application start-up settings, such as the macros default directory.  See BIF.


Scroll

To move through a document or list box by using the scroll bar.


Scroll Bar

The vertical or horizontal bar in a document and in some list boxes that allows you to move through a document or list by clicking the scroll arrows or dragging the scroll box (thumb).


Select

To identify a file, directory, graphics box, or area of text that will be affected by subsequent choices; to identify a dialog box option to be applied to a file, directory, graphics box, or area of text.


Selection Cursor

The highlighted text, dotted rectangle, or insertion point that indicates where the next keystroke or mouse action will apply in a dialog box.


Sizing Handle

The small solid squares that appear on the borders of a selected graphics box.  Drag handles to size the box and its contents.


Shared Code

Programming code used by WordPerfect Windows applications.


Sort Key

Words, fields, or phrases that define sort criteria.


Spreadsheet Import

Copies information from a spreadsheet file into a Presentations document one time only.  You cannot update a spreadsheet import like you can update a spreadsheet link.


Spreadsheet Link

A connection to transfer information between a spreadsheet file and a Presentations document.  You can update transferred information to reflect changes made in the spreadsheet file.  See DDE.


Status Bar

The line at the bottom of the Presentations window that lists the current font and the position of the insertion point.  The status bar also displays some Presentations messages and features.


Syntax

The order in which parts of a command are organized.  Macro commands require a specific syntax to function properly.


Text Box (Dialog Box)

The area in a dialog box where you type text or where Presentations types text for you.  The insertion point must be in the text box before you can begin to type.


Text Box (Graphics)

A type of graphics box for placing and rotating text.


Text File

A file saved in ASCII (DOS) or ANSI (Windows) file format.  It contains text, spaces, and returns, but no formatting codes.


Title Bar

The area of a window or dialog box that displays its title.


Toggle

To switch between on or off; or, a feature or option that is turned on or off with the same keystroke or command.  Toggle commands usually do not require parameters.


User-defined Dialog Box

A custom dialog box created with DIALOG programming commands that display options for user input.


Value Set Member

Words specified for acceptance by certain parameters.  Each value set member ends with an exclamation point (!).  Every value set member has a numeric equivalent.


Variable

One or more characters that represent data that can change during macro execution.


Wildcard

Characters that represent variables in a word, file, or directory search.  A question mark (?) represents a single character.  An asterisk (*) represents zero or more characters in succession.


Window

Each window has a title bar, a menu bar, and a status bar, and may contain a scroll bar, Toolbar, and Ruler.  The Equation Editor window has separate editing and display areas called panes.


Window Handle

A unique identifier for a window or control.


Macro Basics

This section discusses the main statement types used to write a macro: assignments, conditions, loops, comments, and commands.  See Macro Language Concepts for brief descriptions, and see Variables, Constants, Operators, and Expressions, and Macro Control Statements for detailed descriptions and examples.

Macro Language Concepts

Variables, Constants, Operators, and Expressions

Macro Control Statements

Conventions and Macro Hints


Macro Language Concepts

This section introduces macro concepts.  Begin here if you are new to macro writing, or skip to the command index sections if you are an experienced macro writer.  The topics below are presented in detail in Variables, Constants, Operators, and Expressions, and in Macro Control Statements.

Presentations' command-based macro language consists of commands that, when compiled, perform tasks.  For example, the AboutDlg command displays the About Presentations dialog box.  You can combine commands in macros to automate routine tasks and simplify large ones.  The following topics introduce macros:

Macros

Assignment Statements

Variables

System Variables

Conditional Statements

Loop Statements

Comment Statements

Command Statements

Command Name

Parameters

Product Commands

Programming Commands

Syntax

Subroutines

Compilers


Macros

Automate Presentations tasks, such as setting the page size, selecting a drawing tool, or creating a new slide show file.  Macro tasks consist of instructions called statements.  Statements can be assignments, conditions, loops, comments, or commands.  For example,

AddSlide (Count: 3)

BeginCircle ()

The first command adds three slides to the current slide show, and the second activates the Circle drawing tool (the tasks).  Each command represents one instruction or statement.

The simplest macro consists of only one statement.  Complex macros have hundreds of statements.  The sequence of statements determines how a macro performs its tasks.


Assignment Statements

Assign the value of an expression to a variable.

x := "John Doe"

Result: x equals John Doe

y := 5

Result: y equals 5

z := 3 + 4

Result: z equals the result of 3 + 4

The assignment operator (:= or =) assigns the value of a right operand expression to a left operand variable.  You can also assign values to variables using the ASSIGN programming command.


Variables

Represent data that can change during macro play.  Data may include any type of expression, but only one expression at a time.  Variable names are user defined, are not case sensitive, must begin with a letter, can include any other combination of letters or numbers, and are limited to 50 characters.  For example, if you assign the number 50 to variable vPixel, the following command sets Air Brush density to 50 pixels:

SetAirbrushDensity (AirbrushDensity: vPixel)

The lowercase v in vPixel is an optional convention to identify variables.  For more information, see Variables in Variables, Constants, Operators, and Expressions.


System Variables

Contain current system information such as the current chart type or the default directory.  System variables are defined by Presentations and begin with Env, because they return information about the application environment.  For example,

vMacroPath: = EnvPaths (Macros!)

assigns the path and name of the default macros directory to a variable named vMacroPath.  If you change the directory, the system variable EnvPaths is updated to reflect the change.


Conditional Statements

Play a statement or group of statements (statement block) when a specified condition is met.  If a macro displays a list of options, it plays a statement block depending on which option the user chooses.  Conditional statements include CASE, IF, IFPLATFORM, and SWITCH.  For more information, see Using Conditional Statements.


Loop Statements

Play a statement or statement block a specified number of times, until an expression is true or while an expression is true.  The macro then exits the loop and continues to the next statement.  Loop statements include FOR, FORNEXT, FOREACH, REPEAT, and WHILE.  For more information, see Using Loop Statements.


Comment Statements

Contain notes and other information that do not affect macro play.  Use comment statements to explain the purpose of your macro, describe its components, or to prevent a statement from playing.  Comment statements help if you have to modify a macro months after it is written, or they help if someone else has to understand your macro.  A comment begins with // and ends with a hard return [HRt].  See // (Comment).


Command Statements

Consist of a name, and optionally one or more parameters.  Commands represent instructions to the parent application.


Command Names

Often describe an action, such as AlignObjectsLeft, BitmapBlur, SelectAllObjects, and ToolbarCopy.  Command names are not case sensitive and usually do not contain spaces.  Exceptions include programming commands that call a subroutine, such as CASE CALL or ONCANCEL CALL (see Using Subroutines).

A macro can use more than one application.  Commands to the non-default application require a product prefix, which is specified in an APPLICATION statement.  In this example,

A1.AboutDlg ()

A1 (followed by a period) is the product prefix.  It tells the compiler what application to use.  See Compilers and APPLICATION.


Parameters

Contain a constant value (data) that is passed to the compiler or between subroutines.  In this example,

AddSlide (Count: 3; TemplateName: "Title")

AddSlide is the command name, and 3 and "Title" are parameter data.  This command adds three slides with the Title template to the current slide show.  Parameter names, such as Count and TemplateName, are optional.

A parameter set begins with an open parenthesis and ends with a closed parenthesis.  Multiple parameters are separated with a semicolon.  Some commands have no parameters, and others have many.  Parentheses are optional for commands with no parameters but must be used with  user-defined functions and procedures (see Using Subroutines).

Repeating parameters begin with an open brace ({), end with a closed brace (}), and are separated with a semicolon.  For example, MENU may list up to twenty-six items.  The following example lists only three:

MENU(vChoice; Digit; 10; 10; {"Item 1"; "Item 2"; "Item 3})


Product Commands

Perform product tasks in a specific application.  For example,

ShowSlide(Slide: 4)

displays the fourth slide in the current slide show in Presentations 3.0.


Programming Commands

Direct the play of a macro and are not specific to an application.  For example,

IF(x = "A")

    ColorAttributesDlg

ELSE

    LineAttributesDlg

ENDIF

displays the Color Attributes dialog box if x equals the value A, or displays the Line Attributes dialog box if x has any other value.  IF, ELSE, and ENDIF are programming commands.  ColorAttributesDlg and LineAttributesDlg are product commands.

In Help, programming commands appear in uppercase, product commands in mixed case.  However, product and programming commands are not case sensitive.


Syntax

Refers to rules that govern the form of macro statements and expressions.  For example,

Type(Text: "John Doe")

types John Doe.  The next example,

Type(Text: "John Doe"

lacks a closing parenthesis.  The syntax is not correct and produces an error message.  See Macro Errors for common syntax errors.


Subroutines

Consist of a statement or group of statements (statement block) that are played when the subroutine is called (see Using Calling Statements .  Subroutines include functions, procedures, and labels.

CALL(SubExample)

...(other statements)...

LABEL(SubExample)

   ...statement block...

   RETURN

Explanation: The calling statement CALL(SubExample) calls (directs macro play to) the subroutine LABEL(SubExample).  RETURN directs macro play to the statement that follows CALL(SubExample).  Statements in a subroutine are accessible to any part of a macro, and can be called any number of times during play.  See Using Calling Statements and Using Subroutines.


Compilers

A computer's central processing unit (CPU) plays instructions written in machine (computer) language.  Machine language consists of binary digits (bits) 0 and 1.  For example, the first three letters of the alphabet in binary notation are 1000001, 1000010, and 1000011.  The binary result of 4 + 5 is 1001.  Because binary digits are hard to work with, English-based programming languages (such as Basic, Pascal, and C) were created.  Programs are written with the help of an editor or word-processor and saved as source files.  Compilers create object files, which are copies of source files translated into machine language.  Computers can play only object files.

Macro languages are similar to programming languages.  Macros are written with an editor or word-processor and saved as source files.  When Macro Facility compiles a source file, however, it does not create a separate object file.  Instead, it saves the object in the source file header where you cannot see it.  When you edit a source file, you must recompile it to update the object.  Presentations can play only a source file with an up-to-date object.  A compiled source file, or macro, contains instructions Macro Facility interprets and sends to the appropriate application when you play the macro (see Play a Macro).


Variables, Constants, Operators, and Expressions

Variables and constants are joined by operators to form expressions.  Expressions often compute values that determine how control statements direct macro play (see Macro Control Statements).

Variables

Constants

Operators

Expressions


Variables

Point to a memory cell where data is stored.  The variable name represents the data's address or location.  An address can store only one data item at a time, which can be of any type and can change during macro play.  Use the programming commands DECLARE, LOCAL, GLOBAL, or PERSIST to declare variables (see below).

Adjacent memory cells, associated by a name, are called an array.  Use DECLARE, LOCAL, GLOBAL, or PERSIST programming commands to declare an array name and the number of cells, or elements, associated with it (see below).  Assign a value to an array element in the same way you assign a value to a variable.  For example,

DECLARE Test[10]

ASSIGN(Test[1]; 5)

creates a 10-element array named Test, and assigns 5 to element 1.  Array elements can contain different data types, such as numbers or character strings.  See DECLARE for array examples.

     	A run-time error occurs if you reference a variable or array element that has not been assigned a value.

Variable and array names are user defined, are not case sensitive, must begin with a letter, can include any combination of letters or numbers, and are limited to 50 characters.  The following examples assign a right operand expression to a left operand variable (variable can also be an array element):

x := "John Doe"

Result: x equals John Doe (character string)

vLeftMargin := 5i

Result: vLeftMargin equals 5i (measurement expression)

ResultOfOperation := 3 + 4

Result: ResultOfOperation equals 7 (numeric expression)

z := z + 1

Result: z equals the value of z + 1 (Because a variable can contain only one value at a time, the original value of z is lost unless previously assigned to another variable.)

x := y > 1

Result: x equals the result of relational expression y > 1 (x equals True if y contains a value greater than 1, or False if y contains a value less than or equal to 1.  True and False are Boolean data that represent numeric constants 1 and 0.)

The following example evaluates the result of y > 1, without assigning the result to a variable.  The computer beeps if the value of y is greater than 1 (if the result of expression y > 1 equals True).  The first statement after ENDIF is played if the value of y is less than or equal to 1 (if the expression result equals False).

IF(y > 1)

    BEEP

ENDIF

Variable Programming Commands

DECLARE

GLOBAL

INDIRECT

LOCAL

PERSIST

Special Variables

MacroDialogResult

ErrorNumber


INDIRECT

Creates a variable name out of a combination of character strings and/or numbers.  See the programming command INDIRECT.  You can use INDIRECT wherever you can use a variable.

INDIRECT can also create a LABEL name out of a combination of character strings and/or numbers.  See Using Subroutines.


LOCAL

Creates local variables and arrays (they only pertain to the current macro).  Variables declared in user-defined functions and procedures are local to those subroutines.  When you create a variable by assigning it a value, the variable is automatically declared Local (see the programming command LOCAL).


GLOBAL

Creates variables and arrays that pertain to the current macro and to macros called by RUN or CHAIN (see the following programming commands: CHAIN, GLOBAL, and RUN).


PERSIST

Creates variables and arrays that pertain to any Shared Code macro as long as Shared Code is running (see the following programming commands: PERSIST and PERSISTALL).


DECLARE

Creates local variables and arrays (they only pertain to the current macro).  An array can have up to 10 dimensions, and up to 32,767 elements per dimension depending on the amount of available memory (see the programming command DECLARE).


MacroDialogResult

An implicit variable (one defined by the application) that contains the Control value of the button that dismisses a dialog box.  See Creating a Dialog Box with Macro Commands and DIALOGDEFINE.


MacroArgs

A special array variable that contains values passed to it by CHAIN, NEST, or RUN.  For example,

// Macro: MAIN.WCM

// Include full path if macro not in default macros directory

RUN("TSTMACRO"; {"x"; "y"; "z"})

// Macro: TSTMACRO.WCM

// Compile, then play MAIN.WCM

vElements = DIMENSIONS(MacroArgs[]; 0)

IF(vElements != 0)

FORNEXT(x; 1; vElements; 1)

MESSAGEBOX(z; "Element Values";

"MacroArgs[" + x + "] = " + MacroArgs[x])

ENDFOR

ELSE

BEEP

MESSAGEBOX(z; "Error"; "No values passed"; IconExclamation!)

ENDIF

Result: x y z


ErrorNumber

A special variable that contains the error value of a Cancel, Error, or Not Found condition.  See ASSERT and the ASSERT.WCM example (line 44).


Constants

Represent data items that cannot change during macro play.  For example,

SWITCH(x)

CASEOF 1: CALL(Start)

CASEOF 2: CALL(Stop)

ENDSWITCH

contains two CASEOF statements, followed by numeric constants 1 and 2.  If variable x equals 1, a subroutine named Start is called.  If x equals 2, a subroutine named Stop is called.

See Also

Using Conditional Statements

SWITCH


Operators

Macros support the following operators:

Unary Operators

Binary Operators

Arithmetic Operators

Relational Operators

Logical Operators

Bitwise Operators

See Also

Operator Precedence


Unary Operators

Symbols or words that represent an operation on only one operand or expression.

Operator	Action

+	Multiplies an operand by +1

_	Multiplies an operand by -1

NOT	Inverts the result of relational and logical expressions

Unary plus/minus (+/-) examples

NOT example

NOT example in an IF statement

NOT example in shorthand notation


Unary plus/minus (+/-) examples

+5

Result: +5 is the result of 5 * +1.

-10

Result: 10 is the result of 10 * 1.


NOT example

x := 5

y := (x < 10)

z := NOT(x < 10)

Explanation: True is assigned to y (x is less than 10).  False is assigned to z (inverted result of expression x < 10).


NOT example in an IF statement

x := 5

z := (x < 10)

IF(NOT(z))

BEEP

ELSE

QUIT

ENDIF

Explanation: The result of expression x < 10 is assigned to variable z.  BEEP causes the computer to beep if the inverted value of z equals True.  Because the inverted value of z equals False, there is no beep, and the ELSE statement is played. QUIT ends the macro.


NOT example in shorthand notation

x := 5

IF(NOT(x < 10))

BEEP

ELSE

QUIT

ENDIF

Explanation: IF instructs the computer to beep if the inverted result of expression x < 10 equals True.  Because the result of NOT(x < 10) equals False, there is no beep and the ELSE statement is played.  Quit ends the macro.

Previous example without NOT operator

x := 5

IF(x > 10)

BEEP

ELSE

QUIT

ENDIF

Explanation: If the result of expression x > 10 equals True, beep.  Because the result equals False (the value of x is less than 10), the ELSE statement is played.  QUIT ends the macro.


Binary Operators

Symbols that represent an operation on two operands or expressions.  For example,

x := 3 + 4

contains a plus operator (+) which adds the operands 3 and 4.  The assignment operator (:=) assigns the result of the arithmetic expression 3 + 4 to variable x.

The binary operators are:

Arithmetic Operators

Relational Operators

Logical Operators

Bitwise Operators


Arithmetic Operators

Symbols or words that represents a mathematical operation on two operands.

Operator	Action

*	Multiplication

/	Division

_	Subtraction

+	Addition

%	Floating point modulus division (returns floating point division remainder)

MOD	Integer modulus division (returns integer division remainder)

DIV	Integer division (returns integer portion of integer division)

Floating point (%) examples

MOD examples

DIV examples

See Also

Arithmetic Expressions


Floating point (%) examples

x:=10.1 % 3

Result: x equals 1.1.

x := 9 % 3

Result: x equals 0.


MOD examples

x := 10 MOD 3

Result: x equals 1.

x := 10.1 MOD 3

Result: error (cannot use MOD on real numbers).


DIV examples

x := 10 DIV 3

Result: x equals 3.

x := 9 DIV 3

Result: x = 3.

x := 9.1 DIV 3.5

Result: error (cannot use DIV on real numbers).


Relational Operators

Symbols that represent a relational operation on two operands.  The operation result equals True or False.

Operator	Action

>	Greater than

>=	Greater than or equal to

<	Less than

<=	Less than or equal to

=	Equal to

<>	Not equal to

Greater than (>) and less than (<) examples

Not equal (<>) example

Greater than or equal to (>=) example

Less than or equal to (<=) example

See Also

Relational Expressions


Greater than (>) and less than (<) examples

x := 10

z := (x > 5)

Result: z equals True (x is greater than 5).

z := (x < 5)

Result: z equals False (x is not less than 5).


Not equal (<>) example

x := 10

z := (x <> 5)

Result: z equals True (x is not equal to 5).


Greater than or equal to (>=) example

x := 10

IF(x >= 10)

BEEP

ELSE

QUIT

ENDIF

Explanation: The computer beeps because the result of expression x >= 10 equals True (x equals 10).  The ELSE statement is skipped.  QUIT does not end the macro.


Less than or equal to (<=) example

x := 20

IF(x <= 10)

BEEP

ELSE

 QUIT

ENDIF

Explanation: The computer does not beep because the result of expression x <= 10 equals False (x is greater than 10).  The ELSE statement is played.  QUIT ends the macro.


Logical Operators

Words that represent a logical relationship between conditions, or that invert a condition.  The condition is the result of a relational expression.  The operators are listed in order of precedence.

Operator	Action

NOT	NOT is a unary operator that inverts the result of a relational expression.

AND	Combines two relational expressions.  Each expression must be true for the logical expression to be true.

XOR	Combines two relational expressions.  Only one expression can be true for the logical expression to be true.  If both are true or both are false, the logical expression is false.  The XOR operator is also named exclusive OR.

OR	Combines two relational expressions.   Only one expression need be true for the logical expression to be true.  The OR operator is also named inclusive OR.

NOT example

AND example

XOR example

XOR example in shorthand notation

OR example

See Also

Logical Expressions


NOT example

x := 8

IF((x < 10) AND NOT (x = 5))

BEEP

ENDIF

Explanation: The result of the logical expression equals True (x is less than 10 AND NOT x is equal to 5, or x is not equal to 5).


AND example

x := 1

y := 2

z := ((x = 1) AND (y = 2))

Result: z equals True (the logical AND expression is true because the relational expressions x = 1 and y = 2 are true).


XOR example

x := 1

y := 2

z := ((x = 0) XOR (y = 2))

Result: z equals True (only one relational expression is true).

z := ((x  = 1) XOR (y = 2))

Result: z equals False (both relational expressions are true).

z := ((x = 0) XOR (y = 1))

Result: z equals False (both relational expressions are false).


XOR example in shorthand notation

x := 1

y := 2

IF((x = 0) XOR (y = 2))

 BEEP

ENDIF

Explanation: The result of the logical XOR expression equals True because relational expression x = 0 is false and relational expression y = 2 is true.


OR example

x := 1

y := 2

z := ((x = 1) OR (y = 5))

Result: z equals True (the logical OR expression is true because relational expression x = 1 is true).


Bitwise Operators

Symbols that represent a bitwise operation on two integer operands.  The operators are listed in order of precedence.

Operator	Action

~	Bitwise unary NOT (complement of 1) toggles a binary value (1 to 0, and 0 to 1).

&	Bitwise AND results in 1 if both operand bits are 1, and results in 0 if both operand bits are not 1.

|	Bitwise inclusive OR results in 1 if both operands are 1 or operands do not match.  Results in 0 if both operands are 0.

^	Bitwise exclusive OR (XOR) results in 0 if operands match, and 1 if operands do not match.

<<	Shift bits left.

>>	Shift bits right.

Unary NOT (~) example

AND (&) example

Inclusive OR (|) example

Exclusive OR (^) example

Shift left (<<) example

Shift right (>>) example

See Also

Bitwise Expressions


Unary NOT (~) example

DEC	BIN

~-15	1111111111110001

___	________________

14	0000000000001110

Explanation: Bitwise unary NOT toggles bits from 1 to 0 and from 0 to 1.


AND (&) example

DEC	BIN

1000	1111101000

&31	0000011111

____	__________

8	0000001000

Explanation: Bitwise AND turns off bits (result is 0) if one operand is 0.  Bits are left on (result is 1) if both operands are 1.


Inclusive OR (|) example

DEC	BIN

1000	1111101000

|27	0000011011

____	__________

1019	1111111011

Explanation: Bitwise OR turns on bits (result is 1) if one operand is 1.  Bits are left off (result is 0) if both operands are 0.


Exclusive OR (^) example

DEC	BIN

1000	1111101000

^40	0000101000

____	__________

960	1111000000

Explanation: Bitwise XOR turns on bits (result is 1) if the operands are different.  It turns off bits (result is 0) if the operands are the same.


Shift left (<<) example

DEC	BIN

500	0111110100

<<1	0000000001

____	__________

1000	1111101000

Explanation: Shifts bits one position left, and inserts one 0 bit at the right end of the binary numeral.  Multiplies the original value by 2.


Shift right (>>) example

DEC	BIN

1000	1111101000

>>1	0000000001

____	__________

500	0111110100

Explanation: Shifts bits one position right, and inserts one 0 bit at the left end of the binary numeral.  Divides the original value by 2.


Operator Precedence

The following table shows operator precedence, which is applied to expressions with two or more operators.

Precedence	Operators

1	parentheses (), unary minus (-), unary plus (+), bitwise not (~), logical not (NOT)

2	multiply (*), divide (/), modulus division (% or MOD), integer division (DIV)

3	add (+), subtract (-)

4	shift left (<<), shift right (>>)

5	less than (<), less than or equal to (<=), greater than (>), greater than or equal to (>=), not equal (<>), equal (=)

6	bitwise and (&), bitwise or (|), bitwise xor (^)

7	logical and (AND), logical xor (XOR)

8	logical or (OR)

The following rules apply to operators:

     	Operators with the same precedence are evaluated from left to right.

     	Operators inside parentheses are evaluated before operators outside parentheses.

     	Operators inside nested parentheses are evaluated from the innermost parentheses out.

Operator Precedence Examples


Operator Precedence Examples

x := ((50 * 5 + 50) * 3 + 100)

Result: x equals 1000 (50 * 5 = 250, 250 + 50 = 300, 300 * 3 = 900, 900 + 100 = 1000)

x := ((50 * (5 + 50)) * 3 + 100)

Result: x equals 8350 (5 + 50 = 55, 55 * 50 = 2750, 2750 * 3 = 8250, 8250 + 100 = 8350)

x := ((50 * 5 + 50) * (3 + 100))

Result: x equals 30900 (50 * 5 = 250, 250 + 50 = 300, 300 * 103 = 30900)


Expressions

Macros support the following expressions:

Numeric Expressions

Measurement Expressions

Character Expressions

Arithmetic Expressions

Relational Expressions

Logical Expressions

Bitwise Expressions

See Also

Radix Base Conversions


Numeric Expressions

Numeric constants or variables, or a combination of the two joined by a numeric operator.  A numeric operator is a word or symbol that operates on numeric data (see Unary Operators and Binary Operators).

Given that x equals 3, the following examples are valid numeric expressions:

5

Explanation: Numeric constant.

x

Explanation: Variable containing a numeric value.

x * 5

Explanation: Expression (multiply x and 5).  The expression x * 5 is also an arithmetic expression.

+5

Explanation: Unary plus constant.

-(x + 10)

Explanation: Unary minus expression (negate the result of x plus 10).


Measurement Expressions

Constants or variables containing a measurement value, or combination of the two joined by a numeric operator.

Given that z equals 4i (inches), the following examples are valid measurement expressions:

5c

Explanation: Constant (5 centimeters).

z

Explanation: Variable that contains a measurement value of 4 inches.

z * 10i

Explanation: Expression (multiply z and 10 inches).

-z

Explanation: Unary minus (negative 4 inches).

The valid units of measure are:

Unit of Measure	Measurement Type

"	inches

i	inches

c	centimeters

m	millimeters

p	points (72 per inch)

w	WP unit (1200 per inch)


Character Expressions

Character constants (letter, digit, or keyboard symbol) or variables.  A character expression can also be a combination of the two concatenated by the plus operator (+) or compared by a relational operator such as > (greater than).  Character constants and character constants assigned to variables must be enclosed in double quotation marks.

Enclose a character constant in single quotation marks to specify an ASCII numeric value (see CTON).  For example,

x := 'A'

Result: x equals 65.

x := 'A' + 'B'

Result: x equals 131 (65 + 66).

A character string with double quotation marks is enclosed with two sets of double quotation marks.  For example,

x := "His name is ""John"" Doe"

Result: x equals His name is "John" Doe.

x := """John Doe"""

Result: x equals "John Doe" (outside quotation marks are always required).

The following examples are valid character expressions (notice the space after Joe and before Jr.).

"John Doe"

Explanation: Character string.

z := "Joe " + "Doe"

Explanation: Expression assigned to variable z (z equals John Doe).

x := z + ",  Jr."

Explanation: Expression assigned to variable x (x equals John Doe, Jr.).

If you concatenate a character string and a number, the number is converted to a character string.  If you concatenate a numeric character and a number, the numeric character is converted to a number and the two are added.

x := "A" + 1

Result: x equals A1 (character string).

x := "1" + 1

Result: x equals 2 (number).

x := ("A" + (1 + 3))

Result: x equals A4 (the result of a mathematical operation (1+3=4) converted to a character string before being concatenated to A).

Compare the previous example with the following examples (operation precedence is left to right):

x := ("A" + 1 + 3)

Result: x equals A13 (character string--numbers converted and not added).

x := (1 + 3 + "A")

Result: x equals 4A (character string--numbers added and then converted to a character string).


Arithmetic Expressions

Statements that represent arithmetic operations, or statements that contain two operands joined by an arithmetic operator.  The operation result is a numeric value.

x := 1 + 2

Result: x equals 3.

x := 3 * 3

Result: x equals 9.

x := "2" * 3 * 4

Result: x equals 24 (2 converted to a number then multiplied).

x := "A" * 2

Result: error (cannot multiply letters and numbers).

See Also

Arithmetic Operators


Relational Expressions

Statements that represents a relational operation, or statements that contains two operands joined by a relational operator.  The operation result equals True or False.

Given that x equals 5,

z := (x > 6)

Result: z equals False (5 is less than 6).

z := (x >= 5)

Result: z equals True (5 equals 5).

z := ("Ab" > "Bb")

Result: z equals False (Ab is less than, or comes before, Bb).

z := ("Ab" <> "Bb")

Result: z equals True (Ab is not equal to Bb).

Given that x equals "A", y equals "B", and z equals "a", the following expressions return True or False in variable w:

w := (x > y)

Result: w equals False (uppercase A is less than, or comes before, uppercase B).

w := (x > z)

Result: w equals True (uppercase A is greater than, or comes after, lowercase a).

See Also

Relational Operators


Logical Expressions

Statements that represent logical operations, or statements that contains two relational expressions joined by a logical operator.  The operation result equals True or False.

Given that x equals 10, y equals 5, and z equals 20, the following expressions return True or False in variable w:

w := ((x > y) AND (y < z))

Result: w equals True (both relational expressions are true).

w := ((x < y) AND (y < z))

Result: w equals False (first relational expression is false).

w := NOT(y > z)

Result: w equals True (5 is not greater than 20).

w := ((x > 5) AND (y < 20) AND (z = 20))

Result: w equals True (all relational expressions are true).

w := (((x < 5) AND (y > 20)) OR (z = 20))

Result: w equals True (z = 20 is true).

w := (((x < 5) AND (y > 20)) OR NOT (z = 20))

Result: w equals False (all relational expressions are false).

See Also

Logical Operators


Bitwise Expressions

Statement that represent bitwise operation, or statements that contain two operands joined by a bitwise operator.

Bitwise NOT (~) example

Bitwise AND (&) example

Bitwise inclusive OR (|) example

Bitwise XOR (^) example

Bitwise shift left (<<) example

Bitwise shift right (>>) example

See Also

Bitwise Operators


Bitwise NOT (~) example

x := ~(-15)

Result: x equals 14 (complement of 1).

x := ~(-15) + 1

Result: x equals 15 (complement of 2).


Bitwise AND (&) example

x := 65535 & 535

Result: x equals 535.

Previous example in binary notation

1111111111111111	(binary 65535)

&0000001000010111	(AND binary 535)

________________

0000001000010111	(result is binary 535)

Explanation: Bitwise AND operation result is 1 if both operands are 1, or 0 if both operands are not 1.


Bitwise inclusive OR (|) example

x := 65535 | 535

Result: x equals 65,535.

Previous example in binary notation

1111111111111111	(binary 65535)

|0000001000010111	(OR binary 535)

________________

1111111111111111	(result is binary 65535)

Explanation: Bitwise OR operation result is 1 if one operand is 1, or 0 if both operands are 0.


Bitwise XOR (^) example

x := 65535 ^ 535

Result: x equals 65,000.

Previous example in binary notation

1111111111111111	(binary 65535)

^0000001000010111	(XOR binary 535)

________________

1111110111101000	(result is binary 65,000)

Explanation: Bitwise XOR operation result is 0 if both operands are 0 or 1, or 1 if operands do not match.


Bitwise shift left (<<) example

x := 65535 << 1

Result: x equals 131,070.

Previous example in binary notation

1111111111111111  (binary 65535)

________________

<<1111111111111110  (result is binary 131,070)

Explanation: Bitwise shift left operator shifts bits one position left, and inserts one 0 bit at the right end of the binary numeral.  The result is the original value multiplied by 2.


Bitwise shift right (>>) example

x := 65535 >> 1

Result: x equals 32,767.

Previous example in binary notation

1111111111111111  (binary 65535)

________________

<<0111111111111111  (result is binary 32,767)

Explanation: Bitwise shift right operator shifts bits one position right, and inserts one 0 bit at the left end of the binary numeral.  The result is the original value divided by 2.


Radix Base Conversions

The radix is the base of a number system.  The conversion choices are:

h or x	Hexadecimal (radix is 16)

o	Octal (radix is 8)

b	Binary (radix is 2)

For example,

x := 1Ah

Result: x equals 26.

x := 1111b

Result: x equals 15.

x := 44o

Result: x equals 36.

All radix bases must begin with a number.  Precede non-numeric hex digits with 0.  For example,

x := 0Ah

Result: x equals 10.


Macro Control Statements

Control statements alter the sequential play of macro commands.  For example,

SetBrushWidth(BrushWidth: 25)

SetBrushWidth(BrushWidth: 75)

sets a 25-pixel Paint Brush width and then a 75-pixel Paint Brush width.  The second command overrides the first.  A control statement can select which SetBrushWidth to play depending on a condition being true.

SWITCH(Test)

    CASEOF 1: SetBrushWidth(BrushWidth: 25)

    CASEOF 2: SetBrushWidth(BrushWidth: 75)

    DEFAULT: SetBrushWidth(BrushWidth: 50)

ENDSWITCH

Explanation: If variable Test equals 1, set a 25-pixel Paint Brush width.  If Test equals 2, set a 75-pixel Paint Brush width.  If Test equals any value except 1 or 2, set a 50-pixel Paint Brush width.  The value of Test can be determined by a programming command such as MENU or GETNUMBER.  Macros support conditional control statements, loop control statements, and miscellaneous control statements such as CALL, GO, and QUIT.

See the following topics for more information:

Using Conditional Statements

Using Loop Statements

Using Calling Statements

Using Subroutines

Macro File Libraries

See Also

SWITCH


Using Conditional Statements

Conditional statements execute a statement or statement block when an expression is true, or when a variable matches a constant.

Macros support the following conditional statements:

CASE

IF-ELSE-ENDIF

SWITCH-ENDSWITCH


CASE

Executes a LABEL statement when Test (user-defined variable) matches a constant value.

CASE(Test; {1; Start; 2; Next}; Other)

...(other statements)...

LABEL(Start)

...statement block...

LABEL(Next)

...statement block...

LABEL(Other)

...statement block...

Explanation: If Test matches 1, call LABEL(Start).  If Test matches 2, call LABEL(Next).  If there is no match, call LABEL(Other).  CASE CALL is a similar statement which expects a RETURN after a LABEL statement.  See the programming commands CASE and CASE CALL.


IF-ELSE-ENDIF

Executes a statement or statement block when an expression is true.

IF(x = 5)

...statement block...

ELSE

...statement block...

ENDIF

Explanation: Execute the first statement block if the expression x = 5 is true (if x equals 5).  If not true, execute the second statement block.  ELSE is optional.

IF(Expression)

...statement block...

ENDIF

Explanation: If Expression is true, execute statement block.  If not true, execute the first statement after ENDIF.  Expression must evaluate to true or false.  See Relational Expressions and IF.


SWITCH-ENDSWITCH

Executes a statement or statement block when Test matches Constant.

SWITCH(Test)

CASEOF Constant1:

...statement block...

CASEOF Constant2:

...statement block...

CASEOF Constant3:

...statement block...

DEFAULT:

...statement block...

ENDSWITCH

Explanation: If Test matches Constant1, the statement block after CASEOF Constant1 is executed.  Statement blocks can include calling a subroutine (see Using Subroutines).  If CONTINUE follows a statement block, the next statement block is automatically executed.  See SWITCH.


Using Loop Statements

Loop statements execute a statement or statement block a specified number of times, until an expression is true, or while an expression is true.

Macros support the following loop statements:

FOR-ENDFOR

REPEAT-UNTIL

WHILE-ENDWHILE


FOR-ENDFOR

Executes a statement or statement block a specified number of times.  The general form is:

FOR(ControlVariable; InitialValue; TerminateExp; IncrementExp)

...statement block...

ENDFOR

Explanation: InitialValue initializes ControlVariable.  TerminateExp tests the value of ControlVariable.  IncrementExp increases the value of ControlVariable until TerminateExp is true and the loop ends.

FOR(x; 1; x < 5; x + 1)

...statement block...

ENDFOR

Explanation: x is initialized to 1, statement block executes while x is less than 5, x is incremented by 1 at the end of each loop.  Similar loop statements are FOREACH-ENDFOR and FORNEXT-ENDFOR.  See Relational Expressions, FOR, FOREACH, and FORNEXT.


REPEAT-UNTIL

Executes a statement or statement block until an expression is true.  All REPEAT statements execute at least once because the expression is checked at the end of the loop.

REPEAT

...statement block...

UNTIL(x >= 10)

Explanation: Execute statement block until the expression x >= 10 is true (until x is greater than or equal to 10).  The value of x must change in the loop to make the expression true or the loop never ends.  For example,

REPEAT

...statement block...

x := x + 1

UNTIL(x >= 10)

Explanation: Increment x by 1 (x := x + 1) at the end of each loop until x is greater than or equal to 10.  See Relational Expressions and REPEAT.


WHILE-ENDWHILE

Executes a statement or statement block while an expression is true.  WHILE statements never execute unless the expression is true because the expression is checked at the start of the loop.  For example,

WHILE(x <= 10)

...statement block...

ENDWHILE

Explanation: Execute statement block while the expression x <= 10 is true (while x is less than or equal to 10).  If x is greater than 10, the loop does not execute.  The value of x must change in the loop to make the expression true or the loop never ends.  For example,

WHILE(x <= 10)

 	...statement block...

x := x + 1

ENDWHILE

Explanation: Increment x by 1 (x := x + 1) at the end of each loop while x is less than or equal to 10.  See Relational Expressions and WHILE.


Using Calling Statements

Calling statements call a subroutine which consists of one or more statements (see Using Subroutines).

Macros support the following calling statements:

CALL

GO

Subroutine Name


CALL

Has one parameter which is the name of a subroutine to call.  RETURN directs macro execution to the statement that follows CALL (see the programming commands CALL and RUN).

CALL(ExSub)

...other statements...

LABEL(ExSub)

...statement block...

RETURN

Explanation: CALL(ExSub) directs macro execution to LABEL(ExSub), where statement block is executed.  RETURN directs macro execution to the first statement after CALL(ExSub).  See the programming command CALL


GO

Has one parameter which is the name of a subroutine to jump to.  Macro execution continues from the point of the subroutine and does not return (statements between GO and the subroutine do not execute).  RETURN ends a macro or directs macro execution to the statement that follows a RUN command (see the programming commands GO and RUN).

GO(ExSub)

...other statements...

LABEL(ExSub)

...statement block...

RETURN

Explanation: GO(ExSub) directs macro execution to LABEL(ExSub), where statement block is executed.  RETURN ends the macro.


Subroutine Name

Performs the same action as a CALL statement.  For example,

CALL InitializeVariables(Parameter1; Parameter2)

InitializeVariables(Parameter1; Parameter2)

both call a function or procedure named InitializeVariables (see Using Subroutines, LABEL, FUNCTION, and PROCEDURE).  If the second example calls a function, you can assign a return value to a variable with a statement such as

x := InitializeVariables(Parameter1; Parameter2)

See RETURN.


Using Subroutines

Subroutines consist of one or more statements that execute when the subroutine is called by CALL, GO, or the name of the subroutine.

Macros support the following subroutines:

Labels

Functions

Procedures


Labels

Have one parameter which is the name of the subroutine.  Label names must begin with a character, consist of one or more letters or numbers, are limited to 30 characters, and have an optional trailing @ sign.  Labels generally include one or more statements followed by RETURN or QUIT.  LABEL statements execute the same as other macro statements and do not have to be called.  See the LABEL programming command.


Functions

Can have one or more parameters which receive a value from a calling statement (see Using Calling Statements) and return a value.  A function without parameters performs like a LABEL, except it cannot execute unless called.  Function names must begin with a character, consist of one or more letters or numbers, are limited to 30 characters, and have an optional trailing @ sign.  The following rules apply to functions:

     	Functions begin with the word FUNCTION and end with ENDFUNC.

     	Functions do not execute unless called.

     	Calling statements consist of a function name, which can be followed by one or more parameter values that pass to the function.  If there are no parameters, empty parentheses must follow the function name.

     	The number of parameters in a calling statement must match the number of function parameters.

     	A function cannot be defined inside another subroutine.

     	Functions can be placed anywhere in a macro or in a macro library file (see USE).

     	Functions can be called from a subroutine, or a function can call itself (functions are recursive).

     	Function variables are private to the function.  A variable with the same name as a function variable can be used elsewhere in the macro without conflict.

     	Functions can include LABEL statements which are not visible outside the function. A LABEL statement inside a function should not have the same name as a function or procedure.

     	Functions accept RETURN statements with no parameters (return 0); or a value contained in a variable that is the result of a function; or an enumerated type that asserts a Cancel, Error, or Not Found condition; or an enumerated type that asserts a Cancel, Error, or Not Found condition, and a value contained in a variable that is the result of a function operation.  See RETURN.


Procedures

Can have no parameters, or one or more parameters which receive a value from a calling statement (see Using Calling Statements).  A procedure cannot return a value.  A procedure without parameters performs like LABEL, except it cannot execute unless called.  Procedure names must begin with a character, consist of one or more letters or numbers, are limited to 30 characters, and have an optional trailing @ sign.  The following rules apply to procedures:

     	Procedures begin with the word PROCEDURE and end with ENDPROC.

     	Procedures cannot execute unless called.

     	Calling statements consist of a procedure name, which can be followed by one or more parameter values that are passed to the procedure.  If there are no parameters, empty parentheses must follow the procedure name.

     	The number of parameters in a calling statement must match the number of procedure parameters.

     	A procedure cannot be defined inside another subroutine.

     	Procedures can be placed anywhere in a macro, or in a macro library file (see USE).

     	Procedures can be called from a subroutine, or a procedure can call itself (procedures are recursive).

     	Procedure variables are private to the procedure.  A variable with the same name as a procedure variable can be used elsewhere in the macro without conflict.

     	Procedures can include LABEL statements which are not visible outside the procedure.  A LABEL statement inside a procedure should not have the same name as a procedure or function.

     	Procedures accept RETURN statements with no parameters (directs macro execution to the statement that follows a procedure's caller); or with one parameter (an enumerated type that asserts a Cancel, Error, or Not Found condition).  See RETURN.


Macro File Libraries

Contain functions and/or procedures that can be called from another macro and must be compiled.

USE specifies a macro that contains functions and/or procedures.  Usually precedes calling statements to a macro file library.  The following example contains two functions:

FUNCTION Add(x)

    x := x + 50

    RETURN(x)

ENDFUNC

FUNCTION Subtract(x)

    x:= x - 25

    RETURN(x)

ENDFUNC

Explanation: Function Add receives a value in variable x (see Using Calling Statements).  50 is added to x and returned to the functions caller.  Function Subtract receives a value in another variable named x.  25 is subtracted from x and returned to the functions caller.  If this example was saved and compiled as LIBRARY.WCM, the next example includes statements that call the Add and Subtract functions:

APPLICATION(WP; "WPPrWin"; Default; "US")

USE("C:\PRWIN30\MACROS\LIBRARY.WCM")

z := Add(50)

z := Subtract(z)

IF(z = 75)

    BEEP // computer beeps because z equals 75

ENDIF

Explanation: After function Add is called, 100 is returned in variable z.  After function Subtract is called, 75 is returned in variable z.  The computer beeps because the expression z = 75 is true.

The previous example with function calling statements in shorthand notation:

APPLICATION(WP; "WPPRWin"; Default; "US")

USE("C:\PRWIN30\MACROS\LIBRARY.WCM")

z := Add(Subtract(50))

IF(z = 75)

    BEEP // computer beeps because z equals 75

ENDIF


Conventions and Hints

Conventions and Macro Hints

Conventions

     	Programming commands, such as SWITCH, are shown in uppercase to distinguish them from product commands.  You can enter commands in uppercase, lowercase, or mixed case.  The compiler is not case sensitive (see Compilers).

     	Product commands, such as AboutDlg or AddSlide, are shown in mixed case.

     	System variables, such as EnvPaths or EnvChartType, are shown in mixed case and usually begin with Env because they return information about the program environment.

     	Italicized words in a syntax definition are user-defined values.

Macro Hints

     	Wrapping does not affect macro execution.

     	Do not insert spaces in a command name unless the space is part of the syntax.

     	Do not use hard returns, tabs, or indents within a character expression (a character string enclosed in double quotation marks).  See Character Expressions.

     	You can use spaces, tabs, indents, and hard returns before and after commands, or between parameters, to make a macro easier to read.

     	Smart Quotes in a macro create a compile-time syntax error.  To disable Smart Quotes in WordPerfect 6.1 for Windows, choose Tools, QuickCorrect, then deselect Enable SmartQuotes.

     	Command syntax must be correct for a macro to compile.  Common errors include missing or incorrectly used colons (:), semicolons (;), and double quotation marks (").

     	A macro is automatically compiled the first time it plays.  You can also compile macros from Macro Facility (see Compilers), or choose Save & Compile on the Macro feature bar (see Writing Macros).

     	Begin macros with an APPLICATION statement to identify the application used in the macro.  The compiler requires this information.  You can include more than one APPLICATION statement (see APPLICATION).

     	When compiled, Presentations macros are saved as WordPerfect 6.1 files.


Creating Macros

Record a Macro

Play a Macro

Edit a Macro

Writing Macros

Macro Errors

Dialog Boxes


Record a Macro

Recording a macro saves a series of keystrokes and/or mouse actions that you can play (repeat) later.  Recorded macros automate routine tasks, such as setting color attributes, displaying a dialog box for user input, or opening or closing a document.

Steps

To record a macro,

1	Choose Tools, Macro, Record (or press Ctrl+F10) to display the Record Macro dialog box.

2	Enter a filename in the Filename edit box.  The default extension .WCM is automatically added when you choose Record unless you enter a different extension.  The macro is recorded in the default macros directory unless you specify another path.

To change the default extension, start or switch to WordPerfect Macro Facility (see Macro Facility).  From the Macro Facility main menu, choose Settings, Options, then enter the file extension in the Extension edit box.

3	Choose Record to dismiss the dialog box and begin recording.

4	Perform a task.  For example, in a slide show choose Slide, Master Gallery, select the Balloons slide show master, Retrieve.  When you play the macro, the Balloons slide show master is automatically applied to the current slide.

5	To stop recording, choose Tools, Macro, Record (or press Ctrl+F10)

or

Tools, Macro, Stop (or press Ctrl+Shift+F10).

The macro is saved in the default macros directory unless you specified a different path (step 2).


Play a Macro

After recording, playing a macro accomplished in one step what required several steps to achieve during the recording session.

Steps

1	Choose Tools, Macro, Play (or press Alt+F10) to display the Play Macro dialog box.

2	Enter a filename, including path and extension if necessary, then choose Play.

3	Choose Play to dismiss the dialog box and play the macro.  Macros automatically compile the first time they are played.


Edit a Macro

Presentations macros are saved as text files, with a compiled macro object hidden at the beginning of each file.  You can write, edit, and save a macro as you would any other text document.  If you edit a macro in WordPerfect for Windows, the Macro feature bar simplifies the task.  You can also edit a macro by retrieving the macro file into a text area in Presentations.

Steps

To edit a macro in WordPerfect for Windows,

1	In WordPerfect, choose Tools, Macro, Edit to display the Edit Macro dialog box.

2	Enter a filename, including path and extension if necessary, then choose Edit.

3	Choose Edit to dismiss the dialog box, display the Macro feature bar, and open the macro.

If you record the sample macro to retrieve the World slide show master (described in Record a Macro), then open the macro file, you see:

Application (A1; "WPPrWin"; Default; "US")

ReplaceMasters (Filename:"C:\PRWIN30\GALLERY\BALLOONS.MST")

This macro consists of the APPLICATION programming command and the ReplaceMasters product command.

4	Edit the macro.  For example, edit the Filename parameter to retrieve a different slide show master, and enter commands that apply the Combination template and display the Ruler:

Application (A1; "WPPrWin"; Default; "US")

ReplaceMasters (Filename:"C:\PRWIN30\GALLERY\MOUNTAIN.MST")

SetTemplateCurrent (Template: "Combination")

ShowRuler ()

See SetTemplateCurrent and ShowRuler.

You can edit a macro by typing commands, or you can use the Macro feature bar to insert commands.  For more information on using the Macro feature bar, see Writing Macros in the WordPerfect 6.1 Macros Help.

5	To save changes, choose File, Save.

or

Click Save & Compile on the Macro feature bar.

6	Play the macro in Presentations to see changes.

Steps

To edit a macro in Presentations,

1	Choose Insert, Text Area, drag to create a text area.

2	Choose Insert, File, enter the filename of the macro you want to edit, Insert.

3	Edit the macro.  See step 4 above for more information.

4	Choose File, Save As, select WordPerfect 6.0/6.1 in the Save File as Type list box, enter a filename with a .WCM extension, Save.

5	Play the macro to see changes.  The macro automatically compiles the first time it plays.


Writing Macros

A recorded macro includes only product commands.  When you play a recorded macro, each action is played in recorded order (see Record a Macro).

A written macro can also include non-recordable statements that specify how a macro performs a task.  The writer specifies the conditions for playing assignments, loops, and programming commands (see Macro Language Concepts).  Writing a macro provides greater flexibility to determine function than recording a macro.  You can write a Presentations macro in WordPerfect for Windows and play it in Presentations.


Macro Errors

Errors are sometimes created when you edit a macro (see Syntax).  If in the example in Edit a Macro you typed ShwRuler instead of ShowRuler, when you choose Save & Compile a compile-time syntax error displays a syntax error message box.

The compiler does not recognize ShwRuler, and guesses that it is a LABEL's calling statement (see Using Calling Statements and Using Subroutines).  When it reaches the end of the file and does not find a corresponding LABEL, it displays a Syntax Error message.  Common syntax errors are:

     	Missing semicolons between parameters.

     	Missing parentheses.

     	Missing double quotation marks (see Character Expressions).

     	Missing command in a conditional or loop statement (see Using Conditional Statements and Using Loop Statements).

     	Misspelled macro command names.

     	Undefined calling statements (see Using Calling Statements).

The compiler identifies syntax errors and suggests solutions for the writer to verify.

Run-time error messages identify errors that occur while the macro plays and show where errors occur.


Dialog Boxes

Users interact with applications through menus and dialog boxes.  Dialog boxes can display more than one option for user input.  For example, in the Page Format dialog box, default settings are displayed in edit boxes next to buttons.  To display the Page Format dialog box, choose File, Page Format.

To change settings, enter new values in the edit boxes or click a button (see DIALOGADDPOPUPBUTTON).  The edit box and button are Windows controls for user input.  Controls available for a user-defined dialog box are described in the topics listed below.

Dialog Box Controls

Creating a Dialog Box with Macro Commands

Creating a Dialog Box with Dialog Editor

Modal Dialog Boxes

Modeless Dialog Boxes


Dialog Box Controls

Are input or output windows where the user interacts with a dialog box and its parent application.  Macros support the following dialog box controls:

Check Boxes

Color Wheels

Combination Boxes

Counter Buttons

Edit Boxes

Filename Edit Boxes

Frames

Group Boxes

Horizontal Lines

Hot Spots

Icons

List Boxes

Pop-Up Buttons

Push Buttons

Radio Buttons

Scroll Bars

Static Text Controls

Viewers

Vertical Lines


Check Boxes

Display one or more options.  Use a callback function to activate user-defined responses.  See DIALOGADDCHECKBOX.


Color Wheels

Display colors to select.  See DIALOGADDCOLORWHEEL.


Combination Boxes

Display an edit box and a list box.  Enter text such as a filename in the edit box, or double-click a list item to insert it.  See DIALOGADDCOMBOBOX.


Counter Buttons

Display an edit box and a counter button.  Enter a number in the edit box, or click the counter button to insert a number.  See DIALOGADDCOUNTER.


Edit Boxes

Receive text input.  There are different styles of edit controls, including single line and multiple line.  See DIALOGADDEDITBOX.


Filename Edit Boxes

Display an edit control and a button control.  Enter a filename in the edit control, or click the button to display the Select File dialog box.  See DIALOGADDFILENAMEBOX.


Frames

Group items in a dialog box.  Accept no input.  See DIALOGADDFRAME.


Group Boxes

Group items in a dialog box with a titled frame.  Accept no input.  See DIALOGADDGROUPBOX.


Horizontal Lines

Separate items in a dialog box.  Accept no input.  See DIALOGADDHLINE.


Hot Spots

Are invisible controls that close a dialog box when the user clicks a defined area.  Redefine the response with a callback function.  See DIALOGADDHOTSPOT.


Icons

Display graphic representations.  Accept no input, unless used in a callback function with DIALOGADDHOTSPOT.  See DIALOGADDHOTSPOT, DIALOGADDICON, DIALOGSHOW.


List Boxes

Display a list of options to choose from.  There are different styles of list boxes, including single-column and multi-column.  See DIALOGADDLISTBOX.


Pop-Up Buttons

Display the name of a menu item on a push button.  Click the button to display the menu.  See DIALOGADDPOPUPBUTTON.


Push Buttons

Activate user-defined responses when chosen.  See DIALOGADDPUSHBUTTON.


Radio Buttons

Display mutually exclusive options.  Use a callback function to activate user-defined responses.  See DIALOGADDRADIOBUTTON and DIALOGSHOW.


Scroll Bars

Scroll through documents, or activate user-defined responses with a callback function.  See DIALOGADDSCROLLBAR and DIALOGSHOW.


Static Text Controls

Send text to a dialog box.  Accept no input.  See DIALOGADDTEXT.


Viewers

Display read-only text files.  See DIALOGADDVIEWER.


Vertical Lines

Separate items in a dialog box.  Accept no input.  See DIALOGADDVLINE.


Creating a Dialog Box with Macro Commands

To create a dialog box with macro commands, define it, add controls, and display it.  You should dismiss the dialog box when the macro ends.  The commands presented below create the following dialog box:

Click the example button above to display the complete macro.

Define

Specify the size and style of the dialog box, and the controls it will contain.  The following command,

DIALOGDEFINE(Dialog: 1000; Left: 50; Top: 50; Width: 150; Height: 100; Style: OK! | Percent!; Caption: "Example Dialog Box")

defines (creates in memory) a dialog box with the following specifications:

Dialog: The number 1000 was chosen to identify the dialog box.  A name such as "MainDialog" could also have been used.  The number or name must be unique.  It is used again to add controls, display, and then destroy the dialog box when the macro ends.

Left, Top, Width, Height: The dialog box is displayed in the center of the screen by setting the left and top parameters to 50 and using the Percent! style.  Dialog boxes are positioned and sized in dialog units.  A vertical unit equals 1/8 the font height, and a horizontal unit equals 1/4 the font width.

Style: The Percent! formula is,

(screen width or height - dialog box width or height) * percentage

This formula equals the number of dialog units from the left side of the screen to the left side of the dialog box, or the number of dialog units from the top of the screen to the top of the dialog box.  The dialog box has an OK push button control.

Caption: The dialog box title is "Example Dialog Box".

Parameter names: Parameter names are optional.  For example,

DIALOGDEFINE(1000; 50; 50; 200; 125; OK! | Percent!; "Example Dialog Box")

defines the same dialog box as the command above.

Add Controls

The following commands,

DIALOGADDTEXT(Dialog: 1000; Control: 100; Left: 10; Top: 10; Width: 50; Height: 15; Style: Left!; Text: "Edit control:")

DIALOGADDEDITBOX(Dialog: 1000; Control: 101; Left: 10; Top: 25; Width: 125; Height: 25; Style: Left! | VScroll! | Multiline!; vReturn; 1000)

add a static control and an edit control to the dialog box with the following specifications (see Dialog Box Controls):

Dialog: 1000 for both controls, which equals the Dialog parameter of the parent dialog box (see Define above).

Control: The controls have unique Control numbers (100 and 101), which could also be names such as "Control 1" and "Control 2".  Old-style dialog boxes used Control values to give a control the initial input focus (see Creating a Dialog Box with Dialog Editor).

The value of the Control used to dismiss the dialog box is returned in the implicit variable MacroDialogResult (see DIALOGDEFINE): 1 for OK, 2 for Cancel, 2 for Close (system menu box), 2 if you double-click the system menu box, 2 if you press Alt+F4, or the value of the Control parameter of a user-defined push button or hot spot (see DIALOGADDPUSHBUTTON and DIALOGADDHOTSPOT).

Left, Top, Width, Height: The controls are displayed 10 dialog units from the left side of the dialog box, and 10 and 25 units from the top.  The widths are 50 and 175 dialog units, and the heights are 15 and 50 dialog units.  A vertical dialog unit equals 1/8 the font height, and a horizontal dialog unit equals 1/4 the font width.

Style: The static text is left justified.  The edit box is multi-line with a vertical scroll bar.  Combine styles with bitwise OR operator (|) (see Bitwise Operators).

Text: The static control text is "Edit Control".

MacroVar, LimitText: Text typed into the edit box is assigned to variable vReturn when the dialog box is dismissed by OK or Close on the system menu.  The maximum number of characters the edit control accepts is 1000.

Display

The following command,

DIALOGSHOW("1000"; "WordPerfect")

displays dialog box 1000 and gives the input focus to control 101 (edit control has the insertion point).

Dismiss

The following command,

DIALOGDISMISS("1000"; "OKBttn")

dismisses dialog box 1000, and clears the value of the implicit variable MacroDialogResult.  If you need this value, assign it to another variable before executing DIALOGDISMISS.  If you do not destroy a dialog box before the macro ends, memory conflicts may occur.


Creating a Dialog Box with Dialog Editor

Purpose

Use the Macro Dialog Editor to quickly and easily create, design, set properties for, and edit the dialogs you use in your macros.  Using the Macro Dialog Editor takes the place of the DIALOGDEFINE sections in your macros.

Macro Dialog Editor lets you add, edit, position, size, move, and assign values to controls, lines, and other elements of a dialog.  You can also use it to give each control a control name, variable name, values, and other properties, as well as define the control order, set the initial focus, set tab stops, and group controls. The file WPDE20US.DLL contains the Macro Dialog Editor functionality, and it goes in your Shared Code directory.

With Dialog Editor you can visually create and edit dialogs for GroupWise macros.  Open Dialog Editor from the WordPerfect Macro Facility or from within WordPerfect 6.1 for Windows.

Steps

To open the Macro Dialog Editor from the Macro Facility,

1	Open the Macro Facility (run ...\WPC20\MFWIN20.EXE from Windows Program Manager).

2	Choose Dialog from the Macros menu.

3	Specify a macro filename, then choose OK.

4	Choose Create, type a name for the dialog, then choose OK.

or

Select the dialog you want, then choose Edit.

Steps

To open the Macro Dialog Editor from within WordPerfect,

1	Choose Macro from the Tools menu, then choose Edit.

2	Specify a macro filename, then choose OK to display the Macro feature bar.

3	Click Dialog Editor on the macro feature bar.

4	Choose Create, type a name for the dialog, then choose OK.

or

Select the dialog you want, then choose Edit.

A file that contains only dialog definitions does not have to be compiled.  The following example shows how to use Dialog Editor dialogs in a Presentations macro:

APPLICATION(A1; "WPPrWin"; Default; "US")

// For convenience, save the file that contains the dialog

// definitions under the same name as your macro

// with a .DLG extension.

// USE statement for including dialog definitions

USE("C:\WPPRWIN\MACROS\DLGTEST.DLG")

// Display dialog contained in definition file named "Dialog1"

DIALOGSHOW("Dialog1"; "Presentations")

...statement block...

DIALOGDISMISS("Dialog1"; "CancelBttn")

QUIT


For Example...

// Example Dialog Box

// Define dialog box

DIALOGDEFINE(Dialog: 1000; Left: 50; Top: 50; Width: 150; Height: 100; Style: OK! | Percent!; Caption: "Example Dialog Box")

//Static text control

DIALOGADDTEXT(Dialog: 1000; Control: 100; Left: 10; Top: 10; Width: 50; Height: 15; Style: Left!; Text: "Edit control:")

// Edit box control

DIALOGADDEDITBOX(Dialog: 1000; Control: 101; Left: 10; Top: 25; Width: 125; Height: 25; Style: Left! | VScroll! | Multiline!; vReturn; 1000)

// Display dialog box

DIALOGSHOW("1000"; "WordPerfect")

// Destroy dialog box

DIALOGDISMISS("1000"; "OKBttn")


Modal Dialog Boxes

Require the user to complete an action before input to the parent application is allowed.  For example, the Page Format dialog box requires the user to choose OK or Cancel before control returns to Presentations.  Macro dialog boxes are modal by default (see DIALOGDEFINE).


Modeless Dialog Boxes

Do not require the user to complete an action before input to the parent application is allowed.  For example, you can check spelling in a text area with the Spell Checker--Presentations 3.0 dialog box, then click in the document and edit the document while the dialog box remains on the screen.  Click the dialog box to perform another spell check.  For information about creating a modeless dialog box, see DIALOGDEFINE.


Hint

You may want to change the font size to make the macro easier to read.  Choose Attributes, Font, select a font size.


Macro Examples

Line-by-line comments describe the following macros.  Click the example button above each one to copy the macro to the Clipboard to paste in a WordPerfect document.

ASSERT.WCM displays a menu and creates Cancel, Error, and Not Found conditions.

CALLBACK.WCM creates a callback function that responds to system menu box options and various dialog controls.

CB_SCBAR.WCM creates a callback function that responds to the position of a scroll bar thumb.

For a callback function example that responds to list item selections, see the DIALOGSHOW example.

CALENDAR.WCM use DDE to launch Novell GroupWise 4.1 and open the GroupWise day calendar.


Macro: ASSERT.WCM

ASSERT.WCM uses MENU to display a list of options; ASSERT to create a Cancel, Error, or Not Found condition; and ONCANCEL, ONERROR, or ONNOTFOUND to execute a subroutine.  It also uses MESSAGEBOX to display messages and GO to create user-defined loops.  Click the comment buttons [image] for detailed explanations.  Click the example button above to copy ASSERT.WCM to the Clipboard.

1	// Name: ASSERT.WCM

2	// Directory: C:\PRWIN30\MACROS

3	// Description: Demonstrate MENU, MESSAGEBOX, ASSERT, ONCANCEL, ONERROR, ONNOTFOUND, CANCEL, ERROR, NOTFOUND

4	APPLICATION(WP; "WPPrWin"; Default; "US")

5	CALL(AssertConditions)

6	CALL(DisplayMenu)

7	CALL(QuitMacro)

8	//*********************************************************

9	//	MAIN LABEL STATEMENTS

10	//*********************************************************

11	LABEL(AssertConditions)

12	ONCANCEL(Conditions)

13	ONERROR(Conditions)

14	ONNOTFOUND(Conditions)

15	vCondition := "Turn conditions Off!"

16	RETURN

17	LABEL(DisplayMenu)

18	MENU(vChoice; Digit!; ; ; {"CancelCondition!"; "ErrorCondition!"; "NotFoundCondition!"; vCondition; "Quit"})

19	SWITCH(vChoice)

20	CASEOF 1: ASSERT(CancelCondition!)

21	CASEOF 2: ASSERT(ErrorCondition!)

22	CASEOF 3: ASSERT(NotFoundCondition!)

23	CASEOF 4: IF(vCondition = "Turn conditions Off!")

24	GO(TurnConditionsOff)

25	ELSE

26	GO(TurnConditionsOn)

27	ENDIF

28	CASEOF 5: GO(QuitMacro)

29	DEFAULT: Conditions

30	ENDSWITCH

31	RETURN

32	LABEL(QuitMacro)

33	vMessage := "You selected 5, or you selected 1, 2, or 3 with all conditions Off!"

34	MESSAGEBOX(vStatus; "Condition Status"; vMessage; RetryCancel! | IconInformation! | DefButton2!)

35	IF(vStatus = 4)

36	GO(DisplayMenu)

37	ELSE

38	QUIT

39	ENDIF

40	//*********************************************************

41	//	SECONDARY LABEL STATEMENTS

42	//*********************************************************

43	LABEL(Conditions)

44	SWITCH(ErrorNumber)

45	CASEOF 1: vMessage := "^0"

46	CASEOF 2: vMessage := "^1"

47	CASEOF 7: vMessage := "^2"

48	DEFAULT:  vMessage := "^3"

49	ENDSWITCH

50	MESSAGEBOX(vStatus; "Condition Status"; vMessage; Ok! | IconInformation! | HasParameters!; {"You selected 1 with CANCEL(On!)"; "You selected 2 with ERROR(On!)"; "You selected 3 with NOTFOUND(On!)"; "Menu item not chosen"})

51	GO(DisplayMenu)

52	LABEL(TurnConditionsOn)

53	CANCEL(On!)

54	ERROR(On!)

55	NOTFOUND(On!)

56	vCondition := "Turn conditions Off!"

57	GO(DisplayMenu)

58	LABEL(TurnConditionsOff)

59	CANCEL(Off!)

60	ERROR(Off!)

61	NOTFOUND(Off!)

62	vCondition := "Turn conditions On!"

63	GO(DisplayMenu)


Lines 1-3

Comments about the macro.


Line 2

Macros are generally saved to the application's macros directory.


Line 4

Presentations identified as the default application.


Comment

Click the mouse to make this message disappear.


Line 5

Call LABEL(AssertConditions), which identifies a LABEL subroutine to call when there is a Cancel, Error, or Not Found condition (lines 12-14).


Line 6

Call LABEL(DisplayMenu) after LABEL(AssertConditions) returns (line 16).  LABEL(DisplayMenu) displays a five-option menu (line 18).


Line 7

Call LABEL(QuitMacro) after LABEL(DisplayMenu) returns (line 31).  LABEL(QuitMacro) displays a message box where the user can end the macro or redisplay the menu (lines 32-39).


Lines 8-10

Comments identify LABELs that correspond to the opening CALL statements (lines 5-7).


Lines 11-16

LABEL(AssertConditions) identifies a LABEL to execute when a Cancel, Error, or Not Found condition occurs.


Line 12

Execute LABEL(Conditions) when a Cancel condition occurs (line 43).


Line 13

Execute LABEL(Conditions) when an Error condition occurs (line 43).


Line 14

Execute LABEL(Conditions) when a Not Found condition occurs (line 43).


Line 15

Assignment operator assigns a character string to a variable named vCondition, which is menu item 4 the first time the menu is displayed (line 18).  The default condition for CANCEL, ERROR, and NOTFOUND is On!.


Line 16

RETURN statement directs macro execution to CALL(DisplayMenu) (line 6).


Lines 17-31

LABEL displays a five-option menu and asserts a Cancel, Error, or Not Found condition depending on a menu choice.


Line 18

MENU displays a numbered (Digit!) list of five items.  The number the user chooses is assigned to vChoice.  Omitting the third and fourth parameters centers the menu on the screen.


Line 19

SWITCH initiates an action, depending on the value of vChoice, which contains the number of the chosen menu item.


Line 20

If 1 is selected, assert a Cancel condition.  The macro assigns 1 to the variable ErrorNumber (see ASSERT).  LABEL(Condition) is automatically called (lines 12 and 45).


Line 21

If 2 is selected, assert an Error condition.  The macro assigns 2 to the variable ErrorNumber (see ASSERT).  LABEL(Condition) is automatically called (lines 13 and 46).


Line 22

If 3 is selected, assert a Not Found condition.  The macro assigns 7 to the variable ErrorNumber (see ASSERT).  LABEL(NotFound) is automatically called (line 14 and line 47).


Lines 23-27

If 4 is selected, toggle CANCEL, ERROR, and NOTFOUND conditions by calling LABEL(TurnConditionsOn) (lines 52-57) or LABEL(TurnConditionsOff) (lines 58-63).  The label called depends on the contents of variable vCondition (lines 15, 56, and 62).  Update the description of menu item 4.


Line 28

If 5 is selected, end (quit) macro.


Line 29

If another key is pressed, such as Esc, LABEL(Condition) executes.  Notice that the subroutine name executes the subroutine.  See Subroutine Name.


Line 30

ENDSWITCH closes SWITCH statement (line 19).


Line 31

RETURN statement directs macro execution to CALL(QuitMacro).


Lines 32-39

LABEL(QuitMacro) displays a message box with an option to end the macro or redisplay the menu.


Line 33

Assignment operator assigns character string "You selected 5, or you selected 1, 2, or 3 with all conditions Off!" to variable vMessage (line 34).


Line 34

MESSAGEBOX displays a message box with an information icon and Retry and Cancel buttons.  If Retry is chosen, 4 is assigned to variable vStatus, or 2 is assigned to vStatus if Cancel is chosen.


Lines 35-36

If variable vStatus equals 4 (line 34), GO sends macro execution to LABEL(DisplayMenu), which redisplays the menu.


Lines 37-38

If vStatus is any value except 4 (ELSE), end the macro (QUIT).


Line 39

ENDIF closes IF statement (line 35).


Lines 40-42

Comments identify secondary LABELs or LABELs called from a another LABEL (see lines 12-14, 24, and 26).


Lines 43-51

Execute LABEL(Conditions) when the user chooses 1, 2, or 3 (lines 20-22 and 12-14).


Line 44

SWITCH initiates an action, depending on the value of the variable ErrorNumber (lines 20, 21, 22) (see ASSERT).


Line 45

If ErrorNumber equals 1 (Cancel condition), assign "^1" to vMessage (see line 50).


Line 46

If ErrorNumber equals 2 (Error condition), assign "^2" to vMessage (see line 50).


Line 47

If ErrorNumber equals 7 (NotFound condition), assign "^3" to vMessage (line 50).


Line 48

If ErrorNumber contains a value other than 1, 2, or 7, assign "^4" to vMessage (line 50).


Line 49

ENDSWITCH closes SWITCH statement (line 44).


Line 50

MESSAGEBOX displays a message box with an information icon and OK button.  It uses the HasParameters! style, followed by four Message parameter options.  A caret (^) followed by a number in the Message parameter inserts the corresponding ParameterData message (one of the four message options) in its place (lines 45-48).  Numbering begins with 0.  See MESSAGEBOX.


Line 51

GO creates a loop by sending macro execution to LABEL(DisplayMenu), which redisplays the menu.


Lines 52-55

LABEL(TurnConditionsOn) turns on CANCEL, ERROR, and NOTFOUND conditions after LABEL(TurnConditionsOff) is executed.


Line 56

Assigns character string "Turn conditions Off!" to variable vCondition, which is displayed as menu item 4 (line 18).


Line 57

GO creates a loop by sending macro execution to LABEL(DisplayMenu), which redisplays the menu.


Lines 58-61

LABEL(TurnConditionsOff) turns off CANCEL, ERROR, and NOTFOUND conditions after the macro first starts or LABEL(TurnConditionsOn) is executed.


Line 62

Assigns character string "Turn conditions On!" to variable vCondition, which is displayed as menu item 4 (line 18).


Line 63

GO statement creates a loop by sending macro execution to LABEL(DisplayMenu), which redisplays the menu.


For Example...

// Name: ASSERT.WCM

// Directory: C:\PRWIN30\MACROS

// Description: Demonstrate MENU, MESSAGEBOX, ASSERT, ONCANCEL, ONERROR, ONNOTFOUND, CANCEL, ERROR, NOTFOUND

APPLICATION(WP; "WPPrWin"; Default; "US")

CALL(AssertConditions)

CALL(DisplayMenu)

CALL(QuitMacro)

//*********************************************************

//	MAIN LABEL STATEMENTS

//*********************************************************

LABEL(AssertConditions)

ONCANCEL(Conditions)

ONERROR(Conditions)

ONNOTFOUND(Conditions)

vCondition := "Turn conditions Off!"

RETURN

LABEL(DisplayMenu)

MENU(vChoice; Digit!; ; ; {"CancelCondition!"; "ErrorCondition!"; "NotFoundCondition!"; vCondition; "Quit"})

SWITCH(vChoice)

CASEOF 1: ASSERT(CancelCondition!)

CASEOF 2: ASSERT(ErrorCondition!)

CASEOF 3: ASSERT(NotFoundCondition!)

CASEOF 4: IF(vCondition = "Turn conditions Off!")

GO(TurnConditionsOff)

ELSE

GO(TurnConditionsOn)

ENDIF

CASEOF 5: GO(QuitMacro)

DEFAULT: Conditions

ENDSWITCH

RETURN

LABEL(QuitMacro)

vMessage := "You selected 5, or you selected 1, 2, or 3 with all conditions Off!"

MESSAGEBOX(vStatus; "Condition Status"; vMessage; RetryCancel! | IconInformation! | DefButton2!)

IF(vStatus = 4)

GO(DisplayMenu)

ELSE

QUIT

ENDIF

//*********************************************************

//	SECONDARY LABEL STATEMENTS

//*********************************************************

LABEL(Conditions)

SWITCH(ErrorNumber)

CASEOF 1: vMessage := "^1"

CASEOF 2: vMessage := "^2"

CASEOF 7: vMessage := "^3"

DEFAULT:  vMessage := "^4"

ENDSWITCH

MESSAGEBOX(vStatus; "Condition Status"; vMessage; Ok! | IconInformation! | HasParameters!; {"You selected 1 with CANCEL(On!)"; "You selected 2 with ERROR(On!)"; "You selected 3 with NOTFOUND(On!)"; "Menu item not chosen"})

GO(DisplayMenu)

LABEL(TurnConditionsOn)

CANCEL(On!)

ERROR(On!)

NOTFOUND(On!)

vCondition := "Turn conditions Off!"

GO(DisplayMenu)

LABEL(TurnConditionsOff)

CANCEL(Off!)

ERROR(Off!)

NOTFOUND(Off!)

vCondition := "Turn conditions On!"

GO(DisplayMenu)


Macro: CALLBACK.WCM

CALLBACK.WCM creates a callback function that responds to system menu box options, check boxes, radio buttons, hot spots, and push buttons.  Click the comment buttons [image] for detailed explanations.  Click the example button above to copy CALLBACK.WCM to the Clipboard.

1	// Name: CALLBACK.WCM

2	// Directory: C:\PRWIN30\MACROS

3	// Description: Callback function displays a message when a user chooses a dialog box control

4	APPLICATION(WP; "WPPrWin"; Default; "US")

5	//*********************************************************

6	// MAIN CALL STATEMENTS

7	//*********************************************************

8	CALL(InitializeVariables)

9	CALL(CreateDialog)

10	CALL(DisplayMainDialog)

11	CALL(StartMessageLoop)

12	CALL(QuitMacro)

13	//*********************************************************

14	// MAIN LABEL STATEMENTS

15	//*********************************************************

16	LABEL(InitializeVariables)

17	WM_SYSCOMMAND := 274

18	WM_COMMAND := 273

19	vCheck := 0

20	vRadio := 0

21	vLoop := "Yes"

22	RETURN

23	LABEL(CreateDialog)

24	DIALOGDEFINE(1000; 50; 50; 210; 175; 1+2+16; "Callback Function")

25	DIALOGADDCHECKBOX(1000; 101; 10; 10; 50; 10; "Checkbox"; vCheck)

26	DIALOGADDRADIOBUTTON(1000; 102; 10; 30; 60; 10;"Radio button"; vRadio)

27	DIALOGADDHOTSPOT(1000; 103; 90; 10; 50; 50; 1)

28	DIALOGADDFRAME(1000; 104; 90; 10; 50; 50; 5)

29	DIALOGADDTEXT(1000; 105; 150; 30; 50; 15; 1; "<- Hot spot")

30	vText1 := "Choose Close from the system menu, double-click"

31	vText2 := "the system menu box, or press Alt+F4."

32	DIALOGADDTEXT(1000; 106; 20; 95; 190; 15; 1; vText1)

33	DIALOGADDTEXT(1000; 107; 20; 105; 170; 15; 1; vText2)

34	DIALOGADDGROUPBOX(1000; 109; 10; 75; 185; 50; "System commands")

35	RETURN

36	LABEL(DisplayMainDialog)

37	DIALOGSHOW (1000; 1; MsgLoop)

38	RETURN

39	LABEL(StartMessageLoop)

40	WHILE(vLoop = "Yes")

41	ENDWHILE

42	RETURN

43	LABEL(QuitMacro)

44	DIALOGDESTROY(1000)

45	QUIT

46	//*********************************************************

47	// CALLBACK FUNCTION

48	//*********************************************************

49	LABEL(MsgLoop)

50	SWITCH(MsgLoop[3])

51	CASEOF 101:

52	DIALOGDISMISS(1000; "OKBttn")

53	MESSAGEBOX(vStatus; "Check Box"; "Check boxes display options.  Choose OK to hide the message box and return to the main dialog box."; OK! | IconInformation!)

54	DIALOGSHOW (1000;1; MsgLoop)

55	CASEOF 102:

56	MESSAGEBOX(vStatus; "Radio Button"; "Radio buttons display mutually-exclusive options.  Choose OK to hide the message box and return to the main dialog box."; OK! | IconInformation!)

57	CASEOF 103:

58	MESSAGEBOX(vStatus; "Hot Spot"; "A hot spot was created over a filled frame.  You can also create a hot spot over an icon.  Choose OK to hide the message box and return to the main dialog box."; OK! | IconInformation!)

59	CASEOF "OKBttn":

60	MESSAGEBOX(vStatus; "OK Button"; "You chose the OK button on the main dialog box.  Choose OK to hide the message box and return to the main dialog box."; OK! | IconInformation!)

61	CASEOF "CancelBttn":

62	MESSAGEBOX(vStatus; "Cancel Button"; "Choosing Cancel assigns ""No"" to variable vLoop, which ends the loop and the macro."; OK! | IconExclamation!)

63	vLoop := "No"

64	ENDSWITCH

65	IF(MsgLoop[5] = WM_SYSCOMMAND)

66	MESSAGEBOX(vStatus; "System Command"; "After you choose OK, the main dialog box will disappear and then reappear after one second."; OK! | IconInformation!)

67	DIALOGDISMISS(1000; "OKBttn")

68	WAIT(10)

69	DIALOGSHOW(1000; 1; MsgLoop)

70	ENDIF

71	RETURN


Lines 1-3

Comments about the macro.


Line 2

Macros are generally saved to the default macros directory.


Line 4

Presentations identified as the default application.


Lines 5-7

Comments identify the opening CALL statements that outline and define the macro's basic operations.


Line 8

Call LABEL(InitializeVariables), which initializes all variables (lines 16-22).  A run-time error occurs if you reference a variable that has not been assigned a value.  See VARERRCHK.


Line 9

Call LABEL(CreateDialog) after LABEL(InitializeVariables) returns.  LABEL(CreateDialog) creates a dialog box in memory (lines 23-35).  It does not display the dialog box.


Line 10

Call LABEL(DisplayMainDialog) after LABEL(CreateDialog) returns.  LABEL(DisplayMainDialog) displays the dialog box and identifies a callback function.  See DIALOGSHOW.


Line 11

Call LABEL(StartMessageLoop) after LABEL(DisplayDialog) returns.  LABEL(StartMessageLoop) starts a message loop that suspends the dialog box for callback functions (lines 49-71).


Line 12

CALL LABEL(QuitMacro) after LABEL(StartMessageLoop) returns.  LABEL(QuitMacro) removes the dialog box from memory and ends the macro.


Lines 13-15

Comments identify LABELs that correspond to the opening CALL statements (lines 8-12).


Lines 16-22

LABEL(InitializeVariables) initializes all variables.


Lines 17-18

Initialize variables to contain Windows message numbers.  Using variables makes the macro easier to read.  The variable names are user defined, but match the Windows message names.  See DIALOGSHOW.


Lines 19-20

Initialize check box and radio button variables (lines 25, 26).


Line 21

Initialize the loop variable.  vLoop is later assigned a new value to end the message loop (line 63), which sends macro execution to CALL(QuitMacro).


Line 22

RETURN sends macro execution to CALL(CreateDialog).


Lines 23-35

LABEL(CreateDialog) creates a dialog box in memory.


Lines 25-27

Control parameter values are sent as messages to the callback function (52-63).


Line 35

RETURN sends macro execution to CALL(DisplayMainDialog).


Lines 36-38

LABEL(DisplayMainDialog) displays the dialog box and identifies the callback function MsgLoop.  RETURN sends macro execution to CALL(StartMessageLoop).


Lines 39-42

LABEL(StartMessageLoop) starts the message loop that suspends the dialog box for callback functions (lines 49-71).  RETURN sends macro execution to CALL(QuitMacro).


Lines 43-45

LABEL(QuitMacro) removes the dialog box from memory and ends the macro.


Lines 46-48

Comments identify the callback function.


Lines 49-71

Callback function MsgLoop responds to five Control parameter messages and one system command message.  See DIALOGSHOW.


Line 50

SWITCH tests the third element of the callback function array.  See DIALOGSHOW.


Lines 51-63

Array element MsgLoop[3] contains the Control parameter value of the control that calls the callback function.  A message box describes the control.  In this macro, Cancel is the only button that can dismiss the dialog box.


Line 52

DIALOGDISMISS hides the dialog box while the message box is displayed (line 54).


Line 54

DIALOGSHOW redisplays the dialog box after the message box is dismissed (line 52).


Line 64

ENDSWITCH closes the SWITCH statement (line 50).


Lines 65-70

A WM_SYSCOMMAND message is received when the user chooses Close from the system menu box, double-clicks the system menu box, or presses Alt+F4.


Lines 67-69

DIALOGDISMISS hides the dialog box after the message box is dismissed.  WAIT(10) pauses the macro for one second.  DIALOGSHOW redisplays the dialog box.


Line 70

ENDIF closes the IF statement (line 65).


Line 71

RETURN sends macro execution to the message loop (lines 39-42).


For Example...

// Name: CALLBACK.WCM

// Directory: C:\PRWIN30\MACROS

// Description: Callback function displays a message when a user chooses a dialog box control

APPLICATION(WP; "WPPrWin"; Default; "US")

//*********************************************************

// MAIN CALL STATEMENTS

//*********************************************************

CALL(InitializeVariables)

CALL(CreateDialog)

CALL(DisplayMainDialog)

CALL(StartMessageLoop)

CALL(QuitMacro)

//*********************************************************

// MAIN LABEL STATEMENTS

//*********************************************************

LABEL(InitializeVariables)

WM_SYSCOMMAND := 274

WM_COMMAND := 273

vCheck := 0

vRadio := 0

vLoop := "Yes"

RETURN

LABEL(CreateDialog)

DIALOGDEFINE(1000; 50; 50; 210; 175; 1+2+16; "Callback Function")

DIALOGADDCHECKBOX(1000; 101; 10; 10; 50; 10; "Checkbox"; vCheck)

DIALOGADDRADIOBUTTON(1000; 102; 10; 30; 60; 10;"Radio button"; vRadio)

DIALOGADDHOTSPOT(1000; 103; 90; 10; 50; 50; 1)

DIALOGADDFRAME(1000; 104; 90; 10; 50; 50; 5)

DIALOGADDTEXT(1000; 105; 150; 30; 50; 15; 1; "<- Hot spot")

vText1 := "Choose Close from the system menu, double-click"

vText2 := "the system menu box, or press Alt+F4."

DIALOGADDTEXT(1000; 106; 20; 95; 190; 15; 1; vText1)

DIALOGADDTEXT(1000; 107; 20; 105; 170; 15; 1; vText2)

DIALOGADDGROUPBOX(1000; 109; 10; 75; 185; 50; "System commands")

RETURN

LABEL(DisplayMainDialog)

DIALOGSHOW (1000; 1; MsgLoop)

RETURN

LABEL(StartMessageLoop)

WHILE(vLoop = "Yes")

ENDWHILE

RETURN

LABEL(QuitMacro)

DIALOGDESTROY(1000)

QUIT

//*********************************************************

// CALLBACK FUNCTION

//*********************************************************

LABEL(MsgLoop)

SWITCH(MsgLoop[3])

CASEOF 101:

DIALOGDISMISS(1000; "OKBttn")

MESSAGEBOX(vStatus; "Check Box"; "Check boxes display options.  Choose OK to hide the message box and return to the main dialog box."; OK! | IconInformation!)

DIALOGSHOW (1000;1; MsgLoop)

CASEOF 102:

MESSAGEBOX(vStatus; "Radio Button"; "Radio buttons display mutually-exclusive options.  Choose OK to hide the message box and return to the main dialog box."; OK! | IconInformation!)

CASEOF 103:

MESSAGEBOX(vStatus; "Hot Spot"; "A hot spot was created over a filled frame.  You can also create a hot spot over an icon.  Choose OK to hide the message box and return to the main dialog box."; OK! | IconInformation!)

CASEOF "OKBttn":

MESSAGEBOX(vStatus; "OK Button"; "You chose the OK button on the main dialog box.  Choose OK to hide the message box and return to the main dialog box."; OK! | IconInformation!)

CASEOF "CancelBttn":

MESSAGEBOX(vStatus; "Cancel Button"; "Choosing Cancel assigns ""No"" to variable vLoop, which ends the loop and the macro."; OK! | IconExclamation!)

vLoop := "No"

ENDSWITCH

IF(MsgLoop[5] = WM_SYSCOMMAND)

MESSAGEBOX(vStatus; "System Command"; "After you choose OK, the main dialog box will disappear and then reappear after one second."; OK! | IconInformation!)

DIALOGDISMISS(1000; "OKBttn")

WAIT(10)

DIALOGSHOW(1000; 1; MsgLoop)

ENDIF

RETURN


Macro: CB_SCBAR.WCM

CB_SCBAR.WCM creates a callback function that responds to Windows WM_VSCROLL, WM_ACTIVATE, and WM_SYSCOMMAND messages.  It uses DIALOGADDSCROLLBAR to display a list item.  Click the comment buttons [image] for detailed explanations.  Click the example button above to copy CALLBACK.WCM to the Clipboard.

1	// Name: CB_SCBAR.WCM

2	// Directory: C:\PRWIN30\MACROS

3	// Description: Use DIALOGADDSCROLLBAR and a callback function

4	APPLICATION(WP; WPPrWin; Default; "US")

5	//*********************************************************

6	// MAIN CALL STATEMENTS

7	//*********************************************************

8	CALL(InitializeVariables)

9	CALL(CreateDlg)

10	CALL(DisplayDlg)

11	CALL(StartMessageLoop)

12	CALL(QuitMacro)

13	//*********************************************************

14	// MAIN LABEL STATEMENTS

15	//*********************************************************

16	LABEL(InitializeVariables)

17	SB_LINEUP := 0

18	SB_LINEDOWN := 1

19	SB_PAGEUP := 2

20	SB_PAGEDOWN := 3

21	SB_THUMBPOSITION := 4

22	SB_THUMBTRACK := 5

23	SB_TOP := 6

24	SB_BOTTOM := 7

25	SB_ENDSCROLL := 8

26	vOldPos := 10

27	y := 1

28	WM_SYSCOMMAND:= 274

29	WM_VSCROLL := 277

30	WM_ACTIVATE := 6

31	vLoop := 1

32	DECLARE List[10]

33	vElement := 1

34	FOREACH(vFruit; {"Apples"; "Oranges"; "Papaya"; "Grapes"; "Bananas"; "Pears"; "Watermelon"; "Apricots"; "Peaches"; "Plums"})

35	List[vElement] := vFruit

36	vElement := vElement + 1

37	ENDFOR

38	RETURN

39	LABEL(CreateDlg)

40	DIALOGDEFINE(1000; 50; 50; 155; 160; 16; "Scroll Bar Callback Function")

41	DIALOGADDSCROLLBAR(1000; "Scroll"; 135; 10; 0; 100; 2 + 8;BarPos; 1; 10)

42	FORNEXT(yPos; 10; 100; 10)

43	DIALOGADDTEXT(1000; 0; 10; yPos; 40; 10; 2; List[yPos / 10])

44	ENDFOR

45	DIALOGADDTEXT(1000; 0; 60; 10; 40; 10; 1; "Apples")

46	DIALOGADDTEXT(1000; 0; 50; yPos + 15; 70; 10; 1; "Thumb Position   1")

47	RETURN

48	LABEL(DisplayDlg)

49	DIALOGSHOW (1000; 121; MsgLoop) // callback function = MsgLoop

50	RETURN

51	LABEL (StartMessageLoop)

52	WHILE(vLoop = 1) // message loop

53	ENDWHILE

54	RETURN

55	LABEL(QuitMacro)

56	DIALOGDESTROY(1000)

57	QUIT

58	//*********************************************************

59	// CALLBACK FUNCTION

60	//*********************************************************

61	LABEL(MsgLoop)

62	SWITCH(MsgLoop[5])

63	CASEOF WM_SYSCOMMAND:

64	GO(QuitMacro)

65	CASEOF WM_VSCROLL:

66	CALL(ScrollCtrl)

67	CASEOF WM_ACTIVATE:

68	CALL(MsgBox)

69	ENDSWITCH

70	SWITCH(MsgLoop[3])

71	CASEOF "CancelBttn":

72	GO(QuitMacro)

73	ENDSWITCH

74	RETURN

75	LABEL(ScrollCtrl)

76	SWITCH(MsgLoop[6])

77	CASEOF SB_LINEUP:

78	CALL(LineUp)

79	CASEOF SB_LINEDOWN:

80	CALL(LineDown)

81	CASEOF SB_PAGEUP:

82	CALL(PageUp)

83	CASEOF SB_PAGEDOWN:

84	CALL(PageDown)

85	CASEOF SB_THUMBPOSITION:

86	CALL(Thumb)

87	//CASEOF SB_THUMBTRACK:

88	//	CALL(Thumb)

89	CASEOF SB_TOP:

90	CALL(PageUp)

91	CASEOF SB_BOTTOM:

92	CALL(PageDown)

93	CASEOF SB_ENDSCROLL:

94	DIALOGADDTEXT(1000; 0; 107; 125; 10; 10; 1; y)

95	ENDSWITCH

96	RETURN

97	LABEL(Thumb)

98	y := MsgLoop[7]

99	y := y  & 65535

100	CALL(TypeFruit)

101	RETURN

102	LABEL(LineUp)

103	IF(NOT(y = 1))

104	y := y - 1

105	CALL(TypeFruit)

106	ELSE

107	BEEP

108	ENDIF

109	RETURN

110	LABEL(LineDown)

111	IF(NOT(y = 10))

112	y := y + 1

113	CALL(TypeFruit)

114	ELSE

115	BEEP

116	ENDIF

117	RETURN

118	LABEL(PageUp)

119	y := 1

120	CALL(TypeFruit)

121	RETURN

122	LABEL(PageDown)

123	y := 10

124	CALL(TypeFruit)

125	RETURN

126	LABEL(TypeFruit)

127	vBlank := "                         "

128	DIALOGADDTEXT(1000; 0; 60; vOldPos; 40; 10; 1; vBlank)

129	DIALOGADDTEXT(1000; 0; 60; y * 10; 40; 10; 1; List[y])

130	vOldPos := y * 10

131	RETURN

132	LABEL(MsgBox)

133	MESSAGEBOX(vStatus; "Message Box"; "Do you want to cancel this message?"; YesNo! | IconQuestion!)

134	IF(vStatus = 6)

135	WM_ACTIVATE := 0

136	ENDIF

137	RETURN


Lines 1-3

Comments about the macro.


Line 2

Macros are generally saved to the default macros directory.


Line 4

Presentations identified as the default application.


Lines 5-7

Comments identify the opening CALL statements which outline and define the macro's basic operations.


Line 8

Call LABEL(InitializeVariables), which initializes all variables (lines 16-38).  A run-time error occurs if you reference a variable that has not been assigned a value.  See VARERRCHK.


Line 9

Call LABEL(CreateDlg) after LABEL(InitializeVariables) returns.  LABEL(CreateDlg) creates a dialog box in memory (lines 39-47).  It does not display the dialog box.


Line 10

Call LABEL(DisplayDlg) after LABEL(CreateDlg) returns.  LABEL(DisplayDlg) displays the dialog box and identifies a callback function.  See DIALOGSHOW.


Line 11

CALL LABEL(MessageLoop) after LABEL(DisplayDlg) returns.  LABEL(MessageLoop) starts a message loop that suspends the dialog box for callback function (lines 61-74).


Line 12

CALL LABEL(QuitMacro) after LABEL(MessageLoop) returns.  LABEL(QuitMacro) removes the dialog box from memory and ends the macro.


Lines 13-15

Comments identify LABELs that correspond to the opening CALL statements (lines 8-12).


Lines 16-38

LABEL(InitializeVariables) initializes all variables.


Lines 17-25

Initialize variables with numbers that correspond to positions on the scroll bar.  See DIALOGADDSCROLLBAR.


Line 26

The position of the most recent list item displayed in the dialog box.  This position is cleared of text when a new list item is displayed (lines 127-128).


Line 27

The current position for displaying a new list item (line 129).


Lines 28-30

Initialize variables to contain Windows message numbers.  Using variables makes the macro easier to read.  The variable names are user defined, but match the Windows message names.  See DIALOGSHOW.


Line 31

Initialize the loop variable.  In this example, vLoop does not receive a new value.  The loop ends when the macro ends (line 57).  It is possible to end the message loop and not the macro by changing the value of vLoop.


Line 32

Creates a 10-element array named List.


Lines 33-37

Fills array with the names of 10 fruits.  Variable vElement identifies the element to fill.


Line 38

RETURN sends macro execution to CALL(CreateDlg).


Lines 39-47

LABEL(CreateDlg) creates a dialog box in memory.


Lines 42-44

A FORNEXT statement creates a list of names.  The Control parameter of DIALOGADDTEXT is set to 0 to allow this command to execute in a FORNEXT statement.  This is possible for controls that do not accept input.


Line 43

List is a 10-element array.  The initial value of variable yPos is also 10.  Dividing yPos by 10 reduces yPos to a number that corresponds to an element in the array.  DIALOGADDTEXT uses the number to display the contents of the corresponding element.


Line 44

ENDFOR closes the FORNEXT statement (line 42).


Line 45

Displays the first list item in a second column.


Line 46

Displays the initial thumb position.


Line 47

RETURN sends macro execution to CALL(DisplayDlg).


Lines 48-50

LABEL(DisplayDlg) displays the dialog box and identifies the callback function MsgLoop.  RETURN sends macro execution to CALL(StartMessageLoop).


Lines 51-54

LABEL(StartMessageLoop) starts the message loop that suspends the dialog box for callback functions (lines 61-74).  RETURN sends macro execution to CALL(QuitMacro).


Lines 55-57

LABEL(QuitMacro) removes the dialog box from memory and ends the macro.


Lines 58-60

Comments identify the callback function.


Lines 61-74

Callback function MsgLoop responds to three Windows messages and one Control parameter message.  See DIALOGSHOW.


Line 62

SWITCH tests the fifth element of the callback function array.  See DIALOGSHOW.


Lines 63-64

A WM_SYSCOMMAND message is received when the user chooses Close from the system menu box, double-clicks the system menu box, or presses Alt+F4.  Macro execution jumps to LABEL(QuitMacro).


Lines 65-66

A WM_VSCROLL message is received when the user clicks the scroll bar.  The macro calls LABEL(ScrollCtrl).


Lines 67-68

A WM_ACTIVATE message is received when the dialog box is activated.  The macro calls LABEL(MsgBox).


Line 69

ENDSWITCH closes the SWITCH statement (line 62).


Lines 70-73

SWITCH tests the third element of the callback function array and determines when Cancel is chosen.  See DIALOGSHOW.  An IF statement also works here.  There is often more than one choice to test.


Line 74

RETURN sends macro execution to the message loop (lines 52-53).


Lines 75-96

LABEL(ScrollCtrl) tests the wParam of the MW_VSCROLL message (line 76).


Line 76

SWITCH tests the sixth element(wParam value passed with WM_VSCROLL) of the callback function array to determine the mouse's location when clicked.


Lines 77-94

See DIALOGADDSCROLLBAR for details about WM_VSCROLL messages.


Lines 77-78

Scroll bar's right arrow clicked.  Call LABEL(LineUp).


Lines 79-80

Scroll bar's left arrow clicked.  Call LABEL(LineDown).


Lines 81-82

Area between the right arrow and thumb clicked.  Call LABEL(PageUp).


Lines 83-84

Area between the left arrow and thumb clicked.  Call LABEL(PageDown).


Lines 85-86

Position of thumb after it is dragged, passed as the low-order word of lParam in the seventh element of the callback function array.  Call LABEL(Thumb).


Lines 87-88

Current position of thumb as it is dragged, passed as the low-order word of lParam in the 7th element of the callback function array.  Call LABEL(Thumb).  Lines 87-88 call the same function as lines 85-86 and have comment marks (//).  To test lines 87-88, add comment marks (//) to lines 85-86 and remove them from 87 and 88 (see // Comment).


Lines 89-90

Home key pressed while the scroll bar has the input focus.  Call LABEL(PageUp).


Lines 91-92

End key pressed while the scroll bar has the input focus.  Call LABEL(PageDown).


Lines 93-94

Scroll bar activity has ended.  Display the current thumb position, contained in variable y.


Line 95

ENDSWITCH closes the SWITCH statement (line 76).


Line 96

RETURN sends macro execution to LABEL(MsgLoop) callback function.


Lines 97-101

LABEL(Thumb) retrieves the thumb position after it is dragged (MsgLoop[6] = SB_THUMBPOSITION), or as it is dragged (MsgLoop[6] = SB_THUMBTRACK).


Line 98

Assign the value of MsgLoop[7] (element 7 of the callback function array) to variable y.


Line 99

Calculate the low-order word of variable y using the bitwise AND operator.  See Bitwise Operators.  The value assigned to y is the current thumb position.


Line 100

Call LABEL(TypeFruit) to display the list item that corresponds to the current thumb position.


Line 101

RETURN sends macro execution to LABEL(ScrollCtrl).


Lines 102-109

LABEL(LineUp) is called when the right arrow is clicked to make the current line (value of y) equal to the current thumb position.


Lines 103-105

If the current line is not 1, assign the value of y - 1 to y, and call LABEL(TypeFruit) to display the list item that corresponds to the current thumb position.


Lines 106-107

Beep if the value of y equals 1 (if the first item is displayed).  (Try changing this so the last item is displayed.)


Line 108

ENDIF closes the IF statement (line 103).


Line 109

RETURN sends macro execution to LABEL(ScrollCtrl).


Lines 110-117

LABEL(LineDown) is called when the left arrow is clicked to make the current line (value of y) equal to the current thumb position.


Lines 111-113

If the current line is not 10, assign the value of y + 1 to y, and call LABEL(TypeFruit) to display the list item that corresponds to the current thumb position.


Lines 114-115

Beep if the value of y equals 10 (if the last item is displayed).  (Try changing this so the first item is displayed.)


Line 116

ENDIF closes the IF statement (line 111).


Line 117

RETURN sends macro execution to LABEL(ScrollCtrl).


Lines 118-121

LABEL(PageUp) is called when the area between the right arrow and thumb is clicked.


Line 119

Assign 1 to variable y to make 1 the current line and thumb position.


Line 120

Call LABEL(TypeFruit) to display the first list item on the first line.


Line 121

RETURN sends macro execution to LABEL(ScrollCtrl).


Lines 122-125

LABEL(PageDown) is called when the area between the left arrow and thumb is clicked.


Line 123

Assign 10 to variable y to make 10 the current line and thumb position.


Line 124

Call LABEL(TypeFruit) to display the last list item on the last line.


Line 125

RETURN sends macro execution to LABEL(ScrollCtrl).


Lines 126-131

LABEL(TypeFruit) displays a list item on the line that corresponds to the current thumb position.


Line 127

Assign blank spaces to variable vBlank to erase the previous list item when a new one is displayed.


Line 128

Erase the previous list item.  The vertical position is contained in variable vOldPos that has an initial value of 10 (line 26).  This value is updated (line 130) every time LABEL(TypeFruit) is called.


Line 129

Type a new list item at the current thumb position times 10 (the current line position).  The current thumb position (value of y) identifies the current list item (List[y]).


Line 130

Assign the current line position to variable vOldPos to be used (line 128) when this subroutine is called again.


Line 131

RETURN sends macro execution to the subroutine's caller.


Lines 132-137

LABEL(MsgBox) is called when the dialog box is activated (lines 67-68).  If you choose No, the dialog box is activated when the message box is dismissed and LABEL(MsgBox) is called again.  The message box is called until the user chooses Yes (lines 134-136).


Line 133

See MESSAGEBOX.


Lines 134-136

If variable vStatus equals 6 (Yes chosen), assign 0 to WM_ACTIVATE.  Changing the value of WM_ACTIVATE invalidates it as a Windows activate message (lines 30 and 67-68).


Line 137

RETURN sends macro execution to LABEL(MsgLoop) callback function.


For Example...

// Name: CB_SCBAR.WCM

// Directory: C:\PRWIN30\MACROS

// Description: Use DIALOGADDSCROLLBAR and a callback function

APPLICATION(WP; WPPrWin; Default; "US")

//*********************************************************

// MAIN CALL STATEMENTS

//*********************************************************

CALL(InitializeVariables)

CALL(CreateDlg)

CALL(DisplayDlg)

CALL(StartMessageLoop)

CALL(QuitMacro)

//*********************************************************

// MAIN LABEL STATEMENTS

//*********************************************************

LABEL(InitializeVariables)

SB_LINEUP := 0

SB_LINEDOWN := 1

SB_PAGEUP := 2

SB_PAGEDOWN := 3

SB_THUMBPOSITION := 4

SB_THUMBTRACK := 5

SB_TOP := 6

SB_BOTTOM := 7

SB_ENDSCROLL := 8

vOldPos := 10

y := 1

WM_SYSCOMMAND:= 274

WM_VSCROLL := 277

WM_ACTIVATE := 6

vLoop := 1

DECLARE List[10]

vElement := 1

FOREACH(vFruit; {"Apples"; "Oranges"; "Papaya"; "Grapes"; "Bananas"; "Pears"; "Watermelon"; "Apricots"; "Peaches"; "Plums"})

List[vElement] := vFruit

vElement := vElement + 1

ENDFOR

RETURN

LABEL(CreateDlg) // define dialog box and controls

DIALOGDEFINE(1000; 50; 50; 155; 160; 16; "Scroll Bar Callback Function")

DIALOGADDSCROLLBAR(1000; "Scroll"; 135; 10; 0; 100; 2 + 8;BarPos; 1; 10)

FORNEXT(yPos; 10; 100; 10)

 	DIALOGADDTEXT(1000; 0; 10; yPos; 40; 10; 2; List[yPos / 10])

ENDFOR

DIALOGADDTEXT(1000; 0; 60; 10; 40; 10; 1; "Apples")

DIALOGADDTEXT(1000; 0; 50; yPos + 15; 70; 10; 1; "Thumb Position   1")

RETURN

LABEL(DisplayDlg) // show dialog box

DIALOGSHOW (1000; 121; MsgLoop) // callback function = MsgLoop

RETURN

LABEL(StartMessageLoop)

WHILE(vLoop = 1) // message loop

ENDWHILE

RETURN

LABEL(QuitMacro)

DIALOGDESTROY(1000)

QUIT

//*********************************************************

// CALLBACK FUNCTION

//*********************************************************

LABEL(MsgLoop)

SWITCH(MsgLoop[5])

CASEOF WM_SYSCOMMAND:

GO(QuitMacro)

CASEOF WM_VSCROLL:

CALL(ScrollCtrl)

CASEOF WM_ACTIVATE:

CALL(MsgBox)

ENDSWITCH

SWITCH(MsgLoop[3])

CASEOF "CancelBttn":

GO(QuitMacro)

ENDSWITCH

RETURN

LABEL(ScrollCtrl)

SWITCH(MsgLoop[6])

CASEOF SB_LINEUP:

CALL(LineUp)

CASEOF SB_LINEDOWN:

CALL(LineDown)

CASEOF SB_PAGEUP:

CALL(PageUp)

CASEOF SB_PAGEDOWN:

CALL(PageDown)

CASEOF SB_THUMBPOSITION:

CALL(Thumb)

//CASEOF SB_THUMBTRACK:

//	CALL(Thumb)

CASEOF SB_TOP :

CALL(PageUp)

CASEOF SB_BOTTOM:

CALL(PageDown)

CASEOF SB_ENDSCROLL:

DIALOGADDTEXT(1000; 0; 107; 125; 10; 10; 1; y)

ENDSWITCH

RETURN

LABEL(Thumb)

y := MsgLoop[7]

y := y  & 65535

CALL(TypeFruit)

RETURN

LABEL(LineUp)

IF(NOT(y = 1))

y := y - 1

CALL(TypeFruit)

ELSE

BEEP

ENDIF

RETURN

LABEL(LineDown)

IF(NOT(y = 10))

y := y + 1

CALL(TypeFruit)

ELSE

BEEP

ENDIF

RETURN

LABEL(PageUp)

y := 1

CALL(TypeFruit)

RETURN

LABEL(PageDown)

y := 10

CALL(TypeFruit)

RETURN

LABEL(TypeFruit)

vBlank := "                         "

DIALOGADDTEXT(1000; 0; 60; vOldPos; 40; 10; 1; vBlank)

DIALOGADDTEXT(1000; 0; 60; y * 10; 40; 10; 1; List[y])

vOldPos := y * 10

RETURN

LABEL(MsgBox)

MESSAGEBOX(vStatus; "Message Box"; "Do you want to cancel this message?"; YesNo! | IconQuestion!)

IF(vStatus = 6)

WM_ACTIVATE := 0

ENDIF

RETURN


Macro: CALENDAR.WCM

DDE is a method of the Windows operating system that transfers commands and other information between applications.  For example, you can use DDE to execute GroupWise commands from Presentations.

CALENDAR.WCM opens the GroupWise 4.1 day calendar.  Click the comment buttons [image] for detailed explanations.  Click the example button above to copy CALENDAR.WCM to the Clipboard.

1	// Name: CALENDAR.WCM

2	// Directory: C:\PRWIN30\MACROS

3	// Description: Open GroupWise Day calendar

4	// Method: Dynamic Data Exchange

5	APPLICATION(WP; "WPPrWin"; Default; "US")

6	//*********************************************************

7	//	MAIN CALL STATEMENTS

8	//*********************************************************

9	CALL(IsGroupWiseRunning)

10	CALL(OpenDayCalendar)

11	CALL(QuitMacro)

12	//*********************************************************

13	//	MAIN LABEL STATEMENTS

14	//*********************************************************

15	LABEL(IsGroupWiseRunning)

16	IF(APPLOCATE("Novell GroupWise 4.1") = 0)

17	vPath := "c:\ofwin40\"

18	vResult := APPEXECUTEEXT(vPath + "ofwin.exe"; 0)  	19	IF(vResult < 32)

20	SWITCH(vResult)

21	CASEOF 2: CALL(FileNotFound)

22	CASEOF 3: CALL(PathNotFound)

23	DEFAULT: CALL(ErrorMsg)

24	ENDSWITCH

25	ENDIF

26	ENDIF

27	RETURN

28	LABEL(OpenDayCalendar)

29	ASSIGN(hDay; APPLOCATE("Day"))

30	IF(hDay)

31	APPACTIVATE(hDay)

32	ELSE

33	ASSIGN(hConv; DDEINITIATE("GROUPWISE"; "COMMAND"))

34	IF(hConv)

35	DDEEXECUTE(hConv; "ViewOpenNamed(ViewName:""Day""; ViewType:Calendar!)")

36	ELSE

37	CALL(QuitMacro)

38	ENDIF

39	ENDIF

40	RETURN

41	LABEL(QuitMacro)

42	DDETERMINATEALL

43	QUIT

44	//*********************************************************

45	//	SECONDARY LABEL STATEMENTS

46	//*********************************************************

47	LABEL(FileNotFound)

48	BEEP

49	ASSIGN(vMessage; "File not found - ending macro")

50	GO(DisplayMessage)

51	LABEL(PathNotFound)

52	BEEP

53	ASSIGN(vMessage; "Path not found - ending macro")

54	GO(DisplayMessage)

55	LABEL(ErrorMsg)

56	BEEP

57	ASSIGN(vMessage; "Unable to launch Novell GroupWise 4.1 - ending macro")

58	GO(DisplayMessage)

59	LABEL(DisplayMessage)

60	MESSAGEBOX(var; "ERROR"; vMessage; Ok! | IconExclamation!)

61	GO(QuitMacro)


Lines 1-4

Comments about the macro.


Line 2

Macros are generally saved to the default macros directory.


Line 5

Presentations identified as the default application.


Lines 6-8

Comments identify the opening CALL statements, which outline and define the macro's basic operations.


Line 9

Call LABEL(IsGroupWiseRunning) to determine if GroupWise is running.


Line 10

Call LABEL(OpenDayCalendar) to initiate a DDE conversation with GroupWise and send an Office command to open the Day calendar view.


Line 11

Call LABEL(QuitMacro) to end the macro.


Lines 12-14

Comments identify the main LABEL statements.


Lines 15-27

LABEL(IsGroupWiseRunning) determines if GroupWise is running.  If GroupWise is not running, this LABEL(IsGroupWiseRunning) starts it.


Line 16

APPLOCATE returns the GroupWise window handle if the window title is found, or returns 0 if not.  If 0 is returned, the next statement is executed (line 17).  If a window handle is returned, RETURN (line 27) sends macro execution to CALL(OpenDayCalendar).  Another way to write the statement is:

vResult := APPLOCATE("Novell GroupWise 4.1")

IF(vResult = 0)


Line 17

If necessary, change this line to the directory that contains the GroupWise program files.


Line 18

APPEXECUTEEXT returns the application handle if GroupWise is started (line 16), or returns an error value less than 32 if GroupWise is not started.  See APPEXECUTEEXT.


Line 19

If vResult is less than 32 (error occurred), execute SWITCH statement (lines 20-24).


Lines 20-23

IF vResult equals 2, call LABEL(FileNotFound).  If vResult equals 3, call LABEL(PathNotFound).  For any value less than 32, call LABEL(ErrorMsg).  See APPEXECUTEEXT for a list of error values.


Line 24

ENDSWITCH closes the SWITCH statement (line 20).


Line 25

ENDIF closes the IF statement (line 19).


Line 26

ENDIF closes the IF statement (line 16).


Line 27

RETURN sends macro execution to CALL(OpenDayCalendar).


Lines 28-40

LABEL(OpenDayCalendar) determines if the Day calendar view is already open.


Line 29

APPLOCATE returns the Calendar view window handle if the window title is found, or returns 0 if the window title is not found.  The handle or 0 is assigned to variable hDay.


Lines 30-31

If variable hDay equals a window handle (a non-zero number), use APPACTIVATE to activate the Calendar view.  The statement IF(hDay) is equivalent to IF(hDay <> 0).


Lines 32-33

IF variable hDay equals 0 (ELSE), initiate a conversation with GroupWise and assign the result to variable hConv.


Lines 34-35

If variable hConv equals a window handle (a non-zero number), execute the ViewOpenedNamed Office command.


Lines 36-37

If variable hConv equals 0 (conversation not initiated), call LABEL(QuitMacro).


Line 38

ENDIF closes IF statement (line 34).


Line 39

ENDIF closes IF statement (line 30).


Line 40

RETURN sends macro execution to CALL(QuitMacro).


Lines 41-43

LABEL(QuitMacro) ends the macro.


Lines 44-46

Comments identify the SECONDARY label statements.


Lines 47-50

LABEL(FileNotFound) beeps, assigns a file not found message to variable vMessage, and sends macro execution to LABEL(DisplayMessage).


Lines 51-54

LABEL(PathNotFound) beeps, assigns a path not found message to variable vMessage, and sends macro execution to LABEL(DisplayMessage).


Lines 55-58

LABEL(ErrorMsg) beeps, assigns an unknown error message to variable vMessage, and sends macro execution to LABEL(DisplayMessage).


Lines 59-61

LABEL(DisplayMessage) displays the appropriate error message and sends macro execution to LABEL(QuitMacro).


Line 60

MESSAGEBOX displays the contents of variable vMessage (lines 49, 53, and 57).


For Example...

// Name: CALENDAR.WCM

// Directory: C:\PRWIN30\MACROS

// Description: Open Novell GroupWise 4.1 Day calendar

// Method: Dynamic Data Exchange

APPLICATION(WP; "WPPrWin"; Default; "US")

//*********************************************************

//	MAIN CALL STATEMENTS

//*********************************************************

CALL(IsGroupWiseRunning)

CALL(OpenDayCalendar)

CALL(QuitMacro)

//*********************************************************

//	MAIN LABEL STATEMENTS

//*********************************************************

LABEL(IsGroupWiseRunning)

IF(APPLOCATE("Novell GroupWise 4.1") = 0)

vPath := "c:\ofwin40\"

vResult := APPEXECUTEEXT(vPath + "ofwin.exe"; 0)

IF(vResult < 32)

SWITCH(vResult)

CASEOF 2: CALL(FileNotFound)

CASEOF 3: CALL(PathNotFound)

DEFAULT: CALL(ErrorMsg)

ENDSWITCH

ENDIF

ENDIF

RETURN

LABEL(OpenDayCalendar)

ASSIGN(hDay; APPLOCATE("Day"))

IF(hDay)

APPACTIVATE(hDay)

ELSE

ASSIGN(hConv; DDEINITIATE("GROUPWISE"; "COMMAND"))

IF(hConv)

DDEEXECUTE(hConv; "ViewOpenNamed(ViewName:""Day""; ViewType:Calendar!)")

ELSE

CALL(QuitMacro)

ENDIF

ENDIF

RETURN

LABEL(QuitMacro)

DDETERMINATEALL

QUIT

//*********************************************************

//	SECONDARY LABEL STATEMENTS

//*********************************************************

LABEL(FileNotFound)

BEEP

ASSIGN(vMessage; "File not found - ending macro")

GO(DisplayMessage)

LABEL(PathNotFound)

BEEP

ASSIGN(vMessage; "Path not found - ending macro")

GO(DisplayMessage)

LABEL(ErrorMsg)

BEEP

ASSIGN(vMessage; "Unable to launch Novell GroupWise 4.1 - ending macro")

GO(DisplayMessage)

LABEL(DisplayMessage)

MESSAGEBOX(var; "ERROR"; vMessage; Ok! | IconExclamation!)

GO(QuitMacro)


Assigning Macros

You can assign macros to a key on a keyboard, to a Toolbar, or to a menu bar.

Keystroke Macros

Toolbar Macros

Menu Bar Macros


Keystroke Macros

Assign a macro to a keyboard key.

Steps

1	Choose Edit, Preferences, double-click Keyboard.

2	Choose Create, enter a keyboard definition name.

or

Highlight a keyboard definition, choose Edit.

3	Select a key, select Play a Macro, choose Assign Macro, enter the path and filename of a macro you want to play, choose Add.

To play a keystroke macro, press the key the macro is assigned to.


Toolbar Macros

Assign a macro to a Toolbar.

Steps

1	Choose Edit, Preferences, double-click Toolbar.

2	Choose Create, enter a Toolbar name.

or

Highlight a Toolbar definition, choose Edit.

3	Select Play a Macro, choose Add Macro, enter the path and filename of a macro you want to add, choose Add.

To play a Toolbar macro, choose the button the macro is assigned to.


Menu Bar Macros

You can assign macros to a customized menu bar.

Steps

1	Choose Edit, Preferences, double-click Menu Bar.

2	Choose Create, enter a menu bar name.

or

Highlight a menu bar, choose Edit.

3	To add a cascading menu, drag the menu icon to the menu bar.

or

Skip to step 5.

4	Double-click the new menu, enter the name of the menu item, enter a prompt message, OK.

5	Select Play a Macro, choose Add Macro, enter a macro path and filename, choose Add.

6	Drag the macro name to the new menu (step 3) or to another menu.

7	Double-click the macro name, enter the name of the menu item, enter a prompt message.

8	Choose OK, highlight a menu bar, choose Select, Close.


Macro Facility

Macro Facility is an application included with Presentations to record, play, compile, and convert macros created for Shared Code applications (Shared Code refers to programming code used by Novell Windows applications).

Macro Facility starts automatically when you record or play a macro from a Shared Code application.  If you play a macro for an application that is not running, Macro Facility automatically starts the application.

You can set Macro Facility options, including the default macro directory, editor, and extension in the Macro Facility Settings dialog box.  To display the dialog box, choose Settings, Options:

See Also

Compilers

Command-Based Macro Language

Compiler Errors

Run-time Errors


Compilers

In machine (computer) language, every word is a binary numeral consisting of zeros and ones.  For example, the first three letters of the alphabet in binary notation are 1000001, 1000010, and 1000011.  The binary result of 4 + 5 is 1001.  Because binary numerals are hard to work with, English-based programming languages (such as Basic, Pascal, and C) were created.  Programs written with the help of an editor or word-processor are saved as source files.  A compiler creates an object file, which is a copy of the source file translated into machine language.  Computers can execute only object files.

Macro languages are similar to programming languages.  Macros are written with an editor or word-processor and saved as a source file.  The macro compiler creates an object, which it saves in a hidden area of the source file (the macro compiler does not create a separate object file).  When you edit the source file, the object is destroyed.  It is recreated each time the source file is compiled.  Presentations can play only a source file with an object.  A compiled source file (macro) contains instructions that are executed when you play the macro.  See Record a Macro.


Command-Based Macro Language

A command-based macro language records keystrokes and/or mouse actions as commands.  It does not record the actual keystrokes.  For example, to display the Color Attributes dialog box, choose Format, Color, mark the check box in the dialog box title bar.  If you record these steps, your macro contains a product command named ColorAttributesDlg.


Compiler Errors

The compiler stops and displays a message when it discovers a macro syntax error (see Syntax).  The message contains information about the error and its location (the compiler makes a best guess and may not always be accurate).  Choose Cancel Compilation to dismiss the message box, or choose Continue Compilation to test for other errors.  You must correct all errors before a macro compiles.  See Macro Errors for common syntax errors.


Run time Errors

Run-time Errors

Run-time is the same as execution time.  Run-time errors occur while the macro is playing.  Referencing a variable that has not been assigned a value causes a run-time error.  See Macro Errors.


Coach Overview

A Coach takes the user through some of the product's most common tasks step-by-step, providing instructions and prompts as needed.  The Coach can either show the user how to perform the desired task or it can tell the user what to do and then monitor the user's actions to make sure no mistakes are made.

The Coach Support Routines allow Coaches to be written with macros for products that use Shared Code 2.x.

The support routines provide three types of functions:

Prompting

CoachMessageBox displays options for the user to select.  CoachPrompt displays helps and hints.

Animating

CoachAnimate shows the user how to perform certain actions.  The Coach can: (1) move the mouse pointer, (2) send mouse clicks, and (3) send keystrokes to the application.

Filtering

CoachFilterAdd defines a filter to monitor mouse movements, keystrokes, and tokens.  CoachFilterEnable activates the filter to compare defined events with current events.  For example, a filter may wait for a left mouse click in the OK button of a particular dialog, then move to the next step.  If the user makes a mistake, the Coach might display a message box or prompt.

CoachFilterDisable deactivates a filter and CoachFilterDestroy destroys a filter.

There are three types of filters: (1) mouse, (2) keyboard, and (3) command.  Mouse and keyboard filters are interface filters.

Named Region

A named region is a specific window or item on the screen, such as "GroupWise.EditWindow" and "GroupWise.OpenDlg.OpenBttn".  See Named Region in MOUSE STRING.

Writing the Coach

A Coach generally follows these steps.

Steps

1	Pause keyboard and mouse input until a Coach enables it.

2	Define filter.

3	Instruct the user how to perform a task with prompts, message boxes, and animation.

4	Enable filter.

5	Wait for user input.

6	Respond to user input with a callback procedure.

7	Disable filter.

8	Destroy filter.

9	Turn on keyboard and mouse input.

Define all filters at the beginning of a Coach macro, then enable each one as it is needed.  Repeat steps 2 through 8 as many times as necessary.

Quitting the Coach

Press Alt+Esc to quit the Coach.

Coach Dialog Box

Coaches have a .WCH extension and are stored in the macro directory.

When the user chooses Coach from the Help menu, the descriptive names of all .WCH files in the macros directory are displayed in the Coach dialog box.  When a Coach name is selected, the information from the Abstract field of the document summary is displayed at the bottom of the Coach dialog box.  If the Coach does not have a descriptive name, the filename is displayed.


DDE Conversations

DDE Execute is a Windows feature that enhances product integration by allowing applications to instruct each another to perform specific tasks (execute commands).  For example, using DDE Execute you can create macros in Presentations 3.0 that send commands to control other Windows applications.  In order for this to work, the other application must accept DDE Execute strings.  See DDEINITIATE, DDEEXECUTE, and DDETERMINATE .  Also, see the documentation for the other Windows application.  The information you need includes the service (application) name, topic name, and list of commands it will accept through DDE Execute.

In addition, Windows applications can use DDE Execute to control Presentations 3.0.  The application must first initiate a DDE conversation using the service (application) name of "WPPresentations" and topic name of "Command".  Before terminating the conversation, the application can send DDE Execute strings made up of one or more Presentations 3.0 macro commands.  Note that Presentations 3.0 will accept only product commands, not programming commands.  These product commands may not contain variables or expressions.

Windows applications can also send commands to Presentations 3.0 as a DDE Request item in order to receive a string representing the command's return value.  The application must send the DDE Execute string or DDE Request item in ANSI text format.  Presentations 3.0 will return the DDE Request result as an ANSI text string.  If either a DDE Execute string or a DDE Request item returns an error, the application can send a DDE Request on the item "LastCmdError" to find out what went wrong.  This item will return an ANSI text string containing a three-digit error code and a description of the error.  See DDEREQUEST.

DDE Execute Application Names, Services, and Topics:

Application	Service, Topic
GroupWise	GroupWise, Command
InfoCentral	WPIC, RunMacro
Envoy	Envoy, System
Presentations	WPPresentations, Command
Quattro Pro	QPW, <full path and filename of open notebook>
WPWin	WPWin60_Macros, Commands
Envoy and InfoCentral act as servers for DDE Execute, but not clients. This means that you can use DDE Execute in products to send commands to Envoy and InfoCentral, but you cannot use DDE Execute in Envoy or InfoCentral to send commands to other products. For information about the DDE commands you can use with Envoy and InfoCentral, see the Software Development Kits that are available for these products.


AboutDlg

Purpose

Displays the About Presentations dialog box, which contains product and license information.

Syntax

AboutDlg ()


Route...

Help, About Presentations, select the check box in the dialog box title bar.


AcquireImage

Purpose

Inserts a bitmap image generated by a scanner into the current drawing or slide show.  The computer must have a TWAIN driver installed to use this command.

Syntax

AcquireImage (Scale: enum; Left: numeric; Bottom: numeric; Right: numeric; Top: numeric)

Parameters

Scale: enum (optional)

Scaling option.

AreaBounded!

FixedSize!

PageBounded!

Left: numeric (optional)

Left coordinate of bounding rectangle.

Bottom: numeric (optional)

Bottom coordinate of bounding rectangle.

Right: numeric (optional)

Right coordinate of bounding rectangle.

Top: numeric (optional)

Top coordinate of bounding rectangle.


Route...

Insert, Acquire Image.


AcquireImageDlg

Purpose

Displays the Acquire Image dialog box, which is used to insert a bitmap image from a TWAIN source.

Syntax

AcquireImageDlg ()


Route...

Insert, Acquire Image, select the check box in the dialog box title bar.


AcquireImageSelect

Purpose

Displays the Image Source dialog box, which is used to specify a scanner from which to acquire an image.  The computer must have a TWAIN driver installed to use this command.

Syntax

AcquireImageSelect ()


Route...

Insert, Select Image Source.


AddArc

Purpose

Draws an arc or a circle using the Circle, Circular Arc, Elliptical Arc, or Ellipse drawing tool.

Syntax

AddArc (FillAndFrame: enum; XCenter: numeric; YCenter: numeric; HorizontalRadius: numeric; VerticalRadius: numeric; XInitial: numeric; YInitial: numeric; XTerminal: numeric; YTerminal: numeric; ArcFlags: enum)

Parameters

FillAndFrame: enum

Specifies whether the arc object is open or closed, whether object outline is on or off, and whether object fill is on or off.

Both!

ClosedFrame!

Filled!

OpenFrame!

XCenter: numeric

Horizontal coordinate for the center of the arc, in WordPerfect units (1200ths of an inch).

YCenter: numeric

Vertical coordinate for the center of the arc, in WordPerfect units.

HorizontalRadius: numeric

Horizontal coordinate for the radius of an elliptical arc, in WordPerfect units.

VerticalRadius: numeric

Vertical coordinate for the radius of an elliptical arc in WordPerfect units.

XInitial: numeric

Horizontal coordinate for the point which indicates the starting angle of an arc, in WordPerfect units.

YInitial: numeric

Vertical coordinate for the initial point of an arc, in WordPerfect units.

XTerminal: numeric

Horizontal coordinate for the point that indicates the ending angle of an arc, in WordPerfect units.

YTerminal: numeric

Vertical coordinate for the point that indicates the ending angle of an arc, in WordPerfect units.

ArcFlags: enum

How the endpoints of an arc connect.

Center_Connect!

End2End_Connect!

No_Connect!

See Also

BeginCircle

BeginCircularArc

BeginEllipticalArc

BeginEllipse


Route...

Insert, Drawing Tools, choose an arc tool (Circle, Circular Arc, Ellipse or Elliptical Arc), drag and release mouse to draw arc.


AddBackground

Purpose

Creates a new background.

Syntax

AddBackground (BackgroundName: string)

Parameters

BackgroundName: string

New background name.


Route...

Slide (or Layouts, in the Layout Editor), Edit Backgrounds, Backgrounds, Add Background, type a background name.


AddBackgroundDlg

Purpose

Displays the Add Background dialog box, which is used to create a new  background.

Syntax

AddBackgroundDlg ()


Route...

Slide, (or Layouts, in the Layout Editor), Edit Backgrounds, Backgrounds, Add Background, select the check box in the dialog box title bar.


AddLayout

Purpose

Adds a new layout to the current slide show master.

Syntax

AddLayout (LayoutName: string)

Parameters

LayoutName: string

New layout name.


Route...

Slide, (or Backgrounds, in the Background Editor), Edit Layouts, Layouts, Add Layout, type a name.


AddLayoutDlg

Purpose

Displays the Add Layout dialog box, which is used to add a new layout to the current slide show master.

Syntax

AddLayoutDlg ()


Route...

Slide, (or Backgrounds, in the Background Editor), Edit Layouts, Layouts, Add Layout, select the check box in the dialog box title bar.


AddPolyCurve

Purpose

Draws a curve using the Curve, Closed Curve, Bezier, Freehand, or Arrow drawing tool.

Syntax

AddPolyCurve (FillAndFrame: enum; BasePointCount: numeric; {XControl1: numeric; YControl1: numeric; XBase: numeric; YBase: numeric; XControl2: numeric; YControl2: numeric})

 Parameters

FillAndFrame: enum

Specifies whether the curve object is open or closed, whether object outline is on or off, and whether object fill is on or off.

Both!

ClosedFrame!

Filled!

OpenFrame!

BasePointCount: numeric

Number of base points in the curve.  Repeat the next six parameters for each base point, and enclose repeating parameters in braces {}.

XControl1: numeric

Horizontal coordinate of the first control point for a base point of the curve, in WordPerfect units (1200ths of an inch).

YControl1: numeric

Vertical coordinate of the first control point for a base point of the curve, in WordPerfect units.

XBase: numeric

Horizontal coordinate of a base point of the curve, in WordPerfect units.

YBase:  numeric

Vertical coordinate of the base point of the curve, in WordPerfect units.

XControl2: numeric

Horizontal coordinate for the second control point for a base point of the curve, in WordPerfect units.

YControl2: numeric

Vertical coordinate of the second control point for a base point of the curve, in WordPerfect units.

See Also

BeginArrow

BeginBezier

BeginClosedCurve

BeginCurve

BeginFreehand


Route...

Insert, Drawing Tools, choose a curve tool (Curve, Closed Curve, Bezier, Freehand, or Arrow), drag and release mouse to draw curve.


AddPolyLine

Purpose

Draws a line or a polygon using the Line, Polygon, Rectangle, or Regular Polygon drawing tool.

Syntax

AddPolyLine (FillAndFrame: enum; PointCount: numeric; {PointX: numeric; PointY: numeric})

Parameters

FillAndFrame: enum

Specifies whether the line object is open or closed, whether object outline is on or off, and whether object fill is on or off.

Both!

ClosedFrame!

Filled!

OpenFrame!

PointCount: numeric

Number of base points in a line.  The next two parameters are repeated for each base point.  Parameters that can be repeated are enclosed in braces {}.

PointX: numeric

Horizontal coordinate of a base point, in WordPerfect units (1200ths of an inch).

PointY: numeric

Vertical coordinate of a base point, in WordPerfect units.

See Also

BeginLine

BeginPolygon

BeginRectangle

BeginRegularPolygon


Route...

Insert, Drawing Tools, choose a line or polygon tool (Line, Polygon, Rectangle, or Regular Polygon), drag and release mouse to draw line or polygon.


AddRoundedRect

Purpose

Draws a rounded rectangle.

Syntax

AddRoundedRect (FillAndFrame: enum; LeftEdge: numeric; BottomEdge: numeric; RightEdge: numeric; TopEdge: numeric; HorizontalRadius: numeric; VerticalRadius: numeric)

Parameters

FillAndFrame: enum

Specifies whether object outline is on or off, and whether object fill is on or off for the rounded rectangle.

Both!

ClosedFrame!

Filled!

OpenFrame!

LeftEdge: numeric

Position of the left edge of the elliptical area of a rounded rectangle, in WordPerfect units (1200ths of an inch).

BottomEdge: numeric

Position of the bottom edge of the elliptical area of a rounded rectangle, in WordPerfect units.

RightEdge: numeric

Position of the right edge of the elliptical area of a rounded rectangle, in WordPerfect units.

TopEdge: numeric

Position of the top edge of the elliptical area of a rounded rectangle, in WordPerfect units.

HorizontalRadius: numeric

Horizontal radius of the corner ellipse, in WordPerfect units.

VerticalRadius: numeric

Vertical radius of the corner ellipse, in WordPerfect units.

See Also

BeginRoundedRectangle


Route...

Insert, Drawing Tools, Rounded Rectangle, drag and release mouse to draw rectangle.


AddSlide

Purpose

Adds one or more blank slides to the current slide show.  If no parameters are specified, this command adds one slide with the current template.

Syntax

AddSlide: (Count: numeric; TemplateName: string)

Parameters

Count: numeric (optional)

Number of slides to add.

TemplateName: string (optional)


Route...

Slide, Add Slides, specify a number of slides to add, specify a template.


AddSlideDlg

Purpose

Displays the Add Slide dialog box, which is used to add slides to the current slide show.

Syntax

AddSlideDlg ()


Route...

Slide, Add Slides, select the check box in the dialog box title bar.


AddTextBox

Purpose

Creates a text area or a text line.

Syntax

AddTextBox (LeftEdge: numeric; BottomEdge: numeric; RightEdge: numeric; TopEdge: numeric)

Parameters

LeftEdge: numeric

Specifies the left edge of a text box, in WordPerfect units (1200ths of an inch.)

BottomEdge: numeric

Specifies the bottom edge of a text box, in WordPerfect units.

RightEdge: numeric

Specifies the right edge of a text box, in WordPerfect units.

TopEdge: numeric

Specifies the top edge of a text box, in WordPerfect units.

See Also

TextBoxCreate

TextLineCreate


Route...

Insert, Text Area or Text Line, drag to create a text area or click to create a text line.


AirBrush

Purpose

Activates the Air Brush painting tool in the Bitmap Editor.

Syntax

AirBrush ()

See Also

BeginAirBrush


Route...

In the Bitmap Editor, choose Insert, Air Brush.


AlignCenterLeftRight

Purpose

Centers a selected object horizontally on the page, or aligns multiple selected objects with the horizontal center of the selection area.

Syntax

AlignCenterLeftRight ()


Route...

Select objects to align, Graphics, Align, Center Left/Right.


AlignObjectsBottom

Purpose

Aligns the bottom edge of a selected object with the bottom of the page, or aligns the bottom edges of multiple selected objects with the bottom edge of the lowest object.

Syntax

AlignObjectsBottom ()


Route...

Select objects to align, Graphics, Align, Bottom.


AlignObjectsCenter

Purpose

Centers a selected object on the page, or aligns the centers of multiple selected objects with the center of the selection area.

Syntax

AlignObjectsCenter ()


Route...

Select objects to align, Graphics, Align, Center Both.


AlignObjectsLeft

Purpose

Aligns the left edge of a selected object with the left edge of the page, or aligns the left edges of multiple selected objects with the left edge of the leftmost object.

Syntax

AlignObjectsLeft ()


Route...

Select objects to align, Graphics, Align, Left.


AlignObjectsRight

Purpose

Aligns a selected object with the right edge of the page, or aligns the right edges of multiple selected objects with the right edge of the rightmost object.

Syntax

AlignObjectsRight ()


Route...

Select objects to align, Graphics, Align, Right.


AlignObjectsTop

Purpose

Aligns the top edge of a selected object with the top of the page, or aligns the top edge of multiple selected objects with the top edge of the highest object.

Syntax

AlignObjectsTop ()


Route...

Select objects to align, Graphics, Align, Top.


AlignObjectsTopBottom

Purpose

Centers a selected object vertically on the page, or aligns multiple selected objects with the vertical center of the selection area.

Syntax

AlignObjectsTopBottom ()


Route...

Select objects to align, Graphics, Align, Center Top/Bottom.


ApplicationMaximize

Purpose

Maximizes the size of an application window.  If the window is already maximized, this command terminates the macro or redirects the macro to the LABEL specified by ONERROR.

Syntax

ApplicationMaximize ()


Route...

Click the Maximize button, or choose Maximize from the Presentations System Menu.


ApplicationMinimize

Purpose

Minimizes an application window to an icon.  If the window is already minimized, this command terminates the macro or redirects the macro to the LABEL specified by ONERROR.

Syntax

ApplicationMinimize ()


Route...

Click the Minimize button, or choose Minimize from the Presentations System Menu.


ApplicationMove

Purpose

Pauses a macro to allow you to reposition an application window.  Click the mouse or press Enter to continue playing the macro.  If the window is maximized, this command terminates the macro or redirects the macro to the LABEL specified by ONERROR.

Syntax

ApplicationMove ()


Route...

Choose Move from the Presentations System Menu, drag the window.


ApplicationRestore

Purpose

Restores a window to its previous size.  If the window has already been restored, this command terminates the macro or redirects the macro to the LABEL specified by ONERROR.

Syntax

ApplicationRestore ()


Route...

Choose Restore from the Presentations System Menu.


ApplicationSize

Purpose

Pauses a macro to allow you to resize a window.  Click the mouse or press Enter to continue playing the macro.  If the window is maximized, this command terminates the macro or redirects the macro to the LABEL specified by ONERROR.

Syntax

ApplicationSize ()


Route...

Choose Size from the Presentations System Menu, or drag to size the window.


AssignBackgroundDlg

Purpose

Displays the Assign Background dialog box, which is used to assign a  background to a specified layout.

Syntax

AssignBackgroundDlg ()

See Also

AssignLayoutBackground


Route...

Slide, Edit Layouts, Layouts, Assign Background, select the check box in the dialog box title bar.


AssignLayoutBackground

Purpose

Assigns a background to a specified layout.

Syntax

AssignLayoutBackground (LayoutName: string; BackgroundName: string)

Parameters

LayoutName: string

Layout to link to a background.

BackgroundName: string

Background to link to a layout.


Route...

Slide, Edit Layouts, Layouts, Assign Background, highlight a layout, select a background from the Available Backgrounds drop-down list.


BackgroundGetNext

Purpose

Selects the next background in the Background Name dialog box.

Syntax

BackgroundGetNext ()


Route...

Slide, Edit Backgrounds, Backgrounds, Name, click the right arrow button in the dialog box.


BackgroundGetPrevious

Purpose

Selects the previous background in the Background Name dialog box.

Syntax

BackgroundGetPrevious ()


Route...

Slide, Edit Backgrounds, Backgrounds, Name, click the left arrow button in the dialog box.


BackgroundNext

Purpose

Opens the next background in the Background Editor.

Syntax

BackgroundNext ()


Route...

Slide, Edit Backgrounds, right arrow button on the Power Bar (>>)


BackgroundPrevious

Purpose

Opens the previous background in the Background Editor.

Syntax

BackgroundPrevious ()


Route...

Slide, Edit Backgrounds, click the left arrow button on the Power Bar (<<).


Backspace

Purpose

Deletes the character to the left of the insertion point in the Text Editor.

Syntax

Backspace ()


Route...

In the Text Editor, press Backspace.


BeginAcquireImageArea

Purpose

Activates the tool used to define a rectangular area to contain a scanned image.  The image is scaled to fit inside the area, matching the closest width or height dimension of the area and maintaining the aspect ratio.  A scanning device with a TWAIN driver must be installed for this command to function.

Syntax

BeginAcquireImageArea ()


Route...

Insert, Acquire Image.


BeginAcquireImageFixedSize

Purpose

Activates the tool used to scan an image into a rectangular area.  The image is scaled to match both the width and height of the area.  The aspect ration is maintained if the scanning software supports it.  If not, the image width and height are scaled non-uniformly and the image may be distorted.  A scanning device with a TWAIN driver must be installed for this command to function.

Syntax

BeginAcquireImageFixedSize ()


Route...

Insert, Acquire Image.


BeginAirBrush

Purpose

Activates the Air Brush tool in the Bitmap Editor.

Syntax

BeginAirBrush ()

See Also

AirBrush


Route...

In the Bitmap Editor, choose Insert, Air Brush. Or, click the Air Brush bitmap icon.


BeginArrow

Purpose

Activates the Arrow drawing tool.

Syntax

BeginArrow ()

See Also

AddPolyCurve


Route...

Insert, Drawing Tools, Arrow.


BeginBezier

Purpose

Activates the Bezier Curve drawing tool.

Syntax

BeginBezier ()

See Also

AddPolyCurve


Route...

Insert, Drawing Tools, Bezier.


BeginBitmap

Purpose

Activates the Bitmap tool.

Syntax

BeginBitmap ()


Route...

Insert, Bitmap.


BeginBulletChart

Purpose

Activates the tool used to create a new bullet chart.

Syntax

BeginBulletChart ()

See Also

ChartCreateBullet


Route...

Insert, Bullet Chart.


BeginCircle

Purpose

Activates the Circle drawing tool.

Syntax

BeginCircle ()

See Also

AddArc


Route...

Insert, Drawing Tools, Circle.


BeginCircularArc

Purpose

Activates the Circular Arc drawing tool.

Syntax

BeginCircularArc ()

See Also

AddArc


Route...

Insert, Drawing Tools, Circular Arc.


BeginClosedCurve

Purpose

Activates the Closed Curve drawing tool.

Syntax

BeginClosedCurve ()

See Also

AddPolyCurve


Route...

Insert, Drawing Tools, Closed Curve.


BeginCurve

Purpose

Activates the Curve drawing tool.

Syntax

BeginCurve ()

See Also

AddPolyCurve


Route...

Insert, Drawing Tools, Curve.


BeginDataChart

Purpose

Activates the Data Chart drawing tool.

Syntax

BeginDataChart ()


Route...

Insert, Data Chart.


BeginEllipse

Purpose

Activates the Ellipse drawing tool.

Syntax

BeginEllipse ()

See Also

AddArc


Route...

Insert, Drawing Tools, Ellipse.


BeginEllipticalArc

Purpose

Activates the Elliptical Arc drawing tool.

Syntax

BeginEllipticalArc ()

See Also

AddArc


Route...

Insert, Drawing Tools, Elliptical Arc.


BeginFloodFill

Purpose

Activates Flood Fill in the Bitmap Editor.

Syntax

BeginFloodFill ()

See Also

FloodFill


Route...

In the Bitmap Editor, choose Insert, Flood Fill. Or, click the Flood Fill bitmap icon.


BeginFreehand

Purpose

Activates the Freehand drawing tool.

Syntax

BeginFreehand ()

See Also

AddPolyCurve


Route...

Insert, Drawing Tools, Freehand.


BeginLine

Purpose

Activates the Line drawing tool.

Syntax

BeginLine ()

See Also

AddPolyLine


Route...

Insert, Drawing Tools, Line.


BeginOrgChart

Purpose

Activates the tool used to create a new organization chart.

Syntax

BeginOrgChart ()

See Also

ChartCreateOrg


Route...

Insert, Organization Chart.


BeginPaintBrush

Purpose

Activates the Paint Brush tool in the Bitmap Editor.

Syntax

BeginPaintBrush ()

See Also

PaintBrush


Route...

In the Bitmap Editor, choose Insert, Paint Brush. Or, click the Paint Brush bitmap icon.


BeginPaintDropper

Purpose

Activates the Pickup Color tool in the Bitmap Editor.

Syntax

BeginPaintDropper ()

See Also

PaintDropper


Route...

In the Bitmap Editor, choose Insert, Pickup Color. Or, click the Pickup Color bitmap icon.


BeginPaintEraser

Purpose

Activates the Eraser tool in the Bitmap Editor.

Syntax

BeginPaintEraser ()

See Also

PaintEraser


Route...

In the Bitmap Editor, choose Insert, Eraser. Or, click the Eraser bitmap icon.


BeginPolygon

Purpose

Activates the Polygon drawing tool.

Syntax

BeginPolygon ()

See Also

AddPolyLine


Route...

Insert, Drawing Tools, Polygon.


BeginRectangle

Purpose

Activates the Rectangle drawing tool.

Syntax

BeginRectangle ()

See Also

AddPolyLine


Route...

Insert, Drawing Tools, Rectangle.


BeginRegularPolygon

Purpose

Activates the Regular Polygon drawing tool.

Syntax

BeginRegularPolygon ()

See Also

AddPolyLine


Route...

Insert, Drawing Tools, Regular Polygon.


BeginRetrieveFigure

Purpose

Activates the QuickArt drawing tool, which is used to insert a figure into the current document.

Syntax

BeginRetrieveFigure ()

See Also

RetrieveFigure


Route...

Insert, QuickArt.


BeginRoundedRectangle

Purpose

Activates the Rounded Rectangle drawing tool.

Syntax

BeginRoundedRectangle ()

See Also

AddRoundedRect


Route...

Insert, Drawing Tools, Rounded Rectangle.


BeginSelectArea

Purpose

Activates the tool used to select part of the current drawing in the Bitmap Editor.

Syntax

BeginSelectArea ()


Route...

In the Bitmap Editor, choose Edit, Select Area.


BeginSelectiveReplace

Purpose

Activates Selective Replace in the Bitmap Editor.

Syntax

BeginSelectiveReplace ()

See Also

SelectiveReplace


Route...

In the Bitmap Editor, choose Insert, Selective Replace. Or, click the Selective Eraser bitmap icon.


BegOfLine

Purpose

Moves the insertion point to the beginning of the current line of text.

Syntax

BegOfLine ()


Route...

In the Text Editor, press Home.


BitmapBlur

Purpose

Applies the Blur effect to the current bitmap image.

Syntax

BitmapBlur Region: enum, Left: numeric; Top: numeric; Right: numeric; Bottom: numeric; Amount: enum)

Parameters

Region: enum (optional)

Blur the full image or the portion inside or outside a selected area.

Full!

Inside!

Outside!

Left: numeric (optional)

Horizontal coordinate of the pixel in the top left corner of the selected area.  Coordinates are measured from the top left pixel of the bitmap area (0,0).

Top: numeric (optional)

Vertical coordinate of the pixel in the top left corner of the selected area.

Right: numeric (optional)

Horizontal coordinate of the pixel in the bottom right corner of the  selected area.

Bottom: numeric (optional)

Vertical coordinate of the pixel in the bottom right corner of the selected area.

Amount: enum

Amount of blurring.

High!

Low!

Medium!


Route...

In the Bitmap Editor, choose Tools, Special Effects, select Blur from the Effects list, specify Amount and Apply To options.


BitmapBrightness

Purpose

Changes the brightness of the current bitmap image.

Syntax

BitmapBrightness (Region: enum; Left: numeric; Top: numeric; Right: numeric; Bottom: numeric; Percent: numeric)

Parameters

Region: enum (optional)

Change the brightness of the full image or the portion inside or outside a selected area.

Full!

Inside!

Outside!

Left: numeric (optional)

Horizontal coordinate of the pixel in the top left corner of the selected area.  Coordinates are measured from the top left pixel of the bitmap area (0,0).

Top: numeric (optional)

Vertical coordinate of the pixel in the top left corner of the selected area.

Right: numeric (optional)

Horizontal coordinate of the pixel in the bottom right corner of the  selected area.

Bottom: numeric (optional)

Vertical coordinate of the pixel in the bottom right corner of the selected area.

Percent: numeric (optional)

Percentage by which to increase or decrease brightness.  A value of 50% specifies no change.


Route...

In the Bitmap Editor, choose Tools, Special Effects, select Brightness from the Effects list, specify a Percent and an Apply To option.


BitmapCancel

Purpose

Closes the Bitmap Editor without saving changes.

Syntax

BitmapCancel ()


Route...

In the Bitmap Editor, choose File, Cancel.


BitmapContrast

Purpose

Changes the contrast values for the current bitmap image.

Syntax

BitmapContrast (Region: enum; Left: numeric; Top: numeric; Right: numeric; Bottom: numeric; Percent: numeric)

Parameters

Region: enum (optional)

Change the contrast for the full image or the portion inside or outside a selected area.

Full!

Inside!

Outside!

Left: numeric (optional)

Horizontal coordinate of the pixel in the top left corner of the selected area.  Coordinates are measured from the top left pixel of the bitmap area (0,0).

Top: numeric (optional)

Vertical coordinate of the pixel in the top left corner of the selected area.

Right: numeric (optional)

Horizontal coordinate of the pixel in the bottom right corner of the  selected area.

Bottom: numeric (optional)

Vertical coordinate of the pixel in the bottom right corner of the selected area.

Percent: numeric (optional)

Percentage by which to increase or decrease contrast.  A value of 50% specifies no change.


Route...

In the Bitmap Editor, choose Tools, Special Effects, select Contrast from the Effects list, specify a Percent and an Apply To option.


BitmapCreate

Purpose

Opens the Bitmap Editor to create a new bitmap image.  If no parameters are specified, this command creates a full-page bitmap area.

Syntax

BitmapCreate (Left: numeric; Top: numeric; Right: numeric; Bottom: numeric)

Parameters

Left: numeric (optional)

Horizontal position of the lower left corner of the bitmap area, in WordPerfect units (1200ths of an inch).

Top: numeric (optional)

Vertical position of the lower left corner of the bitmap area, in WordPerfect units.

Right: numeric (optional)

Horizontal position of the upper right corner of the bitmap area, in WordPerfect units.

Bottom: numeric (optional)

Vertical position of the upper right corner of the bitmap area, in WordPerfect units.


Route...

Insert, Bitmap, click to create a full-page bitmap image or drag to define a bitmap area.


BitmapEmboss

Purpose

Applies the Emboss effect to the current bitmap image.

Syntax

BitmapEmboss (Region: enum; Left: numeric; Top: numeric; Right: numeric; Bottom: numeric)

Parameters

Region: enum (optional)

Emboss the full image or the portion inside or outside a selected area.

Full!

Inside!

Outside!

Left: numeric (optional)

Horizontal coordinate of the pixel in the top left corner of the selected area.  Coordinates are measured from the top left pixel of the bitmap area (0,0).

Top: numeric (optional)

Vertical coordinate of the pixel in the top left corner of the selected area.

Right: numeric (optional)

Horizontal coordinate of the pixel in the bottom right corner of the  selected area.

Bottom: numeric (optional)

Vertical coordinate of the pixel in the bottom right corner of the selected area.


Route...

In the Bitmap Editor, choose Tools, Special Effects, select Emboss from the Effects list, specify an Apply To option.


BitmapEqualize

Purpose

Applies the Equalize effect to the current bitmap image.

Syntax

BitmapEqualize (Region: enum; Left: numeric; Top: numeric; Right: numeric; Bottom: numeric)

Parameters

Region: enum (optional)

Equalize the full image or the portion inside or outside a selected area.

Full!

Inside!

Outside!

Left: numeric (optional)

Horizontal coordinate of the pixel in the top left corner of the selected area.  Coordinates are measured from the top left pixel of the bitmap area (0,0).

Top: numeric (optional)

Vertical coordinate of the pixel in the top left corner of the selected area.

Right: numeric (optional)

Horizontal coordinate of the pixel in the bottom right corner of the  selected area.

Bottom: numeric (optional)

Vertical coordinate of the pixel in the bottom right corner of the selected area.


Route...

In the Bitmap Editor, choose Tools, Special Effects, select Equalize from the Effects list, specify an Apply To option.


BitmapMosaic

Purpose

Applies the Mosaic effect to the current bitmap image.

Syntax

BitmapMosaic (Region: enum; Left: numeric; Top: numeric; Right: numeric; Bottom: numeric; Size: numeric)

Parameters

Region: enum (optional)

Apply the Mosaic effect to the full image or to the portion inside or outside a selected area.

Full!

Inside!

Outside!

Left: numeric (optional)

Horizontal coordinate of the pixel in the top left corner of the selected area.  Coordinates are measured from the top left pixel of the bitmap area (0,0).

Top: numeric (optional)

Vertical coordinate of the pixel in the top left corner of the selected area.

Right: numeric (optional)

Horizontal coordinate of the pixel in the bottom right corner of the  selected area.

Bottom: numeric (optional)

Vertical coordinate of the pixel in the bottom right corner of the selected area.


Route...

In the Bitmap Editor, choose Tools, Special Effects, select Mosaic from the Effects list, specify a Size and an Apply To option.


BitmapRain

Purpose

Applies the Rain effect to the current bitmap image.

Syntax

BitmapRain (Region: enum; Left: numeric; Top: numeric; Right: numeric; Bottom: numeric; Length: numeric)

Parameters

Region: enum (optional)

Apply the Rain effect to the full image or to the portion inside or outside a selected area.

Full!

Inside!

Outside!

Left: numeric (optional)

Horizontal coordinate of the pixel in the top left corner of the selected area.  Coordinates are measured from the top left pixel of the bitmap area (0,0).

Top: numeric (optional)

Vertical coordinate of the pixel in the top left corner of the selected area.

Right: numeric (optional)

Horizontal coordinate of the pixel in the bottom right corner of the  selected area.

Bottom: numeric (optional)

Vertical coordinate of the pixel in the bottom right corner of the selected area.

Length: numeric (optional)

Length of streaks, in pixels.


Route...

In the Bitmap Editor, choose Tools, Special Effects, select Rain from the Effects list, specify a Size and an Apply To option.


BitmapReturn

Purpose

Closes the Bitmap Editor and inserts the bitmap object into the current drawing.

Syntax

BitmapReturn ()


Route...

In the Bitmap Editor, choose File, Return.


BitmapSaturation

Purpose

Changes color saturation for the current bitmap image.

Syntax

BitmapSaturation (Region: enum; Left: numeric; Top: numeric; Right: numeric; Bottom: numeric; Percent: numeric)

Parameters

Region: enum (optional)

Specifies whether to change color saturation for the full image or for the portion inside or outside a selected area.

Full!

Inside!

Outside!

Left: numeric (optional)

Horizontal coordinate of the pixel in the top left corner of the selected area.  Coordinates are measured from the top left pixel of the bitmap area (0,0).

Top: numeric (optional)

Vertical coordinate of the pixel in the top left corner of the selected area.

Right: numeric (optional)

Horizontal coordinate of the pixel in the bottom right corner of the  selected area.

Bottom: numeric (optional)

Vertical coordinate of the pixel in the bottom right corner of the selected area.

Percent: numeric (optional)

Percentage by which to increase or decrease saturation.  A value of 50% specifies no change.


Route...

In the Bitmap Editor, choose Tools, Special Effects, select Saturation from the Effects list, specify a Percent and an Apply To option.


BitmapSharpen

Purpose

Applies the Sharpen effect to the current bitmap image.

Syntax

BitmapSharpen (Region: enum; Left: numeric; Top: numeric; Right: numeric; Bottom: numeric; Amount: enum)

Parameters

Region: enum (optional)

Specifies whether to sharpen the full image or the portion inside or outside a selected area.

Full!

Inside!

Outside!

Left: numeric (optional)

Horizontal coordinate of the pixel in the top left corner of the selected area.  Coordinates are measured from the top left pixel of the bitmap area (0,0).

Top: numeric (optional)

Vertical coordinate of the pixel in the top left corner of the selected area.

Right: numeric (optional)

Horizontal coordinate of the pixel in the bottom right corner of the  selected area.

Bottom: numeric (optional)

Vertical coordinate of the pixel in the bottom right corner of the selected area.

Amount: enum (optional)

Sharpness level.

High!

Low!

Medium!


Route...

In the Bitmap Editor, choose Tools, Special Effects, select Sharpen from the Effects list, specify Amount and Apply To options.


BitmapSmooth

Purpose

Applies the Smooth effect to the current bitmap image.

Syntax

BitmapSmooth (Region: enum; Left: numeric; Top: numeric; Right: numeric; Bottom: numeric; Amount: enum)

Parameters

Region: enum (optional)

Smooth the full image or the portion inside or outside a selected area.

Full!

Inside!

Outside!

Left: numeric (optional)

Horizontal coordinate of the pixel in the top left corner of the selected area.  Coordinates are measured from the top left pixel of the bitmap area (0,0).

Top: numeric (optional)

Vertical coordinate of the pixel in the top left corner of the selected area.

Right: numeric (optional)

Horizontal coordinate of the pixel in the bottom right corner of the  selected area.

Bottom: numeric (optional)

Vertical coordinate of the pixel in the bottom right corner of the selected area.

Amount: enum (optional)

Smoothness level.

High!

Low!

Medium!


Route...

In the Bitmap Editor, choose Tools, Special Effects, select Smooth from the Effects list, specify Amount and Apply To options.


BitmapSpecialEffectsDlg

Purpose

Displays the Special Effects dialog box in the Bitmap Editor, which is used to specify visual effects for a bitmap object.

Syntax

BitmapSpecialEffectsDlg ()


Route...

In the Bitmap Editor, choose Tools, Special Effects.


BitmapSpikeRemoval

Purpose

Removes spikes from the current bitmap image.

Syntax

BitmapSpikeRemoval (Region: enum; Left: numeric; Top: numeric; Right: numeric; Bottom: numeric; Amount: enum)

Parameters

Region: enum (optional)

Remove spikes from the full image or the portion inside or outside a selected area.

Full!

Inside!

Outside!

Left: numeric (optional)

Horizontal coordinate of the pixel in the top left corner of the selected area.  Coordinates are measured from the top left pixel of the bitmap area (0,0).

Top: numeric (optional)

Vertical coordinate of the pixel in the top left corner of the selected area.

Right: numeric (optional)

Horizontal coordinate of the pixel in the bottom right corner of the  selected area.

Bottom: numeric (optional)

Vertical coordinate of the pixel in the bottom right corner of the selected area.

Amount: enum (optional)

Smoothness level.

High!

Low!

Medium!


Route...

In the Bitmap Editor, choose Tools, Special Effects, select Spike Removal from the Effects list, specify Amount and Apply To options.


BitmapStereogram

Purpose

Applies the Stereogram effect to the current bitmap image.

Syntax

BitmapStereogram (Region: enum; Left: numeric; Top: numeric; Right: numeric; Bottom: numeric)

Parameters

Region: enum

Apply effect to the full image or the portion inside or outside a selected area.

Full!

Inside!

Outside!

Left: numeric (optional)

Horizontal coordinate of the pixel in the top left corner of the selected area.  Coordinates are measured from the top left pixel of the bitmap area (0,0).

Top: numeric (optional)

Vertical coordinate of the pixel in the top left corner of the selected area.

Right: numeric (optional)

Horizontal coordinate of the pixel in the bottom right corner of the  selected area.

Bottom: numeric (optional)

Vertical coordinate of the pixel in the bottom right corner of the selected area.


Route...

In the Bitmap Editor, choose Tools, Special Effects, select Stereogram from the Effects list.


BitmapTrace

Purpose

Converts a bitmap image into a vector image.

Syntax

BitmapTrace ()


Route...

Select a bitmap object, Graphics, Trace Bitmap.


BitmapTraceContours

Purpose

Traces the edge of a bitmap object.

Syntax

BitmapTraceContours ()


Route...

In the Bitmap Editor, choose Tools, Special Effects, select Trace Contours from the Effects drop-down list.


BitmapUndo

Purpose

Reverses the effects of the most recent editing change in the Bitmap Editor.

Syntax

BitmapUndo ()


Route...

In the Bitmap Editor, choose Edit, Undo.


BitmapWind

Purpose

Applies the Wind effect to a selected bitmap object.

Syntax

BitmapWind ()


Route...

In the Bitmap Editor, choose Tools, Special Effects, select Wind from the Effects list box.


BitmapZoom

Purpose

Toggles magnification in the Bitmap Editor so you can edit a bitmap area one pixel at a time.

Syntax

BitmapZoom (Direction: enum)

Parameters

Direction: enum (optional)

In!

Out!


Route...

In the Bitmap Editor, choose View, Zoom.


BlackAndWhite

Purpose

Changes the colors of selected objects to black and white.

Syntax

BlackAndWhite ()


Route...

Select objects to modify, choose Format, Image Settings, Black and White.


BlendDlg

Purpose

Displays the Blend dialog box, which is used to combine the shapes, sizes, and colors of two selected objects.

Syntax

BlendDlg ()


Route...

Select two objects, choose Graphics, Blend, select the check box in the dialog box title bar.


BlendObjects

Purpose

Combine the shapes, sizes, and colors of two selected objects.

Syntax

BlendObjects (BlendSteps: numeric)

Parameters

BlendSteps: numeric (optional)

Number of blending steps.


Route...

Select two objects, choose Graphics, Blend, specify a number of steps.


BoxAttributesDlg

Purpose

BoxAttributesDlg displays the Box Attributes dialog box, which is used in charts to change box colors, appearance, and style.

Syntax

BoxAttributesDlg ()


Route...

In an organization chart, choose Chart, Box Attributes, select the check box in the dialog box title bar.


BrushAttributesDlg

Purpose

Displays the Brush Attributes dialog box, which is used in the Bitmap Editor to specify brush shape, width, and spray density.

Syntax

BrushAttributesDlg ()


Route...

In the Bitmap Editor, choose Format, Brush, select the check box in the dialog box title bar.


BulletChartAttrEnd

Purpose

Closes a command sequence used to specify bullet chart attributes.  Precede with BulletChartAttrStart and commands which specify attributes, such as SetBorder.

Syntax

BulletChartAttrEnd (SaveTo: enum)

Parameters

SaveTo: enum (optional)

Specifies where to save style information.

Chart!

Layout!


Route...

In a bullet chart, choose Format, Define Bullets/Fonts, specify options.


BulletChartAttrStart

Purpose

Begins a command sequence used to specify bullet chart attributes.  Follow with commands which specify attributes, such as SetBorder, and with BulletChartAttrEnd.

Syntax

BulletChartAttrStart ()


Route...

In a bullet chart, choose Format, Define Bullets/Fonts, specify options.


ChartArea

Purpose

Changes the current chart to an area chart.

Syntax

ChartArea ()


Route...

In a data chart, choose Chart, Type, Area.


ChartAttributesDlg

Purpose

Displays the Fill Attributes dialog box in the Chart Editor.

Syntax

ChartAttributesDlg ()


Route...

In a data chart, select an object to modify, choose Format, Fill Attributes, select the check box in the dialog box title bar.


ChartAutoRedraw

Purpose

Automatically updates a chart's Datasheet when data changes.

Syntax

ChartAutoRedraw ()


Route...

In a data chart, choose View, Auto Redraw.


ChartBar

Purpose

Changes the current chart to a bar chart.

Syntax

ChartBar ()


Route...

In a data chart, choose Chart, Type, Bar.


ChartBoxAttributesDlg

Purpose

Displays the Box Attributes dialog box, which is used to specify text box options for charts.

Syntax

ChartBoxAttributesDlg ()


Route...

In a data chart, select a text box (such as a title box), choose Format, Box Attributes, select the check box in the dialog box title bar.


ChartClearAll

Purpose

Clears all data or text from the current chart.

Syntax

ChartClearAll ()


Route...

In a data chart, choose Edit, Clear All.


ChartClearDlg

Purpose

Displays the Clear dialog box, which is used to erase chart data and/or format.

Syntax

ChartClearDlg ()


Route...

In a data chart, choose Edit, Clear, select the check box in the dialog box title bar.


ChartClose

Purpose

Closes the Chart Editor and inserts the chart into the current drawing.

Syntax

ChartClose ()


Route...

In a data chart, click outside the chart frame.


ChartCopy

Purpose

Copies selected data or text from a chart to the Clipboard.

Syntax

ChartCopy ()


Route...

In a data chart, select Datasheet cells to copy, choose Edit, Copy.


ChartCreate

Purpose

Creates new data chart.  Precede with BeginDataChart and ChartSetCreateSize.

Syntax

ChartCreate (Type: enum; GalleryStyle: enum; SampleData: enum; ThreeDChart: enum)

Parameters

Type: enum

Type of chart to create.

Area!

Bar!

Gallery!

HiLo!

Line!

Pie!

Radar!

Scatter!

Surface!

GalleryStyle: enum

Button number in the Chart Gallery.

Button1!

Button2!

Button3!

Button4!

Button5!

Button6!

SampleData: enum

Use sample data.

No!

Yes!

ThreeDChart: enum

Make the new chart appear three dimensional.

No!

Yes!


Route...

Insert, Data Chart, click or drag to create a chart area, select a chart type.


ChartCreateBullet

Purpose

Creates a new bullet chart.

Syntax

ChartCreateBullet ()

See Also

BeginBulletChart


Route...

Insert, Bullet Chart, click or drag to define chart area.


ChartCreateDlg

Purpose

Displays the Create Data Chart dialog box, which is used to create a new data chart.

Syntax

ChartCreateDlg ()


Route...

Insert, Data Chart, click or drag to define a chart area, select the check box in the dialog box title bar.


ChartCreateOrg

Purpose

Creates a new organization chart.

Syntax

ChartCreateOrg (GalleryStyle: enum)

Parameters

GalleryStyle: enum

Button number in the Chart Gallery.

Button1!

Button2!

Button3!

Button4!

Button5!

Button6!

Button7!

Button8!

Button9!

Button10!

Button11!

Button12!

Button13!

Button14!

Button15!

Button16!

Button17!

Button18!

Button19!

Button20!

See Also

BeginOrgChart


Route...

Insert, Organization Chart, click or drag to define a chart area.


ChartCreateOrgDlg

Purpose

Displays the Organization Chart dialog box, which is used to create a new organization chart.

Syntax

ChartCreateOrgDlg ()


Route...

Insert, Organization Chart, click or drag to define chart area, select the check box in the dialog box title bar.


ChartCut

Purpose

Moves selected data or text from a chart to the Clipboard.

Syntax

ChartCut ()


Route...

In a data chart, select Datasheet cells to cut, choose Edit, Cut.


ChartDataAxisDlg

Purpose

Displays the Axis Options dialog box, which is used to modify the display of axes in data charts.

Syntax

ChartDataAxisDlg ()


Route...

In a data chart, choose Chart, Axis, select the check box in the dialog box title bar.


ChartDataColWidthDlg

Purpose

Displays the Column Width dialog box, which is used to edit the width of chart's Datasheet columns.

Syntax

ChartDataColWidthDlg ()


Route...

In a data chart, choose Data, Column Width, select the check box in the dialog box title bar.


ChartDataExcludeDlg

Purpose

Displays the Exclude dialog box, which is used to exclude specified rows or columns in a chart's Datasheet so the data they contain is not charted.

Syntax

ChartDataExcludeDlg ()


Route...

In a data chart, select Datasheet cells to exclude, choose Data, Exclude Row/Col, select the check box in the dialog box title bar.


ChartDataFillDlg

Purpose

Displays the Data Fill dialog box, which is used to fill chart's Datasheet cells with a series of numbers or dates.

Syntax

ChartDataFillDlg ()


Route...

In a data chart, select Datasheet cells to fill, choose Data, Fill, select the check box in the dialog box title bar.


ChartDataFormatDlg

Purpose

Displays the Format dialog box, which is used to change the number format or date format of selected chart's Datasheet cells.

Syntax

ChartDataFormatDlg ()


Route...

In a data chart, choose Data, Format, select the check box in the dialog box title bar.


ChartDataFormulasDlg

Purpose

Displays the Row/Column Formulas dialog box, which is used to enter formulas in a chart's Datasheet.

Syntax

ChartDataFormulasDlg ()


Route...

In a data chart, go to a Datasheet cell in which to enter a formula, choose Data, Formulas, select the check box in the dialog box title bar.


ChartDataFrameDlg

Purpose

Displays the Frame dialog box, which is used to modify a chart frame and base height.

Syntax

ChartDataFrameDlg ()


Route...

In a data chart, choose Chart, Frame, select the check box in the dialog box title bar.


ChartDataGridTickDlg

Purpose

Displays the Grid and Tick Options dialog box, which is used to modify display of grids and ticks in a data chart.

Syntax

ChartDataGridTickDlg()


Route...

In a data chart, choose Chart, Grid/Tick, select the check box in the dialog box title bar.


ChartDataIncludeDlg

Purpose

Displays the Include dialog box, which is used to chart only the data contained in selected rows or columns of a chart's Datasheet.

Syntax

ChartDataIncludeDlg ()


Route...

In a data chart, select Datasheet cells to include, choose Data, Include Row/Col, select the check box in the dialog box title bar.


ChartDataLabelsDlg

Purpose

Displays the Labels dialog box, which is used to edit axis labels, data labels, or table text in a data chart.

Syntax

ChartDataLabelsDlg ()


Route...

In a data chart, choose Chart, Labels, select the check box in the dialog box title bar.


ChartDataLayoutDlg

Purpose

Displays the Layout dialog box, which is used to modify the depth, size, and display of a data chart.

Syntax

ChartDataLayoutDlg ()


Route...

In a data chart, choose Chart, Layout, select the check box in the dialog box title bar.


ChartDataLegendDlg

Purpose

Displays the Legend dialog box, which is used to display, hide, or move a chart's legend.

Syntax

ChartDataLegendDlg ()


Route...

In a data chart, choose Chart, Legend, select the check box in the dialog box title bar.


ChartDataPerspectiveDlg

Purpose

Displays the Perspective Options dialog box, which is used to change the angle from which a data chart is viewed.

Syntax

ChartDataPerspectiveDlg ()


Route...

In a data chart, choose Chart, Perspective, select the check box in the dialog box title bar.


ChartDataRecalc

Purpose

Recalculates the current data chart after new data has been entered.

Syntax

ChartDataRecalc ()


Route...

In a data chart, choose Data, Recalculate.


ChartDataSeriesDlg

Purpose

Displays the Series Options dialog box, which is used to change the way a row of data is graphically represented in a chart's Datasheet.

Syntax

ChartDataSeriesDlg ()


Route...

In a data chart, choose Chart, Series, select the check box in the dialog box title bar.


ChartDataSortDlg

Purpose

Displays the Sort Data dialog box, which is used to sort chart data in ascending or descending order.

Syntax

ChartDataSortDlg ()


Route...

In a data chart, select Datasheet cells to sort, choose Data, Sort, select the check box in the dialog box title bar.


ChartDataStatisticsDlg

Purpose

Displays the Statistics dialog box, which displays statistical calculations of selected chart data.

Syntax

ChartDataStatisticsDlg ()


Route...

In a data chart, select Datasheet cells, choose Data, Statistics, select the check box in the dialog box title bar.


ChartDataTitlesDlg

Purpose

Displays the Titles dialog box, which is used to define titles for a chart and its axes.

Syntax

ChartDataTitlesDlg ()


Route...

In a data chart, choose Chart, Titles, select the check box in the dialog box title bar.


ChartDeleteDlg

Purpose

Displays the Delete dialog box, which is used to remove selected rows or columns from a chart's Datasheet.

Syntax

ChartDeleteDlg ()


Route...

In a data chart, select Datasheet rows or columns to delete, choose Edit, Delete, select the check box in the dialog box title bar.


ChartEdit

Purpose

Activates editing mode for the current chart.

Syntax

ChartEdit (StyleButtonNum: enum; ChartType: enum; SampleData: enum; ThreeD: enum)

Parameters

StyleButtonNum: enum (optional)

Gallery button number.  Data charts (1-7), organization charts (1-20).

Button1!

Button2!

Button3!

Button4!

Button5!

Button6!

Button7!

Button8!

Button9!

Button10!

Button11!

Button12!

Button13!

Button14!

Button15!

Button16!

Button17!

Button18!

Button19!

Button20!

ChartType: enum (optional)

Data chart type.

Area!

HiLo!

HorzBar!

Line!

Mixed!

Pie!

Radar!

Scatter!

Surface!

Table!

VertBar!

SampleData: enum (optional)

Use sample data.

No!

Yes!

ThreeD: enum (optional)

Three dimensional appearance.

No!

Yes!


Route...

Select a chart, Edit, Edit Chart.  Or, double-click a chart.


ChartEditCellDlg

Purpose

Displays the Edit Current Cell dialog box, which is used to edit specified chart data.

Syntax

ChartEditCellDlg ()


Route...

In a data chart, select a Datasheet cell, choose Edit, Edit Cell, select the check box in the dialog box title bar.


ChartFillAttributesDlg

Purpose

Displays the Fill Attributes dialog box, which is used to specify fill options for chart objects.

Syntax

ChartFillAttributesDlg ()


Route...

In a data chart, select a chart object (such as a bar in a bar chart), choose Format, Fill Attributes, select the check box in the dialog box title bar.


ChartFontAttributesDlg

Purpose

Displays the Text Attributes dialog box, which is used to specify the appearance of chart text.

Syntax

ChartFontAttributesDlg ()


Route...

In a data chart, select chart text to modify, choose Format, Text Attributes, select the check box in the dialog box title bar.


ChartFontDlg

Purpose

Displays the Font dialog box, which is used to specify a font for chart text.

Syntax

ChartFontDlg ()


Route...

In a data chart, select chart text, choose Format, Font, select the check box in the dialog box title bar.


ChartGallery

Purpose

Displays the Chart Gallery, which is used to view and retrieve chart layouts.

Syntax

ChartGallery (StyleButtonNumber: enum; GalleryType: enum; ThreeD: enum)

Parameters

StyleButtonNumber: enum

Gallery button number.  Data charts (1-7), organization charts (1-20).

Button1!

Button2!

Button3!

Button4!

Button5!

Button6!

Button7!

Button8!

Button9!

Button10!

Button11!

Button12!

Button13!

Button14!

Button15!

Button16!

Button17!

Button18!

Button19!

Button20!

GalleryType: enum (optional)

Chart type.

Area!

HiLo!

HorzBar!

Mixed!

Org!

Pie!

Radar!

Scatter!

Surface!

Table!

VertBar!

ThreeD: enum (optional)

Display three dimensional data charts only.

No!

Yes!


Route...

In a data chart or an organization chart, choose Chart, Gallery, specify options.


ChartGalleryDlg

Purpose

Displays the Data Chart gallery or the Organization Chart gallery, which show predefined chart styles.

Syntax

ChartGalleryDlg ()


Route...

In a data chart or an organization chart, choose Chart, Gallery, select the check box in the dialog box title bar.


ChartGotoCell2

Purpose

Places the insertion point in the Datasheet cell corresponding to a selected data chart object.

Syntax

ChartGotoCell2 ()


Route...

Click the right mouse button on a chart object, choose Go To Cell.


ChartGotoCellDlg

Purpose

Displays the Go To dialog box, which is used to move the insertion point to a specified cell in a chart's Datasheet.

Syntax

ChartGotoCellDlg ()


Route...

In a chart's Datasheet, choose Edit, Go To Cell, select the check box in the dialog box title bar.


ChartHiLo

Purpose

Changes the current chart to a high/low chart.

Syntax

ChartHiLo ()


Route...

In a data chart, choose Chart, Type, High/Low.


ChartInsertDataDlg

Purpose

Displays the Insert dialog box, which is used to add rows or columns to a chart's Datasheet.

Syntax

ChartInsertDataDlg ()


Route...

In a chart's Datasheet, choose Edit, Insert, select the check box in the dialog box title bar.


ChartLine

Purpose

Changes the current chart to a line chart.

Syntax

ChartLine ()


Route...

In a data chart, choose Chart, Type, Line.


ChartLineAttributesDlg

Purpose

Displays the Line Attributes dialog box in the Chart Editor, which is used to define the appearance of lines used in charts.

Syntax

ChartLineAttributesDlg ()


Route...

In a data chart, select lines to modify, choose Format, Line Attributes, select the check box in the dialog box title bar.


ChartOpenFileDlg

Purpose

Displays the Import Data dialog box, which is used to retrieve data or text into a chart's Datasheet.

Syntax

ChartOpenFileDlg ()


Route...

In a chart's Datasheet, choose Data, Import, select the check box in the dialog box title bar.


ChartOrDataWindowNext

Purpose

Moves the insertion point between a data chart and a Datasheet.

Syntax

ChartOrDataWindowNext ()


Route...

In a data chart, press F6.


ChartPaste

Purpose

Retrieves Clipboard contents into the current chart's Datasheet at the insertion point.

Syntax

ChartPaste ()

See Also

ChartCopy

ChartCut


Route...

After cutting or copying Datasheet contents in a data chart, choose Edit, Paste.


ChartPasteTranspose

Purpose

Moves chart data from rows to columns or from columns to rows when retrieved from the clipboard.

Syntax

ChartPasteTranspose ()


Route...

In a data chart, select Datasheet cells to transpose, choose Edit, Cut or Copy, place the insertion point in the first cell to contain pasted data, choose Edit, Paste Transposed.


ChartPie

Purpose

Changes the current chart to a pie chart.

Syntax

ChartPie ()


Route...

In a data chart, choose Chart, Type, Pie.


ChartRadar

Purpose

Changes the current chart to a radar chart.

Syntax

ChartRadar ()


Route...

In a data chart, choose Chart, Type, Radar.


ChartSaveAsDlg

Purpose

Displays the Export Chart Data dialog box, which is used to save chart data in a specified format.

Syntax

ChartSaveAsDlg ()


Route...

In a chart's Datasheet, choose Data, Export, select the check box in the dialog box title bar.


ChartScatter

Purpose

Changes the current chart to a scatter chart.

Syntax

ChartScatter ()


Route...

In a data chart, choose Chart, Type, Scatter.


ChartSelectAll

Purpose

Selects all cells in a chart's Datasheet.

Syntax

ChartSelectAll ()


Route...

In chart's Datasheet, choose Edit, Select All.


ChartSelectBox

Purpose

Selects a text box in the current data chart.

Syntax

ChartSelectBox (BoxType: enum)

Parameters

BoxType: enum

Type of text box.

DataLabels!

Legend!

PieLabels!

Subtitle!

Title!


Route...

In a data chart, click to select a text box.


ChartSelectFrameBase

Purpose

Selects a frame or base in the current data chart.  Not valid for pie charts.

Syntax

ChartSelectFrameBase (Frame: enum)

Parameters

Frame: enum

Position of frame or base.

Back!

Bottom!

Front!

Left!

Right!

Top!


Route...

In a data chart, click to select a frame or base.


ChartSelectGTA

Purpose

Selects a grid, tick, or axis in the current data chart.

Syntax

ChartSelectGTA (GridTickAxis: enum; AxisType: enum)

Parameters

GridTickAxis: enum

Type of grid, tick, or axis.

Axis!

GridMajor!

GridMinor!

TickMajor!

TickMinor!

AxisType: enum

Type of axis.

X!

Y1!

Y2!


Route...

In a data chart, click to select a grid, tick, or axis.


ChartSelectNext

Purpose

Selects the next chart object in the current data chart.

Syntax

ChartSelectNext ()


Route...

In a data chart, press Ctrl+N.


ChartSelectPieWedge

Purpose

Selects a specified pie wedge in the current pie chart.

Syntax

ChartSelectPieWedge (PieNumber: numeric; WedgeNumber: numeric)

Parameters

PieNumber: numeric

Pie number.

WedgeNumber: numeric

Pie wedge number.


Route...

In a pie chart, click to select a pie wedge.


ChartSelectPrev

Purpose

Selects the previous chart object in the current data chart.

Syntax

ChartSelectPrev ()


Route...

In a data chart, press Ctrl+P.


ChartSelectSeries

Purpose

Selects a specified series (a row of data) in the current data chart.

Syntax

ChartSelectSeries (RowNumber: numeric)

Parameters

RowNumber: numeric

Series row number.


Route...

In a data chart, click to select a series.


ChartSelectText

Purpose

Selects the text within a text box in the current data chart.

Syntax

ChartSelectText (TextType: enum)

Parameters

TextType: enum

Type of chart text.

DataLabels!

LegendSeries!

LegendTitle!

PieLabels!

Subtitle!

TableCells!

Title!

XAxisTitle!

XLabels!

Y1AxisTitle!

Y1Labels!

Y2AxisTitle!

Y2Labels!


Route...

In a data chart, click to select text.


ChartSetAbove

Purpose

Displays labels above data points in the current data chart.  Not valid for pie charts.

Syntax

ChartSetAbove ()


Route...

In a data chart with labels displayed below data points, move the pointer to a label, click the right mouse button, choose Above.


ChartSetAxisTitleHorz

Purpose

Displays a data chart axis title horizontally.

Syntax

ChartSetAxisTitleHorz ()


Route...

In a data chart, select a vertical axis title, click the right mouse button, choose Horizontal.


ChartSetAxisTitleVert

Purpose

Displays a data chart axis title vertically.

Syntax

ChartSetAxisTitleVert ()


Route...

In a data chart, select a horizontal axis title, click the right mouse button, choose Vertical.


ChartSetBack

Purpose

Displays the back frame in the current data chart.

Syntax

ChartSetBack ()


Route...

In a data chart, select a frame, click the right mouse button, choose Display, Back.


ChartSetBelow

Purpose

Displays labels below the data point in the current data chart.

Syntax

ChartSetBelow ()


Route...

In a data chart with labels displayed above data points, click the right mouse button over a label, choose Below.


ChartSetBottom

Purpose

Displays the bottom frame in the current data chart.

Syntax

ChartSetBottom ()


Route...

In a data chart, select a frame, click the right mouse button, choose Display, Bottom.


ChartSetCenter

Purpose

Centers the current data chart title.

Syntax

ChartSetCenter ()


Route...

In a data chart, click the right mouse button over a title, choose Position, Center.


ChartSetCreateSize

Purpose

Specifies the size of a new chart.

Syntax

ChartSetCreateSize (Left: numeric; Bottom: numeric; Right: numeric; Top: numeric)

Parameters

Left: numeric

Left coordinate of a new chart, in WordPerfect units (1200ths of an inch).

Bottom: numeric

Bottom coordinate of a new chart, in WordPerfect units.

Right: numeric

Right coordinate of a new chart, in WordPerfect units.

Top: numeric

Top coordinate of a new chart, in WordPerfect units.


Route...

Insert, Data Chart, drag to define a chart area.


ChartSetFront

Purpose

Displays the front frame in the current data chart.

Syntax

ChartSetFront ()


Route...

In a data chart, click the right mouse button over a frame, click the right mouse button, choose Display, Front.


ChartSetHide

Purpose

Hides a selected label, grid, tick, or frame in the current data chart.

Syntax

ChartSetHide ()


Route...

In a data chart, click the right mouse button over an object to hide, choose Hide.


ChartSetHorz

Purpose

Displays a legend horizontally in the current data chart.

Syntax

ChartSetHorz ()


Route...

In a data chart, click the right mouse button over a legend, choose Horizontal.


ChartSetInside

Purpose

Displays the legend within the current data chart.

Syntax

ChartSetInside ()


Route...

In a data chart, click the right mouse button over a legend, choose Inside.


ChartSetLabels

Purpose

Displays all data labels in the current data chart.

Syntax

ChartSetLabels ()


Route...

In a data chart, click the right mouse button, choose Display Labels.


ChartSetLeft

Purpose

Displays the left data chart frame.

Syntax

ChartSetLeft ()

See Also

ChartSelectFrameBase


Route...

In a data chart, click the right mouse button over a frame, choose Position, Left.


ChartSetLegend

Purpose

Displays the legend in the current data chart.

Syntax

ChartSetLegend ()


Route...

In a data chart, click the right mouse button, choose Display Legend.


ChartSetLinear

Purpose

Sets an axis to a linear scale in the current data chart.

Syntax

ChartSetLinear ()


Route...

In a data chart, click the right mouse button over an axis, choose Linear.


ChartSetLog

Purpose

Sets an axis to a logarithmic scale in the current data chart.

Syntax

ChartSetLog ()


Route...

In a data chart, click the right mouse button over an axis, choose Logarithmic.


ChartSetOutside

Purpose

Displays the legend outside the current data chart.

Syntax

ChartSetOutside ()


Route...

In a data chart, click the right mouse button over a legend, choose Outside.


ChartSetRight

Purpose

Displays the right data chart frame.

Syntax

ChartSetRight ()

See Also

ChartSelectFrameBase


Route...

In a data chart, click the right mouse button over a frame, choose Position, Right.


ChartSetStagger

Purpose

Staggers the display of X-axis labels in the current data chart.

Syntax

ChartSetStagger ()


Route...

In a data chart, click the right mouse button over an X-axis label, click the right mouse button, choose Stagger.


ChartSetTitleLeft

Purpose

Displays a chart title or subtitle in the left position.

Syntax

ChartSetTitleLeft ()


Route...

In a data chart, select a title or subtitle, click the right mouse button, choose Position, Left.


ChartSetTitleRight

Purpose

Displays a chart title or subtitle in the right position.

Syntax

ChartSetTitleRight ()


Route...

In a data chart, select a title or subtitle, click the right mouse button, choose Position, Right.


ChartSetTop

Purpose

Displays the top frame in the current data chart.

Syntax

ChartSetTop ()


Route...

In a data chart, select a frame, click the right mouse button, choose Display, Top.


ChartSetUnStagger

Purpose

Displays X-axis labels so they are not staggered.

Syntax

ChartSetUnStagger ()


Route...

In a data chart, click the right mouse button over an X-axis label, choose Remove Stagger.


ChartSetVert

Purpose

Displays a legend vertically in the current data chart.

Syntax

ChartSetVert ()


Route...

In a data chart, click the right mouse button over the legend, choose Vertical.


ChartSetY1

Purpose

Assigns a selected series to the Y1 axis in the current data chart.

Syntax

ChartSetY1 ()


Route...

In a data chart, click the right mouse button over a series currently assigned to the Y2 axis, choose Y1. (Y1 is only available on the quick menu when the selected series is assigned to the Y2 axis.)


ChartSetY2

Purpose

Assigns a selected series to the Y2 axis in the current data chart.

Syntax

ChartSetY2 ()


Route...

In a data chart, select a series, choose Chart, Series, Y2.


ChartSurface

Purpose

Changes the current chart to a surface chart.

Syntax

ChartSurface ()


Route...

In a data chart, choose Chart, Type, Surface.


ChartTable

Purpose

Changes the current chart to a table.

Syntax

ChartTable ()


Route...

In a data chart, choose Chart, Type, Table.


ChartTitlesDisplay

Purpose

Displays or hides chart titles or legend titles in a data chart.

Syntax

ChartTitlesDisplay (TitleIndex: enum; Display: enum)

Parameters

TitleIndex: enum

Title type.

Legend!

Subtitle!

Title!

X!

Y1!

Y2!

Display: enum

Off!

On!


Route...

In a data chart, choose Chart, Titles, select or deselect title types to display.


ChartToggle3D

Purpose

Toggles between three dimensional and two dimensional data chart views.

Syntax

ChartToggle3D ()


Route...

Click the 3D Chart button on the Toolbar.


ChartToggleHorzVert

Purpose

Toggles between horizontal and vertical data chart views.

Syntax

ChartToggleHorzVert ()


Route...

In a data chart, click the Horizontal Chart button on the Toolbar.


ChartToggleTable

Purpose

Toggles between data chart views that show or hide a corresponding table of data.

Syntax

ChartToggleTable ()


Route...

In a data chart, click the Show Table button on the Toolbar.


ChartViewDatasheet

Purpose

Toggles the display of the chart Datasheet in a data chart.

Syntax

ChartViewDatasheet (Show: enum)

Parameters

Show: enum (optional)

Off!

On!


Route...

In a data chart, choose View, Datasheet.


ChartViewOrgOutline

Purpose

Toggles the display of the outliner in an organization chart.

Syntax

ChartViewOrgOutline (Show: enum)

Parameters

Show: enum (optional)

Off!

On!


Route...

In an organization chart, choose View, Outline.


ClearBackground

Purpose

Erases the current background in the Background Editor.  Not recordable.

Syntax

ClearBackground ()


ClearBitmap

Purpose

Erases the current bitmap area without closing the Bitmap Editor.

Syntax

ClearBitmap ()


Route...

In the Bitmap Editor, choose Edit, Clear, Yes.


ClearDocument

Purpose

Displays the Clear dialog box, which is used to remove objects from a drawing, slide, slide show, layout, background, or master.  Dialog box options vary according to the current program state.

Syntax

ClearDocument ()


Route...

Edit, Clear.


ClearDrawing

Purpose

Displays the Clear Drawing dialog box, which is used to delete all items from the current drawing window.

Syntax

ClearDrawing ()


Route...

In a drawing, choose Edit, Clear.


ClearLayout

Purpose

Removes all objects from the current layout.

Syntax

ClearLayout ()


Route...

Slide, Edit Layouts, Edit, Clear, Current Layout.


ClearMaster

Purpose

Removes all layouts and backgrounds from the current master.

Syntax

ClearMaster ()


Route...

Slide, Edit Backgrounds, Edit, Clear, Master.


ClearMasterDlg

Purpose

Displays the Clear dialog box with the options Master and Current Background available.  Not recordable.

Syntax

ClearMasterDlg ()


ClearPresentation

Purpose

Clears all slides from the current slide show.

Syntax

ClearPresentation ()


Route...

In a slide show, choose Edit, Clear, Slide Show.


ClearPresentationDlg

Purpose

Displays the Clear dialog box with the options Slide Show and Slide # (with # indicating the current slide number).

Syntax

ClearPresentationDlg ()


Route...

In a slide show, choose Edit, Clear, select the check box in the dialog box title bar.


ClearSlide

Purpose

Removes all objects from the current slide.

Syntax

ClearSlide ()


Route...

In a slide show, choose Edit, Clear, Slide # (where # is the current slide number).


ClipboardCopy

Purpose

Copies selected objects or text to the Clipboard.

Syntax

ClipboardCopy ()


Route...

Select items to copy, Edit, Copy.


ClipboardCut

Purpose

Moves selected objects or text to the Clipboard.

Syntax

ClipboardCut ()


Route...

Select items to cut, Edit, Cut.


ClipboardPaste

Purpose

Inserts Clipboard contents into the current drawing at the insertion point.

Syntax

ClipboardPaste ()


Route...

When the clipboard contains objects or text, choose Edit, Paste.


ColorAttributesDlg

Purpose

Displays the Color Attributes dialog box, which is used to modify fill, line, and text colors.

Syntax

ColorAttributesDlg ()


Route...

Format, Color Attributes, select the check box in the dialog box title bar.


CombineObjects

Purpose

Combines selected objects into a compound polygon.

Syntax

CombineObjects ()


Route...

Select objects to combine, Graphics, Combine.


ConnectorsDlg

Purpose

Displays the Connectors dialog box, which is used to modify connectors between organization chart levels.

Syntax

ConnectorsDlg ()


Route...

In an organization chart, choose Chart, Connectors, select the check box in the dialog box title bar.


ContourText

Purpose

Shapes selected text to the outline of a selected drawing object.

Syntax

ContourText (VertJust: enum; HorzJust: enum; ShowPath: enum)

Parameters

VertJust: enum

Vertical position of text in relation to the curve it follows.

Bottom!

Top!

HorzJust: enum

Horizontal position of text in relation to the curve it follows.

Center!

Left!

Right!

ShowPath: enum

Show the object as well as the contoured text.

No!

Yes!


Route...

Select text to contour and a drawing object for text to follow, Graphics, Contour Text, specify options.


ContourTextAttributesDlg

Purpose

Displays the Contour Text dialog box, which is used to shape text to the outline of a selected drawing object.

Syntax

ContourTextAttributesDlg ()


Route...

Select text to contour and a drawing object for text to follow, Graphics, Contour Text, select the check box in the dialog box title bar.


CopyMarquee

Purpose

Copies a selected bitmap area to the Clipboard.

Syntax

CopyMarquee ()


Route...

In the Bitmap Editor, choose Edit, Select Area, drag to select an area, Edit, Copy.


CopySelectedSlides

Purpose

Copies selected slides to a specified position in the current slide show.

Syntax

CopySelectedSlides (To: numeric)

Parameters

To: numeric

Specifies which slide the copies follow.


Route...

View, Slide Sorter, press Ctrl while dragging selected slides into position.


CrosshairCursor

Purpose

Turns the Crosshair Pointer on or off.

Syntax

CrosshairCursor ()


Route...

View, Crosshair.


CutMarquee

Purpose

Moves a selected bitmap area to the Clipboard.

Syntax

CutMarquee ()


Route...

In the Bitmap Editor, select an area to cut, choose Edit, Cut.


DatasheetBlockMode

Purpose

Toggles select mode in a chart's Datasheet.  Not recordable.

Syntax

DatasheetBlockMode ()


DatasheetColWidth

Purpose

Specifies chart's Datasheet column width in number of characters.

Syntax

DatasheetColWidth (Width: numeric)

Parameters

Width: numeric

Column width in characters.


Route...

In a data chart, choose Data, Column Width, specify a width.


DatasheetDateFmt

Purpose

Formats selected chart's Datasheet cells as dates.

Syntax

DatasheetDateFmt (Format: enum; CustFmtSrt: string)

Parameters

Format: enum

Date format.

DD_MMM!

DD_MMM_YY!

General!

HH_MM!

HH_MM_SS!

MM_DD!

MM_DD_YY!

MM_DD_YY_HH_MM_SS!

MM_YY!

MMM_DD!

MMM_DD_YY!

MMM_YY!

Q_YY!

QTR_YY!

UserDef!

YYYY!

YYYY_MM_DD!

CustFmtStr: string (optional)

User-defined date format.  Used when the

Format parameter is UserDef!.


Route...

In a chart's Datasheet, select cells to format, choose Data, Format, Date, select a format.  If the format is User Defined, choose Custom and specify a format in the Edit Date Format entry box.


DatasheetDelete

Purpose

Removes rows or columns from a chart's Datasheet.

Syntax

DatasheetDelete (Direction: enum; Number: numeric)

Parameters

Direction: enum

Delete rows or columns.

Columns!

Rows!

Number: numeric

Number of rows or columns to delete.


Route...

In a data chart, choose Edit, Delete, specify Row(s) or Column(s), specify how many to delete.


DatasheetDown

Purpose

Moves the insertion point a specified number of cells down in a chart's Datasheet.

Syntax

DatasheetDown (Count: numeric; BlockExtend: enum)

Parameters

Count: numeric

Number of cells down to move the insertion point.

BlockExtend: enum

Moving the insertion point selects cells.

No!

Yes!


Route...

In a chart's Datasheet, press Down Arrow.  To select cells, press Shift+Down Arrow.


DatasheetExclude

Purpose

Excludes the data in selected chart's Datasheet rows or columns from a chart.

Syntax

DatasheetExclude (Direction: enum)

Parameters

Direction: enum (optional)

Exclude columns or rows.

Columns!

Rows!


Route...

In a chart's Datasheet, select cells to exclude, choose Data, Exclude Row/Col, Row(s) or Column(s).


DatasheetExport

Purpose

Exports data from a data chart Datasheet to a file.

Syntax

DatasheetExport (Filename: string; Delimiter: numeric; Format: enum)

Parameters

Filename: string

Name of the file to contain exported data.

Delimiter: numeric

ASCII numeric equivalent of a character to use as a delimiter for each Datasheet cell.

Format: enum

File format.

Ansi!

Ascii!


Route...

In a data chart, choose Data, Export, specify a filename, specify a format in the Save File as Type drop-down list.


DatasheetFillDates

Purpose

Fills the current chart's Datasheet with a series of dates.

Syntax

DatasheetFillDates (Start: numeric; Step: numeric; StepType: enum; Direction: enum)

Parameters

Start: numeric

Starting date.  The date 1/1/1900 12:00 am is represented by a 0.  To determine the numeric equivalent of a date, type the date in the Start entry box, then choose Linear or Growth from the Type options.

Step: numeric

Increment between dates.

StepType: enum

Type of increment.

Days!

Hours!

Minutes!

Months!

Qtrs!

Seconds!

Weekdays!

Weeks!

Years!

Direction: enum

Fill a Datasheet by rows or columns.

Columns!

Rows!


Route...

In a data chart, select Datasheet cells to fill, choose Data, Fill, Rows or Columns, Date, specify an option in the Date pop-up list, specify start and step values.


DatasheetFillNumbers

Purpose

Fills a chart's Datasheet with a series of numbers.

Syntax

DatasheetFillNumbers (Start: numeric; Step: numeric; FillType: enum; Direction: enum)

Parameters

Start: numeric

Starting number.

Step: numeric

Increment between numbers.

FillType: enum

Type of increment.

Growth!

Linear!

Direction: enum

Fill a Datasheet by rows or columns.

Columns!

Rows!


Route...

In a data chart, select Datasheet cells to fill, choose Data, Fill, Rows or Columns, Linear or Growth, specify start and step values.


DatasheetFormula

Purpose

Applies a formula to the contents of a chart's Datasheet row or column.

Syntax

DatasheetFormula (Function: enum; RowCol: enum; Dest: numeric; Arguments: string; MovAveArg: string; PolyFitOrder: numeric; FitForcast: numeric)

Parameters

Function: enum

Function to perform on selected data.

AbsVal!

Average!

Cosine!

CumTotal!

Difference!

FitExp!

FitLin!

FitLog!

FitPoly!

FitPower!

Max!

Min!

MovAve!

None!

Percent!

Sine!

Sum!

RowCol: enum

Fill by columns or rows.

Column!

Row!

Dest: numeric

Row or column to contain formula results.

Arguments: string

Beginning and ending row or column numbers, separated by a comma.

MovAveArg: string

Number of values to average before and after each chart item when calculating a moving average.

PolyFitOrder: numeric

Number of points in the Order of Curve Fit when charting a fit polynomial curve.

FitForcast: numeric

Number of values ahead to calculate when charting a regression fit.


Route...

In a chart's Datasheet, choose Data, Formulas, specify options.


DatasheetGoto

Purpose

Moves the insertion point to a specified cell in a chart's Datasheet.

Syntax

DatasheetGoTo (Column: numeric; Row: numeric; BlockExtend: enum; MouseClick: enum)

Parameters

Column: numeric

Column number.

Row: numeric

Row number.

BlockExtend: enum

Moving the insertion point selects cells.

No!

Yes!

MouseClick: enum

Cells scroll into view, as they do when you click the mouse to select a cell.

No!

Yes!


Route...

In a chart's Datasheet, choose Edit, Go To Cell, type a cell number.


DatasheetHome

Purpose

Performs the function of the Home key in a chart's Datasheet.  The Home key is used with other keystrokes to move the insertion point in a Datasheet.

Syntax

DatasheetHome ()


Route...

In a chart's Datasheet, press Home.


DatasheetImport

Purpose

Imports data from a spreadsheet file into a data chart Datasheet.

Syntax

DatasheetImport (Filename: string; Clear: enum; Link: enum; Transpose: enum; Location: enum; Range: string)

Parameters

Filename: string

Datasheet file to import.

Clear: enum (optional)

Clear the data chart Datasheet before importing spreadsheet data.

Clear!

NoClear!

Link: enum (optional)

Link the import file to the file containing the data chart.

Link!

NoLink!

Transpose: enum (optional)

Transpose imported data.

NoTranspose!

Transpose!

Location: enum

Import data to the top left cell (0,0), or the cell containing the insertion point.

CurrentCell!

TopLeft!

Range: string (optional)

Range of spreadsheet cells from which to import data.


Route...

In a data chart, choose Data, Import, choose Spreadsheet from the Data Type drop-down menu, specify a spreadsheet file in the filename entry box, specify options.


DatasheetImportOptions

Purpose

Specifies default options for the Import Data dialog box, which is used to import data into a chart's Datasheet.  This command exists for 0S/2 integration and is not recordable.

Syntax

DatasheetImportOptions (Filename: string; Clear: enum; Link: enum; InsertAt: enum)

Parameters

Filename: string

Default filename.

Clear: enum

Clear Current Data is selected.

No!

Yes!

Link: enum

Link to Datasheet is selected.

No!

Yes!

InsertAt: enum

Specifies whether Import at Current Cell is selected.  Otherwise, imported data begins at the top left cell.

CurrentCell!

TopLeft!


DatasheetImportText

Purpose

Imports data from a text file to a chart's Datasheet.

Syntax

DatasheetImportText (Filename: string; FileFormat: enum; FieldDelimiter: string; RecordDelimeter: string; StripChars: string; EncapsulationChar: string; ClearData: enum; Link: enum; Transpose: enum; Location: enum)

Parameters

Filename: string

File from which to import data.

FileFormat: enum

Ansi!

Ascii!

FieldDelimiter: string (optional)

Field delimiter for imported text.

RecordDelimiter: string (optional)

Record delimiter for imported text.

StripChars: string (optional)

Characters to strip from imported text.

EncapsulationChar: string (optional)

Character used to encapsulate each field.

ClearData: enum

Clear the chart's Datasheet before importing data.

Clear!

NoClear!

Link: enum

Link the data file to the Datasheet.

Link!

NoLink!

Transpose: enum

Transpose data before importing.

NoTranspose!

Transpose!

Location: enum

Import data to the top left cell (0,0), or the cell containing the insertion point.

CurrentCell!

TopLeft!


Route...

In a data chart, choose Data, Import, choose ASCII Delimited Text or ANSI Delimited Text from the Data Type drop-down menu, specify a text file in the filename entry box, specify options.


DatasheetInclude

Purpose

Includes the data in specified data chart Datasheet rows or columns in a data chart.

Syntax

DatasheetInclude (Direction: enum)

Parameters

Direction: enum (optional)

Include columns or rows.

Columns!

Rows!


Route...

In a chart's Datasheet, select cells to include, choose Data, Include Row/Col, Row(s) or Column(s).


DatasheetInput

Purpose

Inserts data into a chart's Datasheet cell.

Syntax

DatasheetInput (String: string)

Parameters

String: string

Data to insert.


Route...

In a chart's Datasheet, choose Edit, Edit Cell, type data.


DatasheetInsert

Purpose

Adds rows or columns to a chart's Datasheet.

Syntax

DatasheetInsert (Direction: enum; Number: numeric)

Parameters

Direction: enum

Add columns or rows.

Columns!

Rows!

Number: numeric

Number of rows or columns to add.


Route...

In a data chart, choose Edit, Insert, select Rows or Columns, specify how many to insert.


DatasheetLeft

Purpose

Moves the insertion point a specified number of cells to the left in a chart's Datasheet.

Syntax

DatasheetLeft (Count: numeric; BlockExtend: enum)

Parameters

Count: numeric

Number of cells to the left to move the insertion point.

BlockExtend: enum

Moving the insertion point selects cells.

No!

Yes!


Route...

In a chart's Datasheet, press Left Arrow.  To select cells, press Shift+Left Arrow.


DatasheetNumericFmt

Purpose

Specifies a numeric format for selected cells of a chart's Datasheet.

Syntax

DatasheetNumericFmt (FloatingDigits: numeric; Digits: numeric; NegParen: numeric; Currency: numeric; Thousands: numeric; Percent: numeric; Exponential: numeric)

Parameters

FloatingDigits: numeric

Numeric format includes floating digits or a fixed number of digits after the decimal point.  Use the Digits parameter to specify a fixed number.  Use 0 for fixed and 1 for floating.

Digits: numeric (optional)

Fixed number of digits.  Use only when the value of the FloatingDigits parameter is 0.

NegParen: numeric

Show negative numbers with a minus sign or in parentheses.  Use 0 for minus sign and 1 for parentheses.

Currency: numeric

Format numbers with a currency symbol.  Use 0 for no currency symbol and 1 for a currency symbol.

Thousands: numeric

Format numbers with a thousands separator.  Use 0 for no thousands separator and 1 for a thousands separator

Percent: numeric

Determines whether to format numbers as percentages.  Use 0	for no percentage and 1 for a percentage.

Exponential: numeric

Determines whether to format numbers as exponents.  Use 0 for no exponent and 1 for an exponent.


Route...

In a chart's Datasheet, select cells to format, choose Data, Format, Numeric, specify options.


DatasheetPgDn

Purpose

Moves the insertion point down a specified number of pages in a chart's Datasheet.

Syntax

DatasheetPgDn (Count: numeric; BlockExtend: enum)

Parameters

Count: numeric

Number of pages down to move the insertion point.

BlockExtend: enum

Moving the insertion point selects cells.

No!

Yes!


Route...

In a chart's Datasheet, press Page Down.  To select cells, press Shift+Page Down.


DatasheetPgLeft

Purpose

Moves the insertion point left a specified number of pages in a chart's Datasheet.

Syntax

DatasheetPgLeft (Count: numeric; BlockExtend: enum)

Parameters

Count: numeric

Number of pages left to move the insertion point.

BlockExtend: enum

Moving the insertion point selects cells.

No!

Yes!


Route...

In a chart's Datasheet, press Ctrl+Left Arrow.  To select cells, press Shift+Ctrl+Left Arrow.


DatasheetPgRight

Purpose

Moves the insertion point right a specified number of pages in a chart's Datasheet.

Syntax

DatasheetPgRight (Count: numeric; BlockExtend: enum)

Parameters

Count: numeric

Number of pages right to move the insertion point.

BlockExtend: enum

Moving the insertion point selects cells.

No!

Yes!


Route...

In a chart's Datasheet, press Ctrl+Right Arrow.  To select cells, press Shift+Ctrl+Right Arrow.


DatasheetPgUp

Purpose

Moves the insertion point up a specified number of cells in a chart's Datasheet.

Syntax

DatasheetPgUp (Count: numeric; BlockExtend: enum)

Parameters

Count: numeric

Number of pages up to move the insertion point.

BlockExtend: enum

Moving the insertion point selects cells.

No!

Yes!


Route...

In a chart's Datasheet, press Page Up.  To select cells, press Shift+Page Up.


DatasheetRight

Purpose

Moves the insertion point right a specified number of cells in a chart's Datasheet.

Syntax

DatasheetRight (Count: numeric; BlockExtend: enum)

Parameters

Count: numeric

Number of cells right to move the insertion point.

BlockExtend: enum

Moving the insertion point selects cells.

No!

Yes!


Route...

In a chart's Datasheet, press Right Arrow.  To select cells, press Shift+Right Arrow.


DatasheetUp

Purpose

Moves the insertion point up a specified number of cells in a chart's Datasheet.

Syntax

DatasheetUp (Count: numeric; BlockExtend: enum)

Parameters

Count: numeric

Number of cells up to move the insertion point.

BlockExtend: enum

Moving the insertion point selects cells.

No!

Yes!


Route...

In a chart's Datasheet, press Up Arrow.  To select cells, press Shift+Up Arrow.


DateCode

Purpose

Inserts a date code into text at the insertion point.

Syntax

DateCode ()


Route...

In the Text Editor, choose Insert, Date, Code.


DateFormat

Purpose

Specifies a date format when inserting a date in the Text Editor.

Syntax

DateFormat (DateFormatString: string)

Parameters

DateFormatString: string

Specifies a date format.


Route...

Insert, Date, Format, select a predefined format and choose OK, or choose Custom and specify a format.


DateFormatDlg

Purpose

Displays the Date/Time Format dialog box, which is used to specify the appearance of the date and time when inserted into text.

Syntax

DateFormatDlg ()


Route...

In the Text Editor, choose Insert, Date, Format, select the check box in the dialog box title bar.


DateText

Purpose

Inserts the date at the insertion point in the Text Editor.

Syntax

DateText ()


Route...

In the Text Editor, choose Insert, Date, Text.


DefineBulletsDlg

Purpose

Displays the Define Bullets/Fonts dialog box, which is used to set bullets options, font options, and box/frame options in a bullet chart.

Syntax

DefineBulletsDlg ()


Route...

In a bullet chart, choose Format, Define Bullets/Font, select the check box in the dialog box title bar.


Delete

Purpose

Removes the character to the right of the insertion point in the Text Editor.

Syntax

Delete ()


Route...

In the Text Editor, choose Edit, Delete.  Or, press Delete.


DeleteAlignBars

Purpose

Removes alignment guides.

Syntax

DeleteAlignBars ()


Route...

View, Grid/Snap, Clear Guides.


DeleteBackground

Purpose

Deletes the current background.

Syntax

DeleteBackground ()


Route...

Slide, Edit Backgrounds, Backgrounds, Delete Background.


DeleteKeyboard

Purpose

Deletes a specified keyboard.

Syntax

DeleteKeyboard (KeyboardName: string)

Parameters

KeyboardName: string


Route...

Edit, Preferences, Keyboard, highlight a keyboard, Delete.


DeleteLayout

Purpose

Deletes the current layout from the slide show master.

Syntax

DeleteLayout ()


Route...

Slide, Edit Layouts, Layouts, Delete Layout.


DeleteMenu

Purpose

Deletes a specified menu bar.

Syntax

DeleteMenu (MenuName: string)

Parameters

MenuName: string


Route...

Edit, Preferences, Menu Bar, highlight a menu bar, Delete.


DeleteObjects

Purpose

Deletes selected items when editing an object.  Or, in Edit Points mode, deletes selected points.

Syntax

DeleteObjects ()


Route...

Select an object or any of an object's points, Edit, Delete.


DeleteSelectedSlides

Purpose

Removes selected slides from the current slide show.

Syntax

DeleteSelectedSlides (PromptToDelete: enum)

Parameters

PromptToDelete: enum (optional)

Determines whether to prompt the user before deleting slides.

No!

Yes!


Route...

To delete the current slide in the Slide Editor, choose Slide, Delete Slide(s).  In Slide Sorter or Slide List, select slides to delete, choose Slide, Delete Slide(s).


DeleteToBegOfWord

Purpose

Erases text from the insertion point to the beginning of the word containing the insertion point.  Not recordable.

Syntax

DeleteToBegOfWord ()


DeleteToEndOfWord

Purpose

Erases text from the insertion point to the end of the word containing the insertion point.  Not recordable.

Syntax

DeleteToEndOfWord ()


DeleteWord

Purpose

Deletes the word containing the insertion point.

Syntax

DeleteWord ()


Route...

In the Text Editor, press Ctrl+Backspace.


DelToDocBottom

Purpose

Deletes all text from the insertion point to the end of the current text window.  Not recordable.

Syntax

DelToDocBottom ()


DelToEndOfLine

Purpose

Deletes text from the insertion point to the end of the current line.

Syntax

DelToEndOfLine ()


Route...

In the Text Editor, press Ctrl+Delete.


DetachTemplate

Purpose

Removes the link between a slide template and a slide show master, assigning template objects to the current slide as regular slide objects.

Syntax

DetachTemplate ()


Route...

Slide, Apply Template, select a template to detach, Detach.


DisplaySettingsDlg

Purpose

Displays the Display dialog box, which is used to specify display preferences.  Not recordable.

Syntax

DisplaySettingsDlg ()


DocPrevious

Purpose

Displays the previous open document in the editing window.

Syntax

DocPrevious ()


Route...

Press Ctrl+Shift+F6.


DocumentBottom

Purpose

Moves the insertion point to the end of the text in the current text window.

Syntax

DocumentBottom ()


Route...

In the Text Editor, press Ctrl+End.


DocumentFormSettings

Purpose

Specifies a page size, margins, and poster options for the current drawing or slide show.

Syntax

DocumentFormSettings (FormWidth: numeric; FormHeight: numeric; MarginLeft: numeric; Margin Bottom: numeric; MarginRight: numeric; MarginTop: numeric; Orientation: enum; ObjectFit: enum; IsPosterMode: enum; PosterColumns: numeric; PosterRows: numeric)

Parameters

FormWidth: numeric

Paper width in WordPerfect units (1200ths of an inch).

FormHeight: numeric

Paper height in WordPerfect units.

MarginLeft: numeric

Size of the left margin in WordPerfect units.

MarginBottom: numeric

Size of the bottom margin in WordPerfect units.

MarginRight: numeric

Size of the right margin in WordPerfect units.

MarginTop: numeric

Size of the top margin in WordPerfect units.

Orientation: enum

Landscape!

Portrait!

ObjectFit: enum (optional)

Specifies how to move or size objects to conform to the new page size.

Center!

LowerLeft!

LowerRight!

MatchMarginsCenter!

MatchMarginsExact!

MatchMarginsLowerLeft!

MatchMarginsLowerRight!

MatchMarginsUpperLeft!

MatchToMarginsUpperRight!

ObjectsToMarginsCenter!

ObjectsToMarginsExact!

ObjectsToMarginsLowerRight!

ObjectsToMarginsLowerLeft!

ObjectsToMarginsUpperLeft!

ObjectsToMarginsUpperRight!

UpperLeft!

UpperRight!

IsPosterMode: enum

Poster mode is active.

No!

Yes!

PosterColumns: numeric (optional)

In poster mode, the number of columns that overlay the form.

PosterRows: numeric (optional)

In poster mode, the number of rows that overlay the form.


Route...

Format, Page, Size/Margins, specify options.


DocumentMaximize

Purpose

Expands the current document window to its maximum size.  If the window is already maximized, this command terminates the macro or redirects the macro to the LABEL specified by ONERROR.

Syntax

DocumentMaximize ()


Route...

Click the Maximize button, or choose Maximize from the Presentations Document System Menu.


DocumentMinimize

Purpose

Reduces the current document window to an icon.  If the window is already minimized, this command terminates the macro or redirects the macro to the LABEL specified by ONERROR.

Syntax

DocumentMinimize ()


Route...

Click the Minimize button, or choose Minimize from the Presentations Document System Menu.


DocumentMove

Purpose

Pauses the macro to allow a user to move the current document window.  Click the mouse or press Enter to continue playing the macro.

Syntax

DocumentMove ()


Route...

Choose Move from the Presentations Document System Menu.


DocumentNext

Purpose

Displays the next open document on the editing window.

Syntax

DocumentNext ()


Route...

Choose Next from the Presentations Document System Menu.


DocumentPageColor

Purpose

Sets the page color for the current document.

Syntax

DocumentPageColor (GradientFlag: enum; SolidColorRed: numeric; SolidColorGreen: numeric; SolidColorBlue: numeric; GradientColorRed: numeric; GradientColorGreen: numeric; GradientColorBlue: numeric; GradientType: enum; GradientAngle: enum; GradientSteps: numeric; GradientRefX: numeric; GradientRefY: numeric)

Parameters

GradientFlag: enum

Specifies whether the page color is a gradient.

No!

Yes!

SolidColorRed: numeric

Amount of red (0-255) in a solid page color, the top color of a linear gradient, or the center color of a circular or rectangular gradient.

SolidColorGreen: numeric

Amount of green (0-255) in a solid page color, the top color of a linear gradient, or the center color of a circular or rectangular gradient.

SolidColorBlue: numeric

Amount of blue (0-255) in a solid page color, the top color of a linear gradient, or the center color of a circular or rectangular gradient.

GradientColorRed: numeric

Amount of red (0-255) in the bottom color of a linear gradient, or the outer color of a circular or rectangular gradient.

GradientColorGreen: numeric

Amount of green (0-255) in the bottom color of a linear gradient, or the outer color of a circular or rectangular gradient.

GradientColorBlue: numeric

Amount of blue (0-255) in the bottom color of a linear gradient, or the outer color of a circular or rectangular gradient.

GradientType: enum

Specifies a linear, circular, or rectangular gradient.

Grad_CCircles!

Grad_Linear!

Grad_None!

Grad_VRects!

GradientAngle: numeric

Specifies a rotation angle for a gradient page color.  The top of the gradient is rotated counter-clockwise.  For example, a 90-degree angle places the top of the gradient along the left margin of the page.

GradientSteps: numeric

Number of steps between colors in a gradient page color.  A value of 0 represents the greatest possible number of steps.

GradientRefX: numeric

Horizontal center of a circular or rectangular gradient relative to the page.  Flush left is 0, center is 50, and flush right is 100.

GradientRefY: numeric

Vertical center of a circular or rectangular gradient or the top of a linear gradient relative to the page.  Top is 0, center is 50, and bottom is 100.

See Also

DocumentFormSettings


Route...

Format, Page, Color, specify options.


DocumentRestore

Purpose

Restores a document window to its previous size.  If the window has already been restored, this command will terminate the macro or redirect the macro to the LABEL specified by ONERROR.

Syntax

DocumentRestore ()


Route...

Choose Restore from the Presentations Document System Menu.  Or, click the Restore button in the top right corner if the window is maximized.


DocumentSize

Purpose

Pauses macro execution to allow the user to size the document window.  Click the mouse or press Enter to continue playing the macro.

Syntax

DocumentSize ()


Route...

Choose Size from the Presentations Document System Menu, or drag a corner to size the window.


DocumentTop

Purpose

Moves the insertion point to the top of the current text window.

Syntax

DocumentTop ()


Route...

In the Text Editor, press Ctrl+Home.


DraftMode

Purpose

Turns Draft Mode on or off.  In Draft Mode, images in a drawing window are displayed as outlines.

Syntax

DraftMode ()


Route...

View, Draft Mode.


DrawingSizeDlg

Purpose

Displays the Drawing Size dialog box, which is used to set the frame size for an OLE graphic.

Syntax

DrawingSizeDlg ()


Route...

Open Presentations as an OLE client from another application, choose Format, Page, Size, select the check box in the dialog box title bar.


DrawingSizeSettings

Purpose

Changes the size of a drawing area when Presentations is running as an OLE server.

Syntax

DrawingSizeSettings (Left: numeric; Bottom: numeric; Right: numeric; Top: numeric; UseEvenBorders: enum; BorderSize: numeric)

 Parameters

Left: numeric

Left coordinate of a drawing area, in WordPerfect units (1200ths of an inch).

Bottom: numeric

Bottom coordinate of a drawing area, in WordPerfect units.

Right: numeric

Right coordinate of a drawing area, in WordPerfect units.

Top: numeric

Top coordinate of a drawing area, in WordPerfect units.

UseEvenBorders: enum (optional)

No!

Yes!

BorderSize: numeric (optional)

A percentage of the drawing size.  Values (0-100). Default (5).


Route...

Open Presentations as an OLE client from another application, choose Format, Page, Size, specify size settings.


EditBackground

Purpose

Opens the Background Editor, which allows you to edit the background layer of a slide.

Syntax

EditBackground ()


Route...

Slide, Edit Backgrounds.


EditLayouts

Purpose

Displays the layout layer of the current slide.

Syntax

EditLayouts ()


Route...

Slide, Edit Layouts.


EditOleObject

Purpose

Allows you to modify a selected OLE object.

Syntax

EditOleObject ()


Route...

Select an OLE object, choose Edit, Edit WordPerfect (6.0) Document Object. (This option varies depending on the type of OLE object selected.)


EditSelectedBitmap

Purpose

Opens the Bitmap Editor to edit a selected bitmap object.  Not recordable.

Syntax

EditSelectedBitmap ()


EditSlides

Purpose

Returns from the Layout Editor or Background Editor to the Slide Editor.

Syntax

EditSlides ()


Route...

In the Layout Editor, choose Layouts, Edit Slides.  In the Background Editor, choose Background, Edit Slides.


EndOfLine

Purpose

Moves the insertion point to the end of the current line of text.

Syntax

EndOfLine ()


Route...

In the Text Editor, press End.


EnvChartDataWin

Purpose

Indicates whether a chart's Datasheet is displayed.  Not recordable.

Syntax

numeric EnvChartDataWin ()

Return Value

numeric

0	Not displayed

1	Displayed

See Also

System Variables


EnvChartDisplay

Purpose

Indicates whether a specified chart object is displayed.  Not recordable.

Syntax

EnvChartDisplay (Object: enum; Subtype: enum)

Return Value

numeric

0	Not displayed

1	Displayed

Parameters

Object: enum

Frames!

GridMajor!

GridMinor!

Labels!

Legend!

TextBoxes!

TickMajor!

TickMinor!

Titles!

SubType: enum

Back!

Bottom!

Data!

Front!

Left!

Legend!

Pie!

Radial!

Right!

SubTitle!

Title!

Top!

X!

Y1!

Y2!

See Also

System Variables


EnvChartType

Purpose

Returns current data chart type.  Not recordable.

Syntax

EnvChartType ()

Return Value

numeric Chart type.

0	None

1	Bar

2	Line

3	Scatter

4	High/Low

5	Mixed

6	Surface

7	Table

8	Pie

9	Radar

See Also

System Variables


EnvColorPalette

Purpose

Returns the numeric value for a component of a specified color.  Not recordable.

Syntax

 EnvColorPalette (Separation: enum; Index: numeric)

Return Value

numeric

Color value (0-255).

Parameters

Separation: enum

Color component

Blue!

Green!

Red!

Index: numeric

Specifies a color by index number.

See Also

System Variables


EnvCurrentMode

Purpose

Returns the current editing mode.  Not recordable.

Syntax

EnvCurrentMode ()

Return Value

numeric When more than one editing mode is active, the return value is the sum of the numbers for each active mode.

1	Drawing

2	Slide

4	Slide list

8	Slide outline

16	Slide sort

32	Background edit

64	Layout edit

128	Data chart

256	Organization chart

512	Text edit

1024	Paint

2048	OLE drawing

4096	OLE data chart

See Also

System Variables


EnvCurrentSlideNumber

Purpose

Returns the current slide number.  Not recordable.

Syntax

numeric EnvCurrentSlideNumber ()

Return Value

numeric

See Also

System Variables


EnvCurrentTool

Purpose

Returns the current drawing tool. Not recordable.

Syntax

numeric EnvCurrentTool ()

Return Value

numeric

0	No tool selected

1	Select

2	Data chart

3	Organization chart

4	Bullet chart

5	QuickArt

6	Text line

7	Line

8	Curve

9	Closed curve

10	Polygon

11	Regular polygon

12	Rectangle

13	Rounded rectangle

14	Ellipse

15	Elliptical arc

16	Circle

17	Circular arc

18	Arrow

19	Bezier

20	Freehand

21	Bitmap

22	Paintbrush

23	Airbrush

24	Floodfill

25	Paint dropper

26	Selective replace

27	Eraser

28	Select area

29	Bitmap zoom

30	Acquire image

31	Text box

See Also

System Variables


EnvIsCommandValid

Purpose

Indicates whether a specified macro command is valid in the current state of the program.  Not recordable.

Syntax

numeric EnvIsCommandValid (TokenId: string)

Return Value

numeric

0	Not valid

1	Valid

Parameters

TokenId: string

Macro command name.

See Also

System Variables


EnvLeftChar

Purpose

Returns the character to the left of the insertion point.  Not recordable.

Syntax

string EnvLeftChar ()

Return Value

string

See Also

System Variables


EnvNumberOfSlides

Purpose

Returns the number of slides in the current slide show.  Not recordable.

Syntax

numeric EnvNumberOfSlides ()

Return Value

numeric

See Also

System Variables


EnvPaths

Purpose

Returns the default path for a specified file type.  Not recordable.

Syntax

string EnvPaths (PathType: enum)

Return Value

 string Default file path.

Parameters

PathType: enum

File type.

Backup!

ButtonBar!

CurrentFile!

ExpressShow!

Figures!

Filters!

Macros!

Masters!

Palettes!

Presentations!

Program!

QuickGalleries!

Shared!

Sound!

SpellMain!

SpellSupp!

See Also

System Variables


EnvQuickCorrect

Purpose

Returns the state of QuickCorrect.  Not recordable.

Syntax

numeric EnvQuickCorrect ()

Return Value

numeric

0	Off

1	On

See Also

System Variables


EnvCapBeginSentence

Purpose

Returns the state of Capitalize First Letter in Quick Correct.  Not recordable.

Syntax

numeric EnvCapBeginSentence ()

Return Value

numeric

0	Off

1	On

See Also

System Variables


EnvDoubleSmartQuoteClose

Purpose

Returns the current double close smart quote in QuickCorrect.  Not recordable.

Syntax

numeric EnvDoubleSmartQuoteClose ()

Return Value

string

See Also

System Variables


EnvDoubleSmartQuoteState

Purpose

Returns the state of double quotes in QuickCorrect.  Not recordable.

Syntax

numeric EnvDoubleSmartQuoteState ()

Return Value

numeric

0	Off

1	On

See Also

System Variables


EnvDoubleSmartQuoteOpen

Purpose

Returns the current double open smart quote in Quick Correct.  Not recordable.

Syntax

string EnvDoubleSmartQuoteOpen ()

Return Value

string

See Also

System Variables


EnvSingleSmartQuoteOpen

Purpose

Returns the current single open quote in QuickCorrect.  Not recordable.

Syntax

string EnvSingleSmartQuoteOpen ()

Return Value

string

See Also

System Variables


EnvUseRegQuotesWithNumbers

Purpose

Returns the state of Use Regular Quotes with Numbers in QuickCorrect.  Not recordable.

Syntax

numeric EnvUseRegQuotesWithNumbers ()

Return Value

numeric

0	Off

1	On

See Also

System Variables


EnvEndOfSentenceSpacing

Purpose

Returns the current end of sentence correction type in QuickCorrect.  Not recordable.

Syntax

numeric EnvEndOfSentenceSpacing ()

Return Value

numeric

0	Off

1	On

See Also

System Variables


EnvSingleSmartQuoteClose

Purpose

Returns the current single close quote in QuickCorrect.  Not recordable.

Syntax

string EnvSingleSmartQuoteClose ()

Return Value

string

See Also

System Variables


EnvSingleSmartQuoteState

Purpose

Returns the state of single quotes in QuickCorrect.  Not recordable.

Syntax

numeric EnvSingleSmartQuoteState ()

Return Value

numeric

0	Off

1	On

See Also

System Variables


EnvIrregularCap

Purpose

Returns the state of Correct TWo IRregular CApitals in QuickCorrect.  Not recordable.

Syntax

numeric EnvIrregularCap ()

Return Value

numeric

0	Off

1	On

See Also

System Variables


EnvRightChar

Purpose

Returns the character to the right of the insertion point. Not recordable.

Syntax

string EnvRightChar ()

Return Value

string

See Also

System Variables


EnvSelectedText

Purpose

Returns selected text with all codes removed except hard returns.  Not recordable.

Syntax

string EnvSelectedText ()

Return Value

string

See Also

System Variables


EnvTemplate

Purpose

Returns the name of the current slide template.  Not recordable.

Syntax

string EnvTemplate ()

Return Value

string

See Also

System Variables


EnvTextChartType

Purpose

Returns the current text part of a text chart.  Not recordable.

Syntax

numeric EnvTextChartType ()

Return Value

numeric

0	Text

1	Title

2	Sub

3	Body

See Also

System Variables


EraseMarquee

Purpose

Deletes a selected portion of a bitmap.

Syntax

EraseMarquee ()


Route...

In the Bitmap Editor, choose Edit, Select Area, drag to select an area to erase, Edit, Erase.


ExportBMP

Purpose

Saves the current drawing in Windows Bitmap 3.0 format.

Syntax

ExportBMP (Filename: string; WidthInPixels: numeric; HeightInPixels: numeric; BitsPerPixel: numeric; Compression: enum, DpiX: numeric; DpiY: numeric; SaveSelected: enum)

Parameters

Filename: string

Names the bitmap file.

WidthInPixels: numeric

Width in pixels of the exported drawing.

HeightInPixels: numeric

Height in pixels of the exported drawing.

BitsPerPixel: numeric

Number of bits per pixel in the exported drawing.

Compression: enum

Compress the exported drawing.

Compress4Bit!

Compress8Bit!

NoCompression!

DpiX: numeric

Horizontal dots per inch.

DpiY: numeric

Vertical dots per inch.

SaveSelected: enum (optional)

Save selected objects only.

No!

Yes!


Route...

File, Save As, type a filename, select BMP-Windows Bitmap in the Save File as Type drop-down list, Save, specify options in the Export BMP-Windows Bitmap dialog box.


ExportCGM

Purpose

Saves the current drawing in Computer Graphics Metafile file format.

Syntax

ExportCGM (Filename: string; SaveSelected: enum)

Parameters

Filename: string

CGM filename.

SaveSelected: enum (optional)

Save selected objects only.

No!

Yes!


Route...

File, Save As, type a filename, select CGM-Computer Graphics Metafile, in the Save File as Type drop-down list, Save.


ExportEPS

Purpose

Saves the current drawing in Encapsulated PostScript file format.

Syntax

ExportEPS (Filename: string; SaveSelected: enum)

Parameters

Filename: string

EPS filename.

SaveSelected: enum (optional)

Save selected objects only.

No!

Yes!


Route...

File, Save As, type a filename, select EPS-Encapsulated PostScript in the Save File as Type drop-down list, Save.


ExportPCX

Purpose

Saves the current drawing in PC Paintbrush file format.

Syntax

ExportPCX: Filename: string; WidthInPixels: numeric; HeightInPixels: numeric; BitsPerPixel: numeric; DpiX: enum; DpiY: enum; SaveSelected: enum)

Parameters

Filename: string

PCX filename.

WidthInPixels: numeric

Width in pixels of the exported drawing.

HeightInPixels: numeric

Height in pixels of the exported drawing.

BitsPerPixel: numeric

Number of bits per pixel in the exported drawing.

DpiX: numeric

Horizontal dots per inch.

DpiY: numeric

Vertical dots per inch.

SaveSelected: enum (optional)

Save selected objects only.

No!

Yes!


Route...

File, Save As, type a Filename, select PCX-PC Paintbrush in the Save File as Type drop-down list, Save, specify options in the Export PCX-PC Paintbrush dialog box.


ExportTIFF

Purpose

Saves the current drawing in Tagged Image File Format.

Syntax

ExportTIFF (Filename: string; WidthInPixels: numeric; HeightInPixels: numeric; BitsPerPixel: numeric; DpiX: numeric; DpiY: numeric; SaveSelected: enum)

Parameters

Filename: string

TIFF filename.

WidthInPixels: numeric

Width in pixels of the exported drawing.

HeightInPixels: numeric

Height in pixels of the exported drawing.

BitsPerPixel: numeric

Number of bits per pixel in the exported drawing.

DpiX: numeric

Horizontal dots per inch.

DpiY: numeric

Vertical dots per inch.

SaveSelected: enum (optional)

Save selected objects only.

No!

Yes!


Route...

File, Save As, type a Filename, select TIFF-Tagged Image File Format in the Save File as Type drop-down list, Save, specify options in the Export TIFF-Tagged Image File Format dialog box.


ExportWMF

Purpose

Saves the current drawing in Windows Metafile Format.

Syntax

ExportWMF (MetafileType: enum; Filename: string; SaveSelected: enum)

Parameters

MetafileType: enum

Save the file in Microsoft or Aldus Placeable format.

Aldus!

Microsoft!

Filename: string

Name of the exported file.

SaveSelected: enum (optional)

Save selected objects only.

No!

Yes!


Route...

File, Save As, type a Filename, select WMF-Aldus Windows Metafile or WMF-Microsoft Windows Metafile in the Save File as Type drop-down list, Save.


FigureReturn

Purpose

Returns to the previous figure in the Figure Editor. If the Figure Editor contains only one figure, this command closes the Figure Editor and returns to the current drawing.

Syntax

FigureReturn ()


Route...

With more than one figure in the Figure Editor, click outside of the current figure frame.


FigureReturnAll

Purpose

Closes the Figure Editor and returns an edited figure to the current drawing.

Syntax

FigureReturnAll ()


Route...

In the Figure Editor, click outside the figure frame.


File1Open

Purpose

Opens the first file on the list of recently opened files.

Syntax

File1Open ()


Route...

File, choose the first file on the files list.


File2Open

Purpose

Opens the second file on the list of recently opened files.

Syntax

File2Open ()


Route...

File, choose the second file on the files list.


File3Open

Purpose

Opens the third file on the list of recently opened files.

Syntax

File3Open ()


Route...

File, choose the third file on the files list.


File4Open

Purpose

Opens the fourth file on the list of recently opened files.

Syntax

File4Open ()


Route...

File, choose the fourth file on the files list.


FileClose

Purpose

Closes the active window.

Syntax

FileClose (Save: enum)

Parameters

Save: enum (optional)

If this parameter is not specified, the Save message box is displayed.

No!

Yes!


Route...

File, Close.


FileExit

Purpose

Closes Presentations.  Not recordable.

Syntax

FileExit ()


FileOpen

Purpose

Opens a file.

Syntax

FileOpen (Filename: string)

Parameters

Filename: string

File to retrieve.


Route...

File, Open, specify a file to open, Open.


FileOpenDlg

Purpose

Displays the Open File dialog box, which is used to retrieve a file.

Syntax

FileOpenDlg ()


Route...

File, Open, select the check box in the dialog box title bar.


FileRetrieve

Purpose

Inserts a specified graphics file into the current drawing, or inserts a text file into an organization chart outline.

Syntax

FileRetrieve (Filename: string; Redraw: enum)

Parameters

Filename: string

Name of the file to retrieve.

Redraw: enum (optional)

Redraw the current drawing to show changes.

No!

Yes!


Route...

Insert, File, specify a file, Insert.  In an organization chart, choose Insert, Import, specify a text file, Insert.


FileSave

Purpose

Saves the current drawing or slide show.

Syntax

FileSave ()


Route...

In a named file, choose File, Save.


FileSaveAs

Purpose

Saves the current drawing or slide show with a new name or file format.

Syntax

FileSaveAs (Filename: string; SaveFormat: enum; Export: enum; SaveSelected: enum)

Parameters

Filename: string

Name of the file to save.

SaveFormat: enum

File format.

WPAscii!

WPGraphic_10!

WPGraphic_20!

WPMaster_20!

WPMaster_30!

WPPresentation_20!

WPPresentations_30!

WPText_51!

Export: enum

Export the file.

No!

Yes!

SaveSelected: enum

Save selected objects only.

No!

Yes!


Route...

File, Save As, type a filename, select a file type in the Save File as Type drop-down list, Save.


FileSaveAsDlg

Purpose

Displays the Save As dialog box, which is used to save the current document with a new name or file format.

Syntax

FileSaveAsDlg ()


Route...

File, Save As, select the check box in the dialog box title bar.


FillAttributes

Purpose

Specifies fill colors, pattern, and method.

Syntax

FillAttributes (DefaultAttr: enum; ApplyTo: enum; ObjectFilled: enum; ObjectClosed: enum; ObjectFramed: enum; Fill Method: enum; BrushPattern: enum; GradType: enum; UseGradSteps: enum; GradAngle: numeric; GradRefX: numeric; GradRefY: numeric; GradSteps: numeric; Grad1Red: numeric; Grad1Green: numeric; Grad1Blue: numeric; Grad2Red: numeric; Grad2Green: numeric; Grad2Blue: numeric; GradBRed: numeric; GradBGreen: numeric; GradBBlue: numeric; ForeTransparency: enum; BackTransparency: enum)

Parameters

DefaultAttr: enum

Set default fill attributes.

No!

Yes!

ApplyTo: enum

Define fill for graphics, text, or both.

Both!

Graphics!

Text!

ObjectFilled: enum

No!

Yes!

ObjectClosed: enum

No!

Yes!

ObjectFramed: enum

No!

Yes!

FillMethod: enum

Alternating!

Winding!

BrushPattern: enum

Fill pattern.

Arch!

Balls!

BigChecks!

BigCrosshatch!

BigSquares!

Chainlink!

Checks!

Crosses!

Crosshatch!

Fishscale!

Gray12!

Gray25!

Gray50!

Honeycomb!

HorzBricks!

HorzLines1!

HorzLines2!

Mesh!

Patio!

Plaid!

Solid!

Squares!

TiltBricks!

TiltLines1!

TiltLines2!

TiltLines3!

TiltLines4!

Triangles!

VertLines1!

VertLines2!

Waves!

Weave!

GradType: enum

Gradient type.

ConcenCircles!

ConcenEllipse!

ConcenRects!

ConcenSquares!

ConverCircles!

ConverEllipse!

ConverRects!

ConverSquares!

Linear!

None!

Polygonal!

UseGradSteps: enum

Use gradient steps.

No!

Yes!

GradAngle: numeric

Rotation angle for a gradient fill.  The top of the gradient is rotated counter-clockwise.  For example, a 90-degree angle places the top of the gradient parallel to the left margin of the page.

GradRefX: numeric

Horizontal center of a circular or rectangular gradient relative to the page.  Flush left is 0, center is 50, and flush right is 100.

GradRefY: numeric

Vertical center of a circular or rectangular gradient or the top of a linear gradient relative to the page.  Top is 0, center is 50, and bottom is 100.

GradSteps: numeric

Number of steps between colors in a gradient fill.  A value of 0 represents the greatest possible number of steps.

Grad1Red: numeric

Amount of red (0-255) in a solid fill, the top color of a linear gradient or the center color of a circular or rectangular gradient.

Grad1Green: numeric

Amount of green (0-255) in a solid fill, the top color of a linear gradient or the center color of a circular or rectangular gradient.

Grad1Blue: numeric

Amount of blue (0-255) in a solid fill, the top color of a linear gradient or the center color of a circular or rectangular gradient.

Grad2Red: numeric

Amount of red (0-255) in the bottom color of a linear gradient or the outer color of a circular or rectangular gradient.

Grad2Green: numeric

Amount of green (0-255) in the bottom color of a linear gradient or the outer color of a circular or rectangular gradient.

Grad2Blue: numeric

Amount of blue (0-255) in the bottom color of a linear gradient or the outer color of a circular or rectangular gradient.

GradBRed: numeric

Amount of red (0-255) in the background color of a pattern.

GradBGreen: numeric

Amount of green (0-255) in the background color of a pattern.

GradBBlue: numeric

Amount of blue (0-255) in the background color of a pattern.

ForeTransparency: enum

Pattern foreground color transparency.

Opaque!

Transparent!

BackTransparency: enum

Pattern background color transparency.

Opaque!

Transparent!


Route...

Format, Fill Attributes, specify options.


FillAttributesDlg

Purpose

Displays the Fill Attributes dialog box, which is used to specify fill colors, patterns, and methods.

Syntax

FillAttrsDlgBoxDlg ()


Route...

Format, Fill Attributes, select the check box in the dialog box title bar.


FindReplaceTextDlg

Purpose

Displays the Find and Replace dialog box in the Text Editor, which is used to find and replace specified text.

Syntax

FindReplaceTextDlg ()


Route...

In the Text Editor, choose Edit, Find and Replace, select the check box in the dialog box title bar.


FloodFill

Purpose

Uses the Flood Fill painting tool to replace a color region in a bitmap area with another color or pattern.

Syntax

FloodFill (X: numeric; Y: numeric)

Parameters

X: numeric

Horizontal coordinate of the pixel clicked when using the Flood Fill tool.

Y: numeric

Vertical coordinate of the pixel clicked when using the Flood Fill tool.

See Also

BeginFloodFill


Route...

In the Bitmap Editor, choose Insert, Flood Fill.


GalleryOptions

Purpose

Specifies the number of columns to display in the Master Gallery or the QuickArt Gallery, and determines whether to create Quick Galleries.

Syntax

GalleryOptions (NumberOfColumns: numeric; CreateQuickFiles: enum)

Parameters

NumberOfColumns: numeric

Number of columns displayed in the Gallery.

CreateQuickGalleries: enum

Create Quick Galleries.

No!

Yes!


Route...

To display the Master Gallery, choose Slide, Master Gallery.  To display the QuickArt Gallery, choose Insert, QuickArt, click or drag to define a figure area.  From either gallery, choose Options, specify a Number of Columns, select or deselect Create Quick Galleries.


GalleryOptionsDlg

Purpose

Displays the Gallery Options dialog box, which is used to specify the number of columns to display in a gallery, and to determine whether to create Quick Galleries.  Not recordable.

Syntax

GalleryOptionsDlg ()


GetAttrDlg

Purpose

Displays the Get Attributes dialog box, which is used to reset default text or graphics attributes to those of a selected object.

Syntax

GetAttrDlg ()


Route...

Select an object, Format, Get Attributes, select the check box in the dialog box title bar.


GetAttributes

Purpose

Changes default object attributes to those of a selected object.

Syntax

 GetAttributes ()


Route...

Select an object, Format, Get Attributes, select an option.


GoToKeysDlg

Purpose

Displays the Slide Go To Keys dialog box, which is used to assign keystrokes to slides to determine viewing order.

Syntax

GoToKeysDlg ()


Route...

Slide, Go To Keys, select the check box in the dialog box title bar.


GotoPositionDlg

Purpose

Displays the Go To Slide dialog box, which is used to go to a specified slide in the current slide show.

Syntax

GotoPositionDlg ()


Route...

Slide, Go To, select the check box in the dialog box title bar.


Grammatik

Purpose

Opens Grammatik, which checks text for grammatical errors.

Syntax

Grammatik ()


Route...

In the Text Editor, choose Tools, Grammatik.


GroupObjects

Purpose

Groups selected objects so they are treated as one object.

Syntax

GroupObjects ()


Route...

Select objects to group, Graphics, Group.


HardReturn

Purpose

Inserts a hard return into the current text area at the insertion point.

Syntax

HardReturn ()


Route...

In the Text Editor, press Enter.


HelpCoachDlg

Purpose

Displays the Coach dialog box in Help.

Syntax

HelpCoachDlg ()


Route...

Help, Coaches.


HelpHowDoI

Purpose

Opens the How Do I feature in Help, which contains instructions for performing common tasks.

Syntax

HelpHowDoI ()


Route...

Help, How Do I.


HelpIndex

Purpose

Opens the Contents page in Help.

Syntax

HelpIndex ()


Route...

Help, Contents.


HelpKeyboard

Purpose

Opens the Search feature in Help.

Syntax

HelpKeyboard ()


Route...

Help, Search for Help On.


HelpMacros

Purpose

Opens the Presentations online macros reference.

Syntax

HelpMacros ()


Route...

Help, Macros.


HelpTransition

Purpose

Opens Upgrade Expert, which provides information to help you make the transition to Presentations 3.0 from other graphics programs.

Syntax

HelpTransition ()


Route...

Help, Upgrade Expert.


HelpWhatIs

Purpose

Allows you to access Presentations Help by using the mouse or keyboard to select the item you want help on.

Syntax

HelpWhatIs ()


Route...

Press Shift+F1.


InhibitInput

Purpose

Allows the keyboard and menus to be used while a macro is playing.  This command must be used if playing a Coach macro.  Not recordable.

Syntax

InhibitInput (State: enum)

Parameters

State: enum

Inhibit input is on or off.

Off!

On!


InsertFileDlg

Purpose

Displays the Insert File dialog box, which is used to append a drawing file to the current drawing or slide show.

Syntax

InsertFileDlg ()


Route...

Insert, File, select the check box in the dialog box title bar.


InvertColors

Parameters

Changes the colors of selected objects to their contrasting complementary colors.

Syntax

InvertColors ()


Route...

Select objects to modify, choose Format, Image Settings, Invert.


JustifyCenter

Purpose

Centers text.

Syntax

JustifyCenter ()


Route...

In the Text Editor, choose Format, Justification, Center.


JustifyLeft

Purpose

Aligns text at the left margin.

Syntax

JustifyLeft ()


Route...

In the Text Editor, choose Format, Justification, Left.


JustifyRight

Purpose

Aligns text at the right margin.

Syntax

JustifyRight ()


Route...

In the Text Editor, choose Format, Justification, Right.


KerningDlg

Purpose

Displays the Manual Kerning dialog box, which is used to expand and compress letterspacing.

Syntax

KerningDlg ()


Route...

Format, Manual Kerning.


KeyboardCopy

Purpose

Copies a keyboard file.

Syntax

KeyboardCopy (KeyboardName: string; DestName: string)

Parameters

KeyboardName: string

Name of the keyboard to copy.

DestName: string

New name for the copy.


Route...

Edit, Preferences, Keyboard, highlight a keyboard, Copy, type a name in the Copy Keyboard entry box.


KeyboardCreate

Purpose

Creates a new keyboard.

Syntax

KeyboardCreate (KeyboardName: string)

Parameters

KeyboardName: string


Route...

Edit, Preferences, Keyboard, Create, type a name, OK, specify keyboard options.


KeyboardEdit

Purpose

Opens the Keyboard Editor.

Syntax

KeyboardEdit (KeyboardName: string)

Parameters

KeyboardName: string

Name of the keyboard to edit.


Route...

Edit, Preferences, Keyboard, highlight a keyboard, Edit.


KeyboardRename

Purpose

Renames a specified keyboard.

Syntax

KeyboardRename (KeyboardName: string; NewName: string)

Parameters

KeyboardName: string

Keyboard to rename.

NewName: string


Route...

Edit, Preferences, Keyboard, highlight a keyboard, Rename, type a new name.


KeyboardSelect

Purpose

Specifies a keyboard to use, or specifies the default keyboard if the parameter is not used.

Syntax

KeyboardSelect (KeyboardName: string)

Parameters

KeyboardName: string (optional)

Name of a keyboard.

See Also

PreferenceKeyboardDlg


Route...

Edit, Preferences, Keyboard, highlight a Keyboard, Select.


LanguageDlg

Purpose

Displays the Language Settings dialog box, which is used to specify the current language.  Not recordable.

Syntax

LanguageDlg ()


LayoutGetNext

Purpose

Specifies the next layout in the Name dialog box in the Layout Editor.

Syntax

LayoutGetNext ()


Route...

Slide, Edit Layouts, Layouts, Name, click the right arrow button in the Layout Name dialog box.


LayoutGetPrevious

Purpose

Specifies the previous layout in the Name dialog box in the Layout Editor.

Syntax

LayoutGetPrevious ()


Route...

Slide, Edit Layouts, Layouts, Name, click the left arrow button in the Layout Name dialog box.


LayoutNext

Purpose

Opens the next layout in the Layout Editor.

Syntax

LayoutNext ()


Route...

Slide, Edit Layouts, click the Next Layout button on the Power Bar (>>).


LayoutPrevious

Purpose

Opens the previous layout in the Layout Editor.

Syntax

LayoutPrevious ()


Route...

Slide, Edit Layouts, click the Previous Layout button on the Power Bar (<<).


LineAttributes

Purpose

Specifies line color, style, pattern, width, and ends.

Syntax

LineAttributes (DefaultAttr: enum; PopupState: enum; ObjectFilled: enum; ObjectClosed: enum; ObjectFramed: enum; LineEnd1: enum; LineEnd2: enum; LineJoin: enum; PenStyle: enum; PenPattern: enum; PenHorzWidth: numeric; PenVertWidth: numeric; PenFColorRed: numeric; PenFColorGreen: numeric; PenFColorBlue: numeric; PenBColorRed: numeric; PenBColorGreen: numeric; PenBColorBlue: numeric)

Parameters

DefaultAttr: enum

Set default line attributes, rather than use line attributes for a selected objects.

No!

Yes!

PopupState: enum

Define line attributes for graphics, text, or both.

Both!

Graphics!

Text!

ObjectFilled: enum

No!

Yes!

ObjectClosed: enum

No!

Yes!

ObjectFramed: enum

No!

Yes!

LineEnd1: enum

Line end style.  Beginning and ending line end styles are the same unless either end is an arrowhead.

Arrow!

Flat!

Round!

Square!

LineEnd2: enum

Second line end style if LineEnd1 or LineEnd2 Arrow!.  Otherwise, LineEnd2 records with the same value as LineEnd1, and LineEnd1 specifies both line end styles even if a different value is entered for LineEnd2.

Arrow!

Flat!

Round!

Square!

LineJoin: enum

Style used to join lines.

Bevel!

Miter!

None!

Round!

PenStyle: enum

Pen style for lines.

Alternate!

Dash!

Dash2Dot!

Dash2Dot2!

DashDot2!

DotDash!

DotDash2!

Dots!

Long2Short!

Long2Short2!

LongDash!

LongShort!

LongShort2!

ShortDash!

Solid!

TinyDash!

PenPattern: enum

Pen pattern for lines.

Arch!

Balls!

BigChecks!

BigCrosshatch!

BigSquares!

Chainlink!

Checks!

Crosses!

Crosshatch!

Fishscale!

Gray12!

Gray25!

Gray50!

Honeycomb!

HorzBricks!

HorzLines1!

HorzLines2!

Mesh!

Patio!

Plaid!

Solid!

Squares!

TiltBricks!

TiltLines1!

TiltLines2!

TiltLines3!

TiltLines4!

Triangles!

VertLines1!

VertLines2!

Waves!

Weave!

PenHorzWidth: numeric

Horizontal line width, in WordPerfect units (1200ths of an inch).

PenVertWidth: numeric

Vertical line width, in WordPerfect units.

PenFColorRed: numeric

Amount of red (0-255) in the foreground pen color.

PenFColorGreen: numeric

Amount of green (0-255) in the foreground pen color.

PenFColorBlue: numeric

Amount of blue (0-255) in the foreground pen color.

PenBColorRed: numeric

Amount of red (0-255) in the background pen color.

PenBColorGreen: numeric

Amount of green (0-255) in the background pen color.

PenBColorBlue: numeric

Amount of blue (0-255) in the background pen color.


Route...

Format, Line Attributes, specify options.


LineAttributesDlg

Purpose

Displays the Line Attributes dialog box, which is used to edit line color, style, pattern, width, and ends.

Syntax

LineAttributesDlg ()


Route...

Format, Line Attributes, select the check box in the dialog box title bar.


LineSpacingDlg

Purpose

Displays the Line Spacing dialog box, which is used to set spacing between lines of text.

Syntax

LineSpacingDlg ()


Route...

Format, Line, Spacing, select the check box in the dialog box title bar.


MacroFilePlay

Purpose

Plays a specified macro.

Syntax

MacroFilePlay (Filename: string)

Parameters

Filename: string (optional)

Macro filename.


Route...

Tools, Macro, Play, specify a filename.


MacroPause

Purpose

Pauses while recording or playing a macro.  Not recordable.

Syntax

MacroPause ()


MacroPlayDlg

Purpose

Displays the Play Macro dialog box, which is used to select and play a macro.

Syntax

MacroPlayDlg ()


Route...

Tools, Macro, Play, select the check box in the dialog box title bar.


MacroRecord

Purpose

Displays the Record Macro dialog box, which is used to name and record a series of commands.  Not recordable.

Syntax

MacroRecord ()


MacroStop

Purpose

Stops recording or playing a macro.

Syntax

MacroStop ()


Route...

Tools, Macro, Stop.


Mail

Purpose

Displays the Mail dialog box, which is used to send electronic mail.  This command is only available if your computer has electronic mail capability.

Syntax

Mail ()


Route...

File, Send, choose a mail system (options vary according to the mail systems installed).


MailSystem1

Purpose

Sends electronic mail.  If multiple mail systems are installed, this command records with a number in the command name indicating which mail system is active.  When you play the command, the number directs the macro to the specified mail system if available.  If not, another available system is used.

Syntax

MailSystem1 ()


Route...

File, Send, choose a mail system (options vary according to the mail systems installed).


MakeRuntime

Purpose

Creates a runtime slide show.

Syntax

MakeRuntime (Path: string; Filename: string)

Parameters

Path: string

File path for a new runtime slide show.

Filename: string

Name of a new runtime slide show.


Route...

Slide, Make Runtime, specify a directory, type a name.


MakeRuntimeDlg

Purpose

Displays the Make Runtime dialog box, which is used to create a demo slide show.

Syntax

MakeRuntimeDlg ()


Route...

Slide, Make Runtime, select the check box in the dialog box title bar.


MarkAsStaff

Purpose

Adds a staff-level position to an organization chart.

Syntax

MarkAsStaff ()


Route...

In an organization chart, choose Chart, Staff.


MasterGalleryDlg

Purpose

Displays the Master Gallery, which is used to view and select slide show masters.

Syntax

MasterGalleryDlg ()


Route...

Slide, Master Gallery, select the check box in the dialog box title bar.


MenuCopy

Purpose

Copies a menu bar.

Syntax

MenuCopy (MenuName: string; DestName: string)

Parameters

MenuName: string

Name of the menu bar to copy.

DestName: string

New name for the copy.


Route...

Edit, Preferences, Menu Bar, highlight a Menu Bar, Copy, type a name for the copy.


MenuCreate

Purpose

Creates a new menu bar.

Syntax

MenuCreate (MenuName: string)

Parameters

MenuName: string


Route...

Edit, Preferences, Menu Bar, Create, type a name for the new menu bar, OK, specify menu item options and click Add Menu Item for each item added.


MenuEdit

Purpose

Opens the Menu Bar Editor.

Syntax

MenuEdit (MenuName: string)

Parameters

MenuName: string

Name of the menu bar to edit.


Route...

Edit, Preferences, Menu Bar, highlight a Menu Bar, Edit.


MenuRename

Purpose

Renames a specified menu bar.

Syntax

RenameMenu (MenuBarName: string; NewName: string)

Parameters

MenuBarName: string

Menu bar to rename.

NewName: string


Route...

Edit, Preferences, Menu Bar, highlight a menu bar, Rename, type a new name.


MenuSelect

Purpose

Displays a specified menu bar, or the default menu bar if no parameter is used.

Syntax

MenuSelect (MenuBarName: string)

Parameters

MenuBarName: string (optional)

Menu bar to display.


Route...

Edit, Preferences, Menu Bar, highlight a Menu Bar, Select.


MirrorObjectsHorizontally

Purpose

Flips selected objects on a vertical axis.

Syntax

MirrorObjectsHorizontally ()


Route...

Select objects to flip, choose Graphics, Flip, Left/Right.


MirrorObjectsVertically

Purpose

Flips selected objects on a horizontal axis.

Syntax

MirrorObjectsVertically ()


Route...

Select objects to Flip, choose Graphics, Flip, Top/Bottom.


ModifyFigure

Purpose

Opens the Figure Editor to edit a selected figure.  Not recordable.  For a recordable command with a similar function, use ModifyObjects.

Syntax

ModifyFigure ()


ModifyObjects

Purpose

Allows changes to selected objects.

Syntax

ModifyObjects ()


Route...

Select objects to modify, choose Edit, Edit Points or Edit Figure or Edit Chart.


MoveBackward

Purpose

Moves selected objects back one layer in the current drawing.

Syntax

MoveBackward ()


Route...

Select objects to move, choose Graphics, Order, Backward One.


MoveForward

Purpose

Moves selected objects forward one layer in the current drawing.

Syntax

MoveForward ()


Route...

Select objects to move, choose Graphics, Order, Forward One.


MoveSelectedSlides

Purpose

Moves selected slides to the position following the slide specified in the To parameter.

Syntax

MoveSelectedSlides (To: numeric)

Parameters

To: numeric

Number of the slide for selected slides to follow.


Route...

In the Slide List or Slide Sorter, press Ctrl while clicking to select multiple slides, drag selected slides to a new position.


MoveToBack

Purpose

Positions selected objects behind all other objects in a drawing.

Syntax

MoveToBack ()


Route...

Select objects to move, choose Graphics, Order, Back.


MoveToFront

Purpose

Positions selected objects in front of all other objects in a drawing.

Syntax

MoveToFront ()


Route...

Select objects to move, choose Graphics, Order, Front.


NameLayoutDlg

Purpose

Displays the Layout Name dialog box.

Syntax

NameLayoutDlg ()


Route...

Slide, Edit Layouts, Layouts, Name, select the check box in the dialog box title bar.


NewDocumentDlg

Purpose

Displays the New Document dialog box, which is used to create a new slide show or drawing.

Syntax

NewDocumentDlg ()


Route...

File, New, select the check box in the dialog box title bar.


NewDrawingCreate

Purpose

Opens a new drawing window.

Syntax

NewDrawingCreate ()


Route...

File, New, Create a New Drawing.


NewPresentationCreate

Purpose

Creates a new slide show.

Syntax

NewPresentationCreate (MasterName: string; TemplateName: string)

Parameters

MasterName: string

Specifies a master for the new slide show.

TemplateName: string

Name of slide template to use.


Route...

File, New, Create a New Slide Show, select a master, select a template.


NewPresentationDlg

Purpose

Displays the New Slide Show dialog box, which is used to specify a master and a template for a new slide show.  Not recordable.

Syntax

NewPresentationDlg ()


NormalText

Purpose

Turns off all text attributes.

Syntax

NormalText ()


Route...

In the Text Editor, click the right mouse button, choose Normal.


ObjectAreaSelect

Purpose

Selects objects within a specified rectangular area.

Syntax

ObjectAreaSelect (Left: numeric; Bottom: numeric; Right: numeric; Top: numeric; AddToCurrent: enum)

Parameters

Left: numeric

Left edge of the rectangular area, in WordPerfect units (1200ths of an inch).

Bottom: numeric

Bottom edge of the rectangular area, in WordPerfect units.

Right: numeric

Right edge of the rectangular area, in WordPerfect units.

Top: numeric

Top edge of the rectangular area, in WordPerfect units.

AddToCurrent: enum

Currently selected objects remain selected, so objects within the rectangular area are added to the current selection.

No!

Yes!


Route...

Edit, Select, Item, drag to select objects within a rectangular area, or press Ctrl while dragging to add to the current selection.


ObexAddressBookDlg

Purpose

Displays the Address Book dialog box.  Quattro Pro or Paradox must be installed for this command to function.

Syntax

ObexAddressBookDlg ()


Route...

Tools, Object Exchange, Address Book.


ObexPollDlg

Purpose

 Displays the Polls Accounts dialog box.  Quattro Pro or Paradox must be installed for this command to function.

Syntax

ObexPollDlg ()


Route...

Tools, Object Exchange, Poll Now.


ObjectMove

Purpose

Moves selected objects.

Syntax

ObjectMove (XLocation: numeric; YLocation: numeric; DeltaX: numeric; DeltaY: numeric; AddToSelection: enum; Copy: enum)

Parameters

XLocation: numeric

Horizontal position of the center point of objects to move, in WordPerfect units (1200ths of an inch) from the top left corner of the page.

YLocation: numeric

Vertical position of the center point of objects to move, in WordPerfect units from the top left corner of the page.

DeltaX: numeric

Amount to move selected objects horizontally, in WordPerfect units.  Positive values move objects right, and negative values move them left.

DeltaY: numeric

Amount to move selected objects vertically, in WordPerfect units.  Positive values move objects up, and negative values move them down.

AddToSelection: enum

Add specified object to the current selection of objects for moving.

No!

Yes!

Copy: enum

Copy selected objects before moving them.

No!

Yes!


Route...

Select objects to move, click on a selected object and drag to move selection, or press Ctrl while dragging to copy.


ObjectPointSelect

Purpose

Selects an object at a specified location.

Syntax

ObjectPointSelect (XLocation: numeric; YLocation: numeric; AddToSelection: enum)

Parameters

XLocation: numeric

Horizontal position of the center point of an object, in WordPerfect units (1200ths of an inch) from the top left corner of the page.

YLocation: numeric

Vertical position of the center point of an object, in WordPerfect units from the top left corner of the page.

AddToSelection: enum

Add specified object to the current selection.


Route...

Choose Edit, Select, Item, click to select an object, or press Ctrl while clicking to add to current selection.


ObjectScale

Purpose

Sizes selected objects from the size specified by the first four parameters to the size specified by the last four parameters.

Syntax

ObjectScale (InitialLeft: numeric; InitialBottom: numeric; InitialRight: numeric; InitialTop: numeric; FinalLeft: numeric; FinalBottom: numeric; FinalRight: numeric; FinalTop: numeric; Copy: enum)

Parameters

InitialLeft: numeric

Left edge of the rectangular selection area, in WordPerfect units (1200ths of an inch).

InitialBottom: numeric

Bottom edge of the rectangular selection area, in WordPerfect units.

InitialRight: numeric

Right edge of the rectangular selection area , in WordPerfect units.

InitialTop: numeric

Top edge of the rectangular selection area, in WordPerfect units.

FinalLeft: numeric

Left edge of the new object area, in WordPerfect units.

FinalBottom: numeric

Bottom edge of the new object area, in WordPerfect units.

FinalRight: numeric

Right edge of the new object area, in WordPerfect units.

FinalTop: numeric

Top edge of the new object area, in WordPerfect units.

Copy: enum

Copy selected objects before resizing.

No!

Yes!


Route...

Select objects, click on a sizing handle and drag to size, or press Ctrl while dragging to copy objects before resizing.


ObjectSetFillBackground

Purpose

Specifies the background fill color of selected objects, or the default fill background color if no object is selected.

Syntax

ObjectSetFillBackground (Red: numeric; Green: numeric; Blue: numeric; Transparent: numeric)

Parameters

Red: numeric

Amount of red (0-255) in the background fill color.

Green: numeric

Amount of green (0-255) in the background fill color.

Blue: numeric

Amount of blue (0-255) in the background fill color.

Transparent: numeric

Background fill transparency.  Use 1 to specify transparency and 0 to specify no transparency.


Route...

Click the Fill Colors icon, click the right mouse button to specify a background fill color.


ObjectSetFillForeground

Purpose

Specifies the foreground fill color of selected objects, or the default foreground color if no object is selected.

Syntax

ObjectSetFillForeground (Red: numeric; Green: numeric; Blue: numeric; Transparent: numeric)

Parameters

Red: numeric

Amount of red (0-255) in the foreground fill color.

Green: numeric

Amount of green (0-255) in the foreground fill color.

Blue: numeric

Amount of blue (0-255) in the foreground fill color.

Transparent: numeric

Foreground fill transparency.  Use 1 to specify transparency and 0 to specify no transparency.


Route...

Click the Fill Color icon, click to specify a foreground fill color.


ObjectSetFillPattern

Purpose

Specifies a fill pattern or gradient fill for selected objects, or a default pattern if no object is selected.

Syntax

ObjectSetFillPattern: Pattern: enum

Parameters

Pattern: enum

Specifies a fill pattern or gradient fill.

Arch!

Balls!

BigChecks!

BigCrossHatch!

BigSquares!

ChainLink!

Checks!

Crosses!

CrossHatch!

EighthGray!

FishScale!

FourthGray!

GradCircBottom!

GradCircCenter!

GradCircLeftBottom!

GradCircLeftTop!

GradCircRight!

GradCircRightBottom!

GradCircRightTop!

GradCircTop!

GradHorzAll!

GradHorzHalf!

GradHorzMost!

GradHorzPart!

GradRectBottom!

GradRectCenter!

GradRectLeftBottom!

GradRectLeftTop!

GradRectRight!

GradRectRightBottom!

GradRectRightTop!

GradRectTop!

GradTilt1All!

GradTilt1Half!

GradTilt1Most!

GradTilt1Part!

GradTilt2All!

GradTilt2Half!

GradTilt2Most!

GradTilt2Part!

GradVertAll!

GradVertHalf!

GradVertMost!

GradVertPart!

HalfGray!

HoneyComb!

HorzBricks!

HorzLines1!

HorzLines2!

Mesh!

Patio!

Plaid!

Solid!

Squares!

TiltBricks!

TiltLines1!

TiltLines2!

TiltLines3!

TiltLines4!

Triangles!

VertLines1!

VertLines2!

Waves!

Weave!


Route...

Click the Fill Attributes icon, specify a pattern.


ObjectSetFillState

Purpose

Specifies whether selected objects are filled or not filled, or sets the default fill state if no object is selected.

Syntax

ObjectSetFillState (FillState: enum)

Parameters

FillState: enum

Filled!

Hollow!


Route...

Click the Fill Attributes icon, select or deselect None.


ObjectSetFrameState

Purpose

Specifies whether object outline is on or off for selected objects, or sets the default state if no object is selected.

Syntax

ObjectSetFrameState: (FrameState: enum)

Parameters

FrameState: enum

FrameOff!

FrameOn!


Route...

Click the Line Attributes icon, select or deselect None.


ObjectSetLineBackground

Purpose

Specifies the background line color for selected objects, or the default background color if no object is selected.

Syntax

ObjectSetLineBackground (Red: numeric; Green: numeric; Blue: numeric; Transparent: numeric)

Parameters

Red: numeric

Amount of red (0-255) in the line background color.

Green: numeric

Amount of green (0-255) in the line background color.

Blue: numeric

Amount of blue (0-255) in the line background color.

Transparent: numeric

Line background transparency.  Use 1 to specify transparency and 0 to specify no transparency.


Route...

Click the Line Colors icon, click the right mouse button to select a background color.


ObjectSetLineForeground

Purpose

Specifies the line foreground color of selected objects, or the default foreground color if no object is selected.

Syntax

ObjectSetLineForeground (Red: numeric; Green: numeric; Blue: numeric; Transparent: numeric)

Parameters

Red: numeric

Amount of red (0-255) in the line foreground color.

Green: numeric

Amount of green (0-255) in the line foreground color.

Blue: numeric

Amount of blue (0-255) in the line foreground color.

Transparent: numeric

Line foreground transparency.  Use 1 to specify transparency and 0 to specify no transparency.


Route...

Click the Line Colors icon, click to select a foreground color.


ObjectSetLinePattern

Purpose

Specifies a line pattern or gradient for selected objects, or a default pattern if no object is selected.  Not recordable.

Syntax

ObjectSetLinePattern:  (Pattern: enum)

Parameters

Pattern: enum

Line pattern.

Arch!

Balls!

BigChecks!

BigCrossHatch!

BigSquares!

ChainLink!

Checks!

Crosses!

CrossHatch!

EighthGray!

FishScale!

FourthGray!

HalfGray!

HoneyComb!

HorzBricks!

HorzLines1!

HorzLines2!

Mesh!

Patio!

Plaid!

Solid!

Squares!

TiltBricks!

TiltLines1!

TiltLines2!

TiltLines3!

TiltLines4!

Triangles!

VertLines1!

VertLines2!

Waves!

Weave!


ObjectSetLineStyle

Purpose

Specifies a line style for selected objects, or a default style if no object is selected.

Syntax

ObjectSetLineStyle (Style: enum)

Parameters

Style: enum

Line style.

Alternate!

Dash!

DashDashDot!

DashDashDotDot!

DashDot!

DashDotDot!

DotDotDash!

Dots!

LongDash!

LongLongShort!

LongLongShortShort!

LongShort!

LongShortShort!

ShortDash!

Solid!

TinyDash!


Route...

Click the Line Attributes icon, click to select a line style.


ObjectSetLineWidth

Purpose

Specifies line width for selected objects, or sets a default width if no object is selected.

Syntax

ObjectSetLineWidth (LineWidth: numeric)

Parameters

LineWidth: numeric

Line width in WordPerfect units (1200ths of an inch), with 0 specifying a width of one pixel.


Route...

Click the Line Attributes icon, click to select a line width.


Ole20InsertObjectDlg

Purpose

Displays the Insert Object dialog box, which is used to insert an OLE object into the current drawing.

Syntax

Ole20InsertObjectDlg ()


Route...

Insert, Object, select the check box in the dialog box title bar.


OleBrowseLinksDlg

Purpose

Displays the Links dialog box, which is used to edit OLE links.

Syntax

OleBrowseLinksDlg ()


Route...

Edit, Links.


OleChartCloseFile

Purpose

Closes a data chart and returns to an OLE client document when Presentations is the server.

Syntax

OleChartCloseFile ()


Route...

After opening a data chart from a client document, choose File, Close and Return to (Filename).


OleChartExit

Purpose

Exits Presentations and returns to an OLE client application when Presentations the server.

Syntax

OleChartExit ()


Route...

After opening a data chart from a client document, choose File, Exit and Return to (Filename).


OleChartUpdateFile

Purpose

Updates a data chart in an OLE client document when Presentations the OLE server.

Syntax

OleChartUpdateFile ()


Route...

After opening a data chart from a client document, choose File, Update (Filename).


OleCloseFile

Purpose

Closes a drawing and returns to an OLE client application when Presentations is the OLE server.

Syntax

OleCloseFile ()


Route...

After opening a drawing from a client document, choose File, Close and Return to (Filename).


OleExit

Purpose

Exits Presentations and returns to an OLE client document when Presentations is the server.  Not recordable.

Syntax

OleExit ()


OleInsertfromFile

Purpose

Creates an OLE object from a specified file.

Syntax

OleInsertfromFile (Filename: string; IsLink: enum; IsIconic: enum)

Parameters

Filename: string

Filename of the object to link.

IsLink: enum

Link the file rather than embed the file.

False!

True!

IsIconic: enum

Display the object as an icon.

False!

True!


Route...

Insert, Object, Create from File, specify a filename, select or deselect Link, select or deselect Display As Icon.


OleInsertObject

Purpose

Inserts an OLE object into the current drawing.

Syntax

OleInsertObject (Description: string; UseIcon: enum)

Parameters

Description: string

Description that appears in the list box for the OLE item type.

UseIcon: enum

Display the inserted object as an icon.

No!

Yes!


Route...

Insert, Object, Create New, select an object type, select or deselect Display As Icon.


OlePlayInformation

Purpose

Sets activation options and timing for OLE objects.

Syntax

OlePlayInformation (Verb: numeric; IsHidden: enum; PlayOnClick: enum; PlayOnTransition: enum; DelayTime: numeric)

Parameters

Verb: numeric

Specifies an action to perform on an object.  See the Windows registration database for possible values.

IsHidden: enum

Hide an object when not playing.

No!

Yes!

PlayOnClick: enum

Object plays when clicked during slide show play.

No!

Yes!

PlayOnTransition: enum

Object plays as soon as the transition from the previous slide has finished.

No!

Yes!

DelayTime: numeric

The amount of time after the transition to delay before playing the object.  In tenths of a second.


Route...

Slide, OLE Play Settings, select options.


OlePlaySettings

Purpose

Displays the Play Settings dialog box, which is used to specify activation settings for OLE objects.

Syntax

OlePlaySettings ()


Route...

Slide, OLE Play Settings, select the checkbox in the dialog box title bar.


OleSaveAsDlg

Purpose

Displays the Save As dialog box for OLE objects, which is used to save a copy of an OLE drawing with a new name or file format.

Syntax

OleSaveAsDlg ()


Route...

After opening a drawing from a client document, choose File, Save Copy As, select the check box in the dialog box title bar.


OleUpdateFile

Purpose

Updates a Presentations OLE object in a client application with any changes.

Syntax

OleUpdateFile ()


Route...

Edit, Links, highlight a link to update, Update Now.


OrgBoxOptionsDlg

Purpose

Displays the Box Options dialog box for organization charts.

Syntax

OrgBoxOptionsDlg ()


Route...

In an organization chart, choose Chart, Box Options, select the check box in the dialog box title bar.


OrgChartFontAttrsDlg

Purpose

Displays the Text Attributes dialog box for organization chart, which is used to specify the appearance of text.

Syntax

OrgChartFontAttrsDlg ()


Route...

In an organization chart, click the right mouse button, choose Font Attributes.


OrgChartFontDlg

Purpose

Displays the Font dialog box for organization charts, which is used to specify a font.

Syntax

OrgChartFontDlg ()


Route...

In an organization chart, choose Format, Font, select the check box in the dialog box title bar.


OrgChartLayoutDlg

Purpose

Displays the Layout dialog box for organization charts.

Syntax

OrgChartLayoutDlg ()


Route...

In an organization chart, choose Chart, Layout, select the check box in the dialog box title bar.


OutlineObject

Purpose

Displays selected objects as line drawings.

Syntax

OutlineObject ()


Route...

Select object to outline, choose Format, Image Settings, Outline.


OutlineRevealCodes

Purpose

Displays text codes for the current text chart.

Syntax

OutlineRevealCodes ()


Route...

In the Outliner, choose View, Reveal Codes.


OverrideSlideDlg

Purpose

Displays the Override dialog box, which is used to override slide options.

Syntax

OverrideSlideDlg ()


Route...

Slide, Override, select the check box in the dialog box title bar.


PageColorDlg

Purpose

Displays the Page Color Settings dialog box, which is used to specify a document page color.

Syntax

PageColorDlg ()


Route...

Format, Page, Color, select the check box in the dialog box title bar.


PageFormatDlg

Purpose

Displays the Page Format dialog box, which is used to specify page size and margins.

Syntax

PageFormatDlg ()


Route...

Format, Page, Size/Margins, select the check box in the dialog box title bar.


BitmapPaintBrush
PaintBrush

Purpose

Uses the Paint Brush tool to create a bitmap object in the Bitmap Editor.

Syntax

BitmapPaintBrush (X: numeric; Y: numeric)

Parameters

X: numeric

Horizontal position of pixels clicked when painting.  Repeat the X and Y parameters for each pixel covered, and enclose repeated parameters in braces {}.

Y: numeric

Vertical position of pixels clicked when painting.


Route...

In the Bitmap Editor, choose Insert, Paint Brush.


PaintDropMarquee

Purpose

Copies the selected portion of a bitmap area.  Precede with PaintMoveMarquee.

Syntax

PaintDropMarquee (EndMarquee: enum)

Parameters

EndMarquee: enum (optional)

Turn off select mode for the copied portion.

No!

Yes!


Route...

In the Bitmap Editor, drag and release to move a selected area.  Press Ctrl while dragging to leave a copy of the original.


PaintDropper

Purpose

Activates the Pickup Color painting tool in the Bitmap Editor.

Syntax

PaintDropper ()


Route...

In the Bitmap Editor, choose Insert, Pickup Color.


PaintEraser

Purpose

Activates the Eraser painting tool in the Bitmap Editor.

Syntax

PaintEraser ()


Route...

In the Bitmap Editor, choose Insert, Eraser.


PaintEscapeUndo

Purpose

Removes the effects of the most recent editing change in the Bitmap Editor.  This command records if you press Esc in the Bitmap Editor, but to add this function to a macro, use BitmapUndo.

Syntax

PaintEscapeUndo ()


Route...

In the Bitmap Editor, press Esc.


PaintMoveMarquee

Purpose

Moves a selected bitmap area.  Follow with PaintDropMarquee.

Syntax

PaintMoveMarquee (DeltaX: numeric; DeltaY: numeric; EraseUnder: enum)

Parameters

DeltaX: numeric (optional)

Amount of horizontal movement, in pixels.

DeltaY: numeric (optional)

Amount of vertical movement, in pixels.

EraseUnder: enum

Erase area beneath new selection location.

No!

Yes!


Route...

In the Bitmap Editor, drag and release to move a selected area.  Press Ctrl while dragging to leave a copy of the original.


PasteMarquee

Purpose

Retrieves a bitmap object from the Clipboard and inserts it into the current drawing.

Syntax

PasteMarquee ()


Route...

In the Bitmap Editor, when the Clipboard contains a bitmap object, choose Edit, Paste.


PasteObject

Purpose

Inserts an OLE object from the clipboard into the current drawing.

Syntax

PasteObject (FormatName: string; Format: numeric; OleFormat: enum; InsertLink: enum; InsertIcon: enum)

Parameters

FormatName: string (optional)

Name of clipboard format (such as Metafile).

Format: numeric (optional)

Clipboard format ID number.  Use only if FormatName is not specified.

OleFormat: enum (optional)

Insert clipboard contents as an OLE object.

No!

Yes!

InsertLink: enum (optional)

Insert object as a link.  Use only if the clipboard format is an OLE type.

No!

Yes!

InsertIcon: enum (optional)

Display an OLE object as an icon.  Use only if the clipboard format is an OLE type.

No!

Yes!


Route...

When the clipboard contains an OLE object, choose Edit, Paste Special, specify options.


PasteSpecialOle20Dlg

Purpose

Displays the Paste Special dialog box, which is used to paste OLE objects from the Clipboard into the current drawing.

Syntax

PasteSpecialOle20Dlg ()


Route...

When the clipboard is not empty, choose Edit, Paste Special, select the check box in the dialog box title bar.


PlaySlideShow

Purpose

Plays a slide show and specifies play options.

Syntax

PlaySlideShow (MakeRunTime: enum; PenSize: numeric; PenRedValue: numeric; PenGreenValue: enum; PenBlueValue: enum; SlideNumberStart: numeric; RepeatShow: enum; CreateQuickShow: enum; UseQuickShow: enum; ShowFileName: string)

Purpose

MakeRuntime: enum

Make a run time show file.

No!

Yes!

PenSize: numeric

Size of the highlighter, in WordPerfect units (1200ths of an inch).

PenRedValue: numeric

Highlighter color. Value (0-255).

PenGreenValue: numeric

Highlighter color. Value (0-255).

PenBlueValue: numeric

Highlighter color. Value (0-255).

Mode: enum

Mode in which a slide show is played.

Normal!

Runtime!

ShowFile!

Tutorial!

SlideNumberStart: numeric (optional)

First slide in a slide show.

RepeatShow: enum (optional)

Play the slide show again.

No!

Yes!

CreateQuickShow: enum (optional)

Create a Quick Show as the slide show plays.

No!

Yes!

UseQuickShow: enum (optional)

Use a Quick Show during playback.

No!

Yes!

ShowFileName: string (optional)

Slide show to play.


Route...

Slide, Play Slide Show, specify options, Play.


PlaySlideShowDlg

Purpose

Displays the Play Slide Show dialog box, which is used to select play options and to play the current slide show.

Syntax

PlaySlideShowDlg ()


Route...

Slide, Play Slide Show, select the check box in the dialog box title bar.


ViewPointerPosition

PointerPosition

Purpose

Toggles the pointer position display in the status bar.

Syntax

PointerPosition ()


Route...

Click the Position Display button on a custom Toolbar.  This button is not on the default Toolbars, but you can use the Toolbar Editor to add it to a custom Toolbar.


PRActivate

Purpose

Activates the Presentations window.  Not recordable.

Syntax

PRActivate ()


PreferenceBackupDlg

Purpose

Displays the Backup dialog box, which is used to specify document backup preferences.  Not recordable.

Syntax

PreferenceBackupDlg ()


PreferenceDateTime

Purpose

Specifies date and time format.

Syntax

PreferenceDateTime (DateTimeString: string)

Parameters

DateTimeString: string

Date and time format.


Route...

Edit, Preferences, Date Format, specify a date and time format or choose Custom and specify a date and time format.


PreferenceDateTimeDlg

Purpose

Displays the Date/Time Format dialog box, which is used to specify date and time format preferences.  Not recordable.

Syntax

PreferenceDateTimeDlg ()


PreferenceEnvironDlg

PreferenceEnvironmentDlg

Purpose

Displays the Environment dialog box, which is used to specify environment preferences.  Not recordable.

Syntax

PreferenceEnvironmentDlg ()


PreferenceFormSettings

Purpose

Specifies default page and margin sizes.

Syntax

PreferenceFormSettings (FormWidth: numeric; FormHeight: numeric; MarginLeft: numeric; MarginBottom: numeric; MarginRight: numeric; MarginTop: numeric)

Parameters

FormWidth: numeric

Page width, in WordPerfect units (1200ths of an inch).

FormHeight: numeric

Page height, in WordPerfect units.

MarginLeft: numeric

Size of the left margin, in WordPerfect units.

MarginBottom: numeric

Size of the bottom margin, in WordPerfect units.

MarginRight: numeric

Size of the right margin, in WordPerfect units.

MarginTop: numeric

Size of the top margin, in WordPerfect units.

See Also

PreferencePageColor


PreferenceKeyboardDlg

Purpose

Displays the Keyboard Preferences dialog box, which is used to specify a keyboard.

Syntax

PreferenceKeyboardDlg ()


Route...

Edit, Preferences, Keyboard.


PreferenceLOFDlg

Purpose

Displays the Location of Files dialog box.  Not recordable.

Syntax

PreferenceLOFDlg ()


PreferenceMenuDlg

Purpose

Displays the Menu Bar Preferences dialog box, which is used to create and modify menu layouts.

Syntax

PreferenceMenuDlg ()


Route...

Edit, Preferences, Menu Bar.


PreferencePageColor

Purpose

Specifies page color preferences.

Syntax

PreferencePageColor (GradientFlag: enum; SolidColorRed: numeric; SolidColorGreen: numeric; SolidColorBlue: numeric; GradientColorRed: numeric; GradientColorGreen: numeric; GradientColorBlue: numeric; GradientType: enum; GradientAngle: numeric; GradientSteps: numeric; GradientRefX: numeric; GradientRefY: numeric)

Parameters

GradientFlag: enum

Gradient, rather than solid color.

No!

Yes!

SolidColorRed: numeric

Amount of red (0-255) in a solid page color, the top color of a linear gradient, or the center color of a circular or rectangular gradient.

SolidColorGreen: numeric

Amount of green (0-255) in a solid page color, the top color of a linear gradient, or the center color of a circular or rectangular gradient.

SolidColorBlue: numeric

Amount of blue (0-255) in a solid page color, the top color of a linear gradient, or the center color of a circular or rectangular gradient.

GradientColorRed: numeric

Amount of red (0-255) in the bottom color of a linear gradient, or the outer color of a circular or rectangular gradient.

GradientColorGreen: numeric

Amount of green (0-255) in the bottom color of a linear gradient, or the outer color of a circular or rectangular gradient.

GradientColorBlue: numeric

Amount of blue (0-255) in the bottom color of a linear gradient, or the outer color of a circular or rectangular gradient.

GradientType: enum

Linear, circular, or rectangular gradient.

Grad_CCircles!

Grad_Linear!

Grad_None!

Grad_VRects!

GradientAngle: numeric

Rotation angle for a gradient page color.  The top of the gradient is rotated counter-clockwise.  For example, a 90-degree angle places the top of the gradient along the left margin of the page.

GradientSteps: numeric

Number of steps between colors in a gradient page color.  A value of 0 represents the greatest possible number of steps.

GradientRefX: numeric

Horizontal center of a circular or rectangular gradient relative to the page.  Flush left is 0, center is 50, and flush right is 100.

GradientRefY: numeric

Vertical center of a circular or rectangular gradient or the top of a linear gradient relative to the page.  Top is 0, center is 50, and bottom is 100.


PreferencePresentationDlg

Purpose

Displays the Slide Show dialog box.  Not recordable.

Syntax

PreferencePresentationDlg ()


PreferencePrintDlg

Purpose

Displays the Print dialog box, which is used to specify printing preferences.  Not recordable.

Syntax

PreferencePrintDlg ()


PreferencesDlg

Purpose

Displays the Preference dialog box, used to set system default options.  Not recordable.

Syntax

PreferencesDlg ()


PreferenceToolbarDlg

Purpose

Displays the Toolbar Preferences dialog box, which is used to select and customize Toolbars.  Not recordable.

Syntax

PreferenceToolbarDlg ()


PrintDlg

Purpose

Displays the Print dialog box.

Syntax

PrintDlg ()


Route...

File, Print, select the check box in the dialog box title bar.


PrintDocument

Purpose

Prints the current document.

Syntax

PrintDocument (CurrentPage: numeric; TotalPages: numeric; NumberOfCopies: numeric; Units: enum; BlackWhite: enum; CopiesPrintedBy: enum; PrintBinding: enum; PrintSource: enum; SelectedObjects: numeric; DocOnDisk: numeric; WhichPages: numeric; PrintOffset: enum; TopAdjust: numeric; SideAdjust: numeric; FileFormat: enum; PrinterLongName: numeric; PrinterDriverName: numeric; DeviceName: numeric; FormWidth: numeric; FormHeight: numeric; LeftMargin: numeric; BottomMargin: numeric; RightMargin: numeric; TopMargin: numeric; Mode: enum; HandoutPerPage: numeric; NotesPerPage: numeric; FirstSlide: numeric; LastSlide: numeric; ViewPrintJob: enum; NoBackground: enum; SlideTitle: enum; SlideNumber: enum; PrintSlideRange: enum; BindingOffset: numeric)

Parameters

CurrentPage: numeric

Page to print.

TotalPages: numeric

Total number of pages to print.

NumberOfCopies: numeric

Number of copies to print.

Units: enum

Unit of measurement.

IDU_cm!

IDU_Inches!

IDU_Inchesi!

IDU_mm!

IDU_Points!

IDU_WP42!

IDU_WPU!

BlackWhite: enum

Print in black and white mode.

No!

Yes!

CopiesPrintedBy: enum

Generate copies with the printer or the application.

Application!

Printer!

PrintBinding: enum

Left!

Top!

PrintSource: enum

Current_Page!

Document_On_Disk!

Full_Doc!

Page_Range!

Print_Handouts!

Print_List!

Print_Notes!

Print_Slides!

Selected_Objects!

Print_Preview!

SelectedObjects: numeric

Number of selected objects.

DocOnDisk: numeric

WhichPage: numeric

Pages to print.

PrintOffset: enum

Binding edge.

Bind_Left!

Bind_Top!

Side_Left!

Side_Right!

Top_Down!

Top_Up!

TopAdjust: numeric

Top margin offset.

SideAdjust: numeric

Side margin offset.

FileFormat: enum

WPG10!

WPG20!

PrinterLongName: numeric

PrinterDriverName: numeric

DeviceName: numeric

FormWidth: numeric

Paper width in WordPerfect units (1200ths of an inch).

FormHeight: numeric

Paper height in WordPerfect units.

LeftMargin: numeric

Left margin size in WordPerfect units.

BottomMargin: numeric

Bottom margin size in WordPerfect units.

RightMargin: numeric

Right margin size in WordPerfect units.

TopMargin: numeric

Top margin size in WordPerfect units.

Mode: enum

Part of the document to print.

Disk!

Drawing!

Handouts!

List!

Notes!

Slides!

HandoutsPerPage: numeric

Number of slides to print per page.

NotesPerPage: numeric

Number of speaker notes to print per page.

FirstSlide: numeric

Number of the first slide to print.

LastSlide: numeric

Number of the last slide to print.

ViewPrintJob: enum

No!

NoBackground: enum

Select Don't Print Background in the Print dialog box.

No!

Yes!

NoBackground: enum

Print slide background.

No!

Yes!

SlideTitle: enum

Print slide title.

No!

Yes!

SlideNumber: enum

Print slide number.

No!

Yes!

PrintSlideRange: enum

Range option is active.

No!

Yes!

BindingOffset: numeric

Print binding offset.


Route...

File, Print, specify options in the Print dialog box, Print.


EnvOpenDocuments

EnvCurrentFilename

Purpose

Returns the name of the current file.  Not recordable.

Syntax

 EnvCurrentFilename ()

Return Value

string

Current filename.

See Also

System Variables


EnvNumberOfDocuments

Purpose

Returns the number of open documents.  Not recordable.

Syntax

numeric EnvNumberOfDocuments ()

Return Value

numeric

See Also

System Variables


PutAttributes

Purpose

Applies the current default attributes to selected objects.

Syntax

PutAttributes ()


Route...

Select objects to modify, Format, Apply Attributes.


Quick3D

Purpose

Adds the appearance of depth to selected objects using Quick3-D.

Syntax

Quick3D (Type: enum; Depth: numeric; X_Rotation:  numeric; Y_Rotation: numeric; Z_Rotation: numeric; SideRelativeColorValue: numeric)

Parameters

Type: enum

Perspective.

Inverse!

Linear!

Parallel!

Depth: numeric

Percentage of depth.

X_Rotation: numeric

Degree of rotation around the X axis.

Y_Rotation: numeric

Degree of rotation around the Y axis.

Z_Rotation: numeric

Degree of rotation around the Z axis.

SideRelativeColorValue: numeric

Percentage by which to lighten or darken a side relative to the front.  Values range from 1 to 100 to lighten a side, and from -1 to -100 to darken a side.


Route...

Select objects to modify, choose Graphics, Quick3-D, specify options.


Quick3DDlg

Purpose

Displays the Quick3-D dialog box, which is used to change the apparent depth of selected objects.

Syntax

Quick3DDlg ()


Route...

Select objects to extrude, choose Graphics, Quick3-D, select the check box in the dialog box title bar.


QuickCorrect

Purpose

Turns QuickCorrect on or off.

Syntax

QuickCorrect (State: enum)

Parameters

State: enum (optional)

Off!

On!

Toggle!


Route...

Tools, QuickCorrect.


QuickCorrectAddItem

Purpose

Adds a word/correction pair to QuickCorrect.

Syntax

QuickCorrectAddItem (StringTyped: string; ReplaceString: string)

Parameters

StringTyped: string

Word to add.

ReplaceString: string

Correction to add.


Route...

Tools, QuickCorrect, type a word in the Replace entry box, type a word in the With entry box.


CapBeginSentence

Purpose

Turns Capitalize First Letter on or off in QuickCorrect.

Syntax

CapBeginSentence (State: enum)

Parameters

State: enum

Off!

On!

Toggle!


Route...

Tools, QuickCorrect, Options, Capitalize First Letter.


QuickCorrectDeleteItem

Purpose

Deletes a word/correction pair from QuickCorrect.

Syntax

QuickCorrectDeleteItem (StringTyped: string)

Parameters

StringTyped: string

Word to delete.


Route...

Tools, QuickCorrect, select an entry, Delete Entry.


QuickCorrectDlg

Purpose

Displays the QuickCorrect dialog box, which displays the current list of word/correction pairs.

Syntax

QuickCorrectDlg ()


Route...

Tools, QuickCorrect, select the check box in the dialog box title bar.


DoubleSmartQuote

Purpose

Turns double smart quotes on or off and specifies quote characters in QuickCorrect.

Syntax

DoubleSmartQuote (State: enum; OpenQuote: string; CloseQuote: string)

Parameters

State: enum (optional)

Off!

On!

OpenQuote: string (optional)

Character to use for double open quote.

CloseQuote: string (optional)

Character to use for double close quote.


Route...

Tools, QuickCorrect, Options, Turn On Double Quotes, specify open and close quotes.


QuickCorrectOptions

Purpose

Opens the QuickCorrect options dialog box, which is used to specify QuickCorrect default settings.  Not recordable.

Syntax

QuickCorrectOptions ()


UseRegQuotesWithNumbers

Purpose

Turns Use Regular Quotes with Numbers on or off in QuickCorrect.

Syntax

UseRegQuotesWithNumbers (State: enum)

Parameters

State: enum (optional)

Off!

On!

Toggle!


Route...

Tools, QuickCorrect, Options, Use Regular Quotes with Numbers.


EndOfSentenceSpacing

Purpose

Specifies an end of sentence correction type in QuickCorrect.

Syntax

EndOfSentenceSpacing ()


Route...

Tools, QuickCorrect, Options, select an options from the End of Sentence Corrections group box.


SingleSmartQuote

Purpose

Turns single smart quotes on or off and specifies quote characters in QuickCorrect.

Syntax

SingleSmartQuote (State: enum; OpenQuote: string; CloseQuote: string)

Parameters

State: enum (optional)

Off!

On!

OpenQuote: string (optional)

Character to use for single open quote.

CloseQuote: string (optional)

Character to use for single close quote.


Route...

Tools, QuickCorrect, Turn On Single Quotes, specify open and close quotes.


IrregularCap

Purpose

Turns Correct TWo IRregular CApitals on or off in QuickCorrect.

Syntax

IrregularCap (State: enum)

Parameters

State: enum (optional)

Off!

On!

Toggle!


Route...

Tools, QuickCorrect, Options, Correct TWo IRregular CApitals.


SingleSpaceInSentence

Purpose

Turns Double Space to Single Space on or off in QuickCorrect.

Syntax

SingleSpaceInSentence ()


Route...

Tools, QuickCorrect, Options, Double Space to Single Space.


QuickWarp

Purpose

Applies a QuickWarp effect to selected objects.

Syntax

QuickWarp (Envelope: numeric)

Parameters

Envelope: numeric

Specifies a predefined envelope to apply to selected objects.  Values range from 0 to 48, with 0 indicating the top left envelope on the palette and 48 indicating the bottom right envelope.


Route...

Select objects, choose Graphics, QuickWarp, select a shape.


QuickWarpDlg

Purpose

Displays the QuickWarp dialog box, which is used to apply a QuickWarp effect to selected objects.

Syntax

QuickWarpDlg ()


Route...

Select objects, choose Graphics, QuickWarp, select the check box in the dialog box title bar.


RealizeFontChanges

Purpose

Implements font changes.  Precede with SetFontFace.

Syntax

RealizeFontChanges (SaveTo: enum)

Parameters

SaveTo: enum (optional)

Save changes as default values, for the selected object, or both.

Both!

Default!

Selected!


Route...

In the Text Editor, choose Format, Font, select a font face.


Redo

Purpose

Reverses the action of Undo.

Syntax

Redo ()


Route...

Edit, Redo.


RedrawChart

Purpose

Updates the current chart to reflect changes in the Datasheet or Outliner.

Syntax

RedrawChart ()


Route...

In a data chart, choose View, Redraw.


RefreshScreen

Purpose

Redraws the current drawing.

Syntax

RefreshScreen ()


Route...

Press Ctrl+F3.


ReplaceMasters

Purpose

Retrieves a new slide show master file, replacing the current slide show master.

Syntax

ReplaceMasters (Filename: string)

Parameters

Filename: string

Master file.


Route...

Slide, Master Gallery, select a master and choose Retrieve, or choose Other File, specify a filename, Insert.


ResetColorTable

Purpose

Resets the color table in color attributes to the default values.

Syntax

ResetColorTable ()


Route...

Format, Color Attributes, Define, Reset.


RetrieveChartStyle

Purpose

Opens a specified chart style.

Syntax

RetrieveChartStyle (Filename: string; Type: enum)

Parameters

Filename: string

Chart style to retrieve.

Type: enum

Data!

Org!

Text!

See Also

SaveChartStyle


Route...

In a data chart, choose Chart, Retrieve Style, specify a filename, Retrieve.


RetrieveColorPaletteDlg

Purpose

Displays the Retrieve Color Palette dialog box.  Not recordable.

Syntax

RetrieveColorPaletteDlg ()


RetrieveColorPalette

Purpose

Opens a specified color palette.

Syntax

RetrieveColorPalette (Filename: string)

Parameters

Filename: string

Name of a color palette file to retrieve.


Route...

Format, Color Attributes, Retrieve, specify a color palette file.


RetrieveFigure

Purpose

Inserts a graphic from the QuickArt gallery into the current drawing at the location specified in the first four parameters.  Without these parameters, the command retrieves a full-page figure.  With no parameters, the command displays the QuickArt Gallery.

Syntax

FigureRetrieve (Left: numeric; Top: numeric; Right: numeric; Bottom: numeric; Filename: string; FigureIndex: numeric)

Parameters

Left: numeric (optional)

Top horizontal coordinate of the figure area, in WordPerfect units (1200ths of an inch.)

Top: numeric (optional)

Top vertical coordinate of the figure area, in WordPerfect units.

Right: numeric (optional)

Bottom horizontal coordinate of the figure area, in WordPerfect units.

Bottom: numeric (optional)

Bottom vertical coordinate of the figure area, in Wordperfect units.

Filename: string (optional)

Graphics file to retrieve.  When you use this parameter, no dialog box is displayed before the specified file is retrieved.

FigureIndex: numeric (optional)

Figure to retrieve.  The value of this parameter is 0 if the file specified in the Filename parameter is a single file.  If the file is a Slide Show (.SHW) file, FigureIndex is required to indicate the WPG index for the figure to retrieve.


Route...

Click the QuickArt icon or choose Insert, QuickArt, click or drag to define a figure area.  To retrieve a figure from the QuickArt Gallery, select a category, select a figure, Retrieve.  To retrieve a figure from another file, choose Other File, specify a file, Retrieve.


RetrieveFigureDlg

Purpose

Displays the Insert Figure dialog box, which is used to import a figure from another file into the current document.  Not recordable.

Syntax

RetrieveFigureDlg ()


RetrieveOutline

Purpose

Inserts a text outline into the Outliner in the current slide show.

Syntax

RetrieveOutline ()


Route...

In the Outliner, choose Insert, File, specify an outline file, Insert.


RetrieveStyleDlg

Purpose

Retrieves a specified chart style and applies it to the current chart.

Syntax

RetrieveStyleDlg ()


Route...

In a data chart, choose Chart, Retrieve Style, specify a filename, Retrieve.


RevealCodes

Purpose

Turns on or turns off the display of text codes at the bottom of the screen in the Text Editor.

Syntax

RevealCodes ()


Route...

In the Text Editor, choose View, Reveal Codes.


RotateObject

Purpose

Rotates selected objects.  Precede with RotateObjects.

Syntax

RotateObject (RotationAngle: numeric; RotationPointX: numeric; RotationPointY: numeric; OffsetX: numeric; OffsetY: numeric; Pretranslate: enum; CopyObject: enum)

Parameters

RotationAngle: numeric

RotationPointX: numeric

Horizontal position of rotation point, in WordPerfect units (1200ths of an inch).

RotationPointY: numeric

Vertical position of rotation point, in WordPerfect units.

OffsetX: numeric

Horizontal offset, in WordPerfect units.

OffsetY: numeric

Vertical offset, in WordPerfect units.

Pretranslate: enum

No!

Yes!

CopyObject: enum

No!

Yes!


Route...

Select objects to rotate, Edit, Rotate, drag a rotation handle.


RotateObjects

Purpose

Places rotation handles around selected objects, which allows you to rotate objects around the center axis.

Syntax

RotateObjects ()

See Also

RotateObject


Route...

Select objects to rotate, Edit, Rotate.


RotateObjectsAroundAnchor

Purpose

Rotates selected objects around the center point.

Syntax

RotateObjectsAroundAnchor (Angle: numeric; Copy: enum)

Parameters

Angle: numeric

Rotation angle in degrees.  Values range from -360 to 360.

Copy: enum

Copy selected objects before rotating.

No!

Yes!


Route...

Select objects to rotate, choose Edit, Rotate, click the right mouse button on a rotation handle, specify options in the Rotate dialog box.


RotateObjectsDlg

Purpose

Displays the Rotate Objects dialog box, which is used to specify a rotation angle.

Syntax

RotateObjectsDlg ()


Route...

Select objects to rotate, choose Edit, Rotate, click the right mouse button on a rotation handle, select the check box in the dialog box title bar.


RulerGridOptionsDlg

Purpose

Displays the Grid/Snap Options dialog box.

Syntax

RulerGridOptionsDlg ()


Route...

View, Grid/Snap, Grid/Snap Options, select the check box in the dialog box title bar.


RunShowExpert

Purpose

Plays the ShowExpert.  Not recordable.

Syntax

RunShowExpert ()


RunShowfile

Purpose

Plays a specified slide show.  Not recordable.

Syntax

RunShowfile (Filename: string)

Parameters

Filename: string

Slide show to play.


SaveChartStyle

Purpose

Names and saves a chart style.

Syntax

SaveChartStyle (Filename: string; Type: enum)

Parameters

Filename: string

Filename of the chart style to save.

Type: enum

Type of chart to which the style applies.

Data!

Text!

Org!

See Also

RetrieveChartStyle


Route...

In the Chart Editor, choose Chart, Save Style, specify a filename, Save.


SaveColorPalette

Purpose

Saves a specified color palette.  Not recordable.

Syntax

SaveColorPalette (Filename: string)

Parameters

Filename: string

Name of a color palette to save.


SaveColorPaletteDlg

Purpose

Displays the Save Color Palette dialog box.  Not recordable.

Syntax

SaveColorPaletteDlg ()


SaveFigureGalleryToWPG

Purpose

Saves all figures in the Figure Gallery in .WPG format.

Syntax

SaveFigureGalleryToWPG (Directory: string)

Parameters

Directory: string

Directory where the .WPG files are saved.


Route...

Insert, QuickArt, click or drag to define a figure area, Save As WPG, All Categories, specify a directory.


SaveShowSlidesToWPG

Purpose

Saves specified QuickArt slides in WordPerfect graphics (.WPG) format.  Not recordable.

Syntax

SaveShowSlidesToWPG (Directory: string; ShowFilename: string)

Parameters

Directory: string

Directory where .WPG files are saved.

ShowFilename: string

File to save.


Route...

Insert, QuickArt, Save As WPG, specify a directory, Current Category or All Categories.


SaveShowSlideToWPG

Purpose

Saves a QuickArt figure in WordPerfect graphics (.WPG) format.

Syntax

SaveShowSlideToWPG (Directory: string; ShowFilename: string; SlideNumber: numeric)

Parameters

Directory: string

.WPG file directory.

ShowFilename: string

File containing the figure to save.

SlideNumber: numeric

Number of the slide to save.


Route...

Insert, QuickArt, Save As WPG, specify a directory, Current Image.


SaveStyleDlg

Purpose

Displays the Save Chart Style dialog box, which is used to save the current chart style.

Syntax

SaveStyleDlg ()


Route...

In a data chart, choose Chart, Save Style, select the check box in the dialog box title bar.


SaveWithEvenBorders

Purpose

Specifies whether a document is saved with even borders.

Syntax

SaveWithEvenBorders (UseAsDefault: enum; UseEvenBorders: enum; BorderSize: numeric)

Parameters

UseAsDefault: enum

Use the specified even border as the default setting.

No!

Yes!

UseEvenBorders: enum

Use even borders when the file is saved.

No!

Yes!

BorderSize: numeric (optional)

Specifies border size as a percentage of the size of the graphic.


Route...

Format, Page, Size/Margins, Size View to Fit Graphic, specify a percentage in the Display Border entry box, select or deselect Use as Default.


ScreenDown

Purpose

Moves the insertion point to the bottom of the screen in a text area.

Syntax

ScreenDown ()


Route...

In the Text Editor, press Page Down.


SelectAllObjects

Purpose

Selects all objects in the current drawing window.

Syntax

SelectAllObjects ()


Route...

Edit, Select, All.


SelectBegOfLine

Purpose

Selects text from the insertion point to the beginning of the line.

Syntax

SelectBegOfLine ()


Route...

In the Text Editor, press Shift+Home.


SelectDocBottom

Purpose

Selects text from the insertion point to the end of the text.

Syntax

SelectDocBottom ()


Route...

In the Text Editor, press Shift+Ctrl+End.


SelectDocTop

Purpose

Selects text from the insertion point to the beginning of the text.

Syntax

SelectDocTop ()


Route...

In the Text Editor, press Shift+Ctrl+Home.


SelectDown

Purpose

Selects text from the insertion point to the corresponding position on the next line.

Syntax

SelectDown ()


Route...

In the Text Editor, press Shift+Down Arrow.


SelectEndOfLine

Purpose

Selects text from the insertion point to the end of the line.

Syntax

SelectEndOfLine ()


Route...

Press Shift+End.


SelectiveReplace

Purpose

Replaces foreground color pixels with background color pixels in the Bitmap Editor.

Syntax

SelectiveReplace ({X: numeric; Y: numeric})

Parameters

X: numeric

Horizontal coordinate of a pixel to replace.  Repeat sets of X and Y parameters to indicate multiple pixels, and enclose repeated parameters in braces {}.

Y: numeric

Vertical coordinate of a pixel to replace.


Route...

In the Bitmap Editor, choose Insert, Selective Replace, drag to replace foreground color.


SelectLeft

Purpose

Selects the character to the left of the insertion point.

Syntax

SelectLeft ()


Route...

In the Text Editor, press Shift+Left Arrow.


SelectLikeObjects

Purpose

Selects all objects of the same type as a currently selected object.

Syntax

SelectLikeObjects ()


Route...

Select an object, Edit, Select, Like.


SelectPrinterDlg

Purpose

Displays the Print Setup dialog box, which is used to select a printer.  Not recordable.

Syntax

SelectPrinterDlg ()


SelectRight

Purpose

Selects the character to the right of the insertion point.

Syntax

SelectRight ()


Route...

In the Text Editor, Press Shift+Right Arrow.


SelectScreenDown

Purpose

Selects the area from the insertion point to the bottom of the current text window.

Syntax

SelectScreenDown ()


Route...

In the Text Editor, press Shift+Ctrl+Page Down.


SelectScreenUp

Purpose

Selects the area from the insertion point to the top of the current text window.

Syntax

SelectScreenUp ()


Route...

In the Text Editor, press Shift+Ctrl+Page Up.


SelectTextChart

Purpose

Selects the title, subtitle, or bullets in a slide which uses the Bullet Chart template.  Not recordable.

Syntax

SelectTextChart (Chart: enum)

Parameters

Chart: enum

Select a title, a subtitle, or bullets.

Bullets!

Subtitle!

Title!


SelectUp

Purpose

Selects text from the insertion point to the corresponding position on the previous line.

Syntax

SelectUp ()


Route...

In the Text Editor, press Shift+Up Arrow.


SelectWordLeft

Purpose

Selects the word to the left of the insertion point.

Syntax

SelectWordLeft ()


Route...

In the Text Editor, press Shift+Ctrl+Left Arrow.


SelectWordRight

Purpose

Selects the word to the right of the insertion point.

Syntax

SelectWordRight ()


Route...

In the Text Editor, press Shift+Ctrl+Right Arrow.


SeparateObject

Purpose

Breaks up combined objects, grouped objects, or contoured text so the parts are treated as separate objects.

Syntax

SeparateObject ()


Route...

Select combined objects or grouped objects or contoured text, choose Graphics, Separate.


SetAirbrushDensity

Purpose

Specifies the number of pixels the Air Brush painting tool covers.  The maximum is 100.

Syntax

SetAirbrushDensity (AirbrushDensity: numeric)

Parameters

AirbrushDensity: numeric

Number of pixels.


Route...

In the Bitmap Editor, choose Format, Brush, specify air brush density.


SetAxisOptions

Purpose

Specifies the scale and values of chart axes.

Syntax

SetAxisOptions (AxisNum: numeric; NumMinInc: numeric; LabelScaleFactor: numeric; Maximum: numeric; Minimum: numeric; MajorInc: numeric; AutoMax: enum; AutoMin: enum; AutoGradMaj: enum; Log: enum; SameScale: enum)

 Parameters

AxisNum: numeric

Axis to modify.  Axes 1, 2 and 3 correspond to the X axis, the Y1 axis, and the Y2 axis.

NumMinInc: numeric (optional)

Number of minor increments between major increments.

LabelScaleFactor: numeric (optional)

Number by which to divide axis labels.

Maximum: numeric (optional)

Maximum value to display for the specified axis.

Minimum: numeric (optional)

Minimum value to display for the specified axis.

MajorInc: numeric (optional)

Distance between major increments.

AutoMax: enum (optional)

Determine maximum axis value automatically.

Off!

On!

AutoMin: enum (optional)

Determine minimum axis value automatically.

Off!

On!

AutoGradMaj: enum (optional)

Determine major grid increment value automatically.

Off!

On!

Log: enum (optional)

Axis is logarithmic rather than linear.

Off!

On!

SameScale: enum (optional)

Radar chart axes use the same scale.

Off!

On!


Route...

In a data chart, choose Chart, Axis, specify options.


SetBackgroundName

Purpose

Names the current background.

Syntax

SetBackgroundName (BackgroundName: string)

Parameters

BackgroundName: string


Route...

Slide, Edit Backgrounds, Backgrounds, Name, type a name.


SetBackgroundNameDlg

Purpose

Displays the Background Name dialog box, which is used to name a background.

Syntax

SetBackgroundNameDlg ()


Route...

Slide, Edit Backgrounds, Backgrounds, Name, select the check box in the dialog box title bar.


SetBarStyle

Purpose

Specifies a style for a bar, line, or area chart.

Syntax

SetBarStyle (Style: enum)

Parameters

Style: enum

Bar style.

Cluster!

Overlap!

Stacked!

Stck100!


Route...

In a bar chart, line chart, or area chart, choose Chart, Layout, select a style.


SetBitmapTransparency

Purpose

Turns transparency on or off for a specified color in the Bitmap Editor.

Syntax

SetBitmapTransparency (TransparencyOn: enum; TransColorRed: numeric; TransColorGreen: numeric; TransColorBlue: numeric)

Parameters

TransparencyOn: enum (optional)

Transparency on for a specified color.

No!

Yes!

TransColorRed: numeric (optional)

Amount of red (0-255) in a color.

TransColorGreen: numeric (optional)

Amount of green (0-255) in a color.

TransColorBlue: numeric (optional)

Amount of blue (0-255) in a color.


Route...

In the Bitmap Editor, choose Format, Color Attributes, Bitmap Transparent Color, select a color, select or deselect Transparent Color On.


SetBorder

Purpose

Specifies border options for chart titles and labels.

Syntax

SetBorder (TitleType: enum; BoxShape: enum; BoxBorder: enum; Red: numeric; Green: numeric; Blue: numeric)

Parameters

TitleType: enum

Box border type for data chart titles or labels.

BoxDataLabels!

BoxLegendTitle!

BoxPieLabels!

BoxSubtitle!

BoxTitle!

OrgChart!

TextChart!

BoxShape: enum (optional)

None!

Octagon!

Rectangle!

RndRect!

BoxBorder: enum (optional)

Border type.

Bevel!

Dash!

Dot!

Double!

None!

Shadow!

Single!

Thick!

Red: numeric (optional)

Amount of red (0-255) in a box border.

Green: numeric (optional)

Amount of green (0-255) in a box border.

Blue: numeric (optional)

Amount of blue (0-255) in a box border.


Route...

In a data chart, select an object which can appear in a box (such as a title), choose Format, Box Attributes, specify options.


SetBrushShape

Purpose

Specifies the shape of the Paint Brush painting tool.

Syntax

SetBrushShape (BrushShape: enum)

Parameters

BrushShape: enum

Specifies the shape of the Paint Brush painting tool.

BackwardSlash!

Circle!

Diamond!

ForwardSlash!

HorizontalLine!

Square!

VerticalLine!


Route...

In the Bitmap Editor, choose Format, Brush, select a brush shape.


SetBrushWidth

Purpose

Specifies the width of the Paint Brush painting tool.

Syntax

SetBrushWidth (BrushWidth: numeric)

Parameters

BrushWidth: numeric

Width in pixels.  Values range from 0 to 100.


Route...

In the Bitmap Editor, choose Format, Brush, specify a brush width.


SetBulletColor

Purpose

Specifies colors for the bullets used in bullet charts.  A different color may by specified for each level.  Precede with BulletChartAttrStart and follow with BulletChartAttrEnd.

 Syntax

SetBulletColor (LevelNum: numeric; Red: numeric; Green: numeric; Blue: numeric)

Purpose

LevelNum: numeric

Bullet chart level.

Red: numeric

Amount of red (0-255) in bullet color.

Green: numeric

Amount of green (0-255) in bullet color.

Blue: numeric

Amount of blue (0-255) in bullet color.


Route...

In a bullet chart, choose Format, Define Bullets/Fonts, Bullets, select a level, specify a bullet color.


SetBulletDefinition

Purpose

Specifies characters to use as bullets for a bullet chart.  Precede with BulletChartAttrStart and follow with BulletChartAttrEnd.

Syntax

SetBulletDefinition (BulletLevel: numeric; Bullet: string)

Parameters

BulletLevel: numeric (optional)

Bullet chart level to modify.

Bullet: string

Up to twenty characters to use as bullets.


Route...

In a bullet chart, choose Format, Define Bullets/Fonts, Bullets, select a level, type up to twenty characters in the Character entry box in the Bullet Options box.


SetBulletLayout

Purpose

Specifies bullet chart justification options.  Precede with BulletChartAttrStart and follow with BulletChartAttrEnd.

Syntax

SetBulletLayout (JustFlag: numeric; JustTypeTitle: enum; JustTypeTwo: enum; JustTypeThree: enum; JustTypeFour: enum, JustTypeFive: enum; JustTypeSix: enum)

Parameters

JustFlag: numeric (optional)

Level to modify.  This parameters only accepts numbers, not text.  Use one of the following numbers:

1	Title

2	Level 2

4	Level 3

8	Level 4

JustTypeTitle: enum (optional)

Specifies justification for the title level.

Center!

Full!

Left!

JustTypeTwo: enum (optional)

Justification for level two.

Center!

Full!

Left!

JustTypeThree: enum (optional)

Justification for level three.

Center!

Full!

Left!

JustTypeFour: enum (optional)

Justification for level four.

Center!

Full!

Left!

JustTypeFive: enum (optional)

Justification for level five.

Center!

Full!

Left!

JustTypeSix: enum (optional)

Justification for level six.

Center!

Full!

Left!


Route...

In a Bullet Chart, choose Format, Define Bullets/Fonts, Bullets, select a level, select an option in the drop-down list below the Justification column.


SetChartAttrsBold

Purpose

Turns Bold on or off for selected chart text.

Syntax

SetChartAttrsBold ()


Route...

Select chart text, click the Bold button on the Power Bar.


SetChartAttrsItalic

Purpose

Turns Italics on or off for selected chart text.

Syntax

SetChartAttrsItalic ()


Route...

Select chart text, click the Italics button on the Power Bar.


SetChartAttrsUnderline

Purpose

Turns Underline on or off for selected chart text.

Syntax

SetChartAttrsUnderline ()


Route...

Select chart text, click the Underline button on the Power Bar.


SetChartFont

Purpose

Specifies a font for chart text.

Syntax

SetChartFont (TitleType: enum; FontName: string; PointSize: numeric; Italic: enum; Underline: enum; Bold: enum)

Parameters

TitleType: enum

Title or label font to define.

DataLabels!

Legend!

LegendTitle!

MiniTable!

PieLabels!

Subtitle!

TableCells!

Title!

XAxis!

XNames!

Y1Axis!

Y1Labels!

Y2Axis!

Y2Labels!

OrgChart!

FontName: string (optional)

Font name and style.

PointSize: numeric (optional)

Italic: enum (optional)

Off!

On!

Underline: enum (optional)

Off!

On!

Bold: enum (optional)

Off!

On!


Route...

In a data chart, select text to modify, choose Format, Font, specify options.


SetChartTitlePos

Purpose

Specifies the position of chart titles and labels.

Syntax

SetChartTitlePos (Title: enum; Subtitle: enum; Y1Axis: enum; Y2Axis: enum; XAxis: enum)

Parameters

Title: enum (optional)

Title position.

Center!

Left!

Right!

Subtitle: enum (optional)

Subtitle position.

Center!

Left!

Right!

Y1Axis: enum (optional)

Position of the Y1 axis label.

Horz!

Vert!

Y2Axis: enum (optional)

Position of Y2 axis label.

Horz!

Vert!

XAxis: enum (optional)

Position of the X axis label.

Horz!

Vert!


Route...

In a data chart, choose Chart, Titles, Options, select Title or Subtitle or an axis, specify an option in the Position pop-up list.


SetColorAttributes

Purpose

Specifies line and fill color attributes for the current drawing.

Syntax

SetColorAttributes (LineForeRed: numeric; LineForeGreen: numeric; LineForeBlue: numeric; LineBackRed: numeric; LineBackGreen: numeric; LineBackBlue: numeric; FillForeRed: numeric; FillForeGreen: numeric; FillForeBlue: numeric; FillBackRed: numeric; FillBackGreen: numeric; FillBackBlue: numeric; TextForeRed: numeric; TextForeGreen: numeric; TextForeBlue: numeric; TextBackRed: numeric; TextBackGreen: numeric; TextBackBlue: numeric; TextPenRed: numeric; TextPenGreen: numeric; TextPenBlue: numeric)

Parameters

LineForeRed: numeric

Amount of red (0-255) in the foreground line color.

LineForeGreen: numeric

Amount of green (0-255) in the foreground line color.

LineForeBlue: numeric

Amount of blue (0-255) in the foreground line color.

LineBackRed: numeric

Amount of red (0-255) in the background line color.

LineBackGreen: numeric

Amount of green (0-255) in the background line color.

LineBackBlue: numeric

Amount of blue (0-255) in the background line color.

FillForeRed: numeric

Amount of red (0-255) in the foreground fill color.

FillForeGreen: numeric

Amount of green (0-255) in the foreground fill color.

FillForeBlue: numeric

Amount of blue (0-255) in the foreground fill color.

FillBackRed: numeric

Amount of red (0-255) in the background fill color.

FillBackGreen: numeric

Amount of green (0-255) in the background fill color.

FillBackBlue: numeric

Amount of blue (0-255) in the background fill color.

TextForeRed: numeric

Amount of red (0-255) in the foreground text color.

TextForeGreen: numeric

Amount of green (0-255) in the foreground text color.

TextForeBlue: numeric

Amount of blue (0-255) in the foreground text color.

TextBackRed: numeric

Amount of red (0-255) in the background text color.

TextBackGreen: numeric

Amount of green (0-255) in the background text color.

TextBackBlue: numeric

Amount of blue (0-255) in the background text color.

TextPenRed: numeric

Amount of red (0-255) in the text outline color.

TextPenGreen: numeric

Amount of green (0-255) in the text outline color.

TextPenBlue: numeric

Amount of blue (0-255) in the text outline color.


Route...

Format, Color Attributes, specify options.


SetConnector

Purpose

Specifies connector options for organization charts.

Syntax

SetConnector (ConnectorStyle: enum; StaffLineStyle: enum; ShowStaffArrow: numeric; ConnRed: numeric; ConnGreen: numeric; ConnBlue: numeric)

Parameters

ConnectorStyle: enum (optional)

Direct!

HorzVert!

Indirect!

StaffLineStyle: enum (optional)

Dashed!

Dotted!

Solid!

ShowStaffArrow: numeric

Show or hide arrows and connectors.  Use one of the following numbers:

0	Default. Hide arrows and show connectors.

1	Show arrows.

2	Hide connectors.

ConnRed: numeric

Amount of red (0-255) in the connector color.

ConnGreen: numeric

Amount of green (0-255) in the connector color.

ConnBlue: numeric

Amount of blue (0-255) in the connector color.


Route...

In an organization chart, choose Chart, Connectors, specify options.


SetExplodeDistance

Purpose

Specifies the distance of a slice of a pie chart from the rest of the pie.

Syntax

SetExplodeDistance (PieNum: numeric; Slice: numeric; Distance: numeric)

 Parameters

PieNum: numeric

Pie number.

Slice: numeric

Slice number.

Distance: numeric

Distance between a slice and the rest of the pie chart.  Values range from 0 to 200.


Route...

In a pie chart, select a pie, choose Chart, Layout, specify a slice and a distance in the Explode Slice group box.


SetFontFace

Purpose

Specifies a font.  To implement specified changes, follow with RealizeFontChanges.

Syntax

SetFontFace (FontName: string; PointSize: numeric; Bold: enum; Italic: enum; Underline: enum; Position: enum; RelSize: enum; FontType: enum)

Parameters

FontName: string

Name of font.

PointSize: numeric

Font point size.

Bold: enum

Off!

On!

Italic: enum

Off!

On!

Underline: enum

Off!

On!

Position: enum

Font position.

Normal!

Subscript!

Superscript!

RelSize: enum

Relative size of a font.

ExtraLarge!

Fine!

Large!

Normal!

Small!

VeryLarge!

FontType: enum (optional)

ATM!

TT!


Route...

Format, Font, select a font face.


SetFontGradient

Purpose

Specifies a gradient fill for a font.  To implement specified changes, follow with RealizeFontChanges.

Syntax

SetFontGradient (GradientType: enum; GradFlag: numeric; GradAngle: numeric; GradRefX: numeric; GradRefY: numeric; GradSteps: numeric; Grad1Red: numeric; Grad1Green: numeric; Grad1Blue: numeric; Grad2Red: numeric; Grad2Green: numeric; Grad2Blue: numeric; GradBRed: numeric; GradBGreen: numeric; GradBBlue: numeric; ForeTransparency: numeric; BackTransparency: numeric)

Parameters

GradientType: enum

ConcenCircles!

ConcenEllispse!

ConcenRects!

ConcenSquares!

ConverCircles!

ConverEllipse!

ConverRects!

ConverSquares!

Linear!

None!

Polygonal!

GradFlag: numeric

Specifies granularity and whether a gradient is anchored to a page.

GradAngle: numeric

Rotation angle for a gradient fill.  The top of the gradient is rotated counter-clockwise.  For example, a 90-degree angle places the top of the gradient parallel to the left margin of the page.

GradRefX: numeric

Horizontal center of a circular or rectangular gradient relative to the page.  Flush left is 0, center is 50, and flush right is 100.

GradRefY: numeric

Vertical center of a circular or rectangular gradient or the top of a linear gradient relative to the page.  Top is 0, center is 50, and bottom is 100.

GradSteps: numeric

Number of steps between colors in a gradient fill.  A value of 0 represents the greatest possible number of steps.

Grad1Red: numeric

Amount of red (0-255) in a solid fill, the top color of a linear gradient, or the center color of a circular or rectangular gradient.

Grad1Green: numeric

Amount of green (0-255) in a solid fill, the top color of a linear gradient, or the center color of a circular or rectangular gradient.

Grad1Blue: numeric

Amount of blue (0-255) in a solid fill, the top color of a linear gradient, or the center color of a circular or rectangular gradient.

Grad2Red: numeric

Amount of red (0-255) in the bottom color of a linear gradient, or the outer color of a circular or rectangular gradient.

Grad2Green: numeric

Amount of green (0-255) in the bottom color of a linear gradient, or the outer color of a circular or rectangular gradient.

Grad2Blue: numeric

Amount of blue (0-255) in the bottom color of a linear gradient, or the outer color of a circular or rectangular gradient.

GradBRed: numeric

Amount of red (0-255) in the background color of a pattern.

GradBGreen: numeric

Amount of green (0-255) in the background color of a pattern.

GradBBlue: numeric

Amount of blue (0-255) in the background color of a pattern.

ForeTransparency: numeric

Foreground color transparency on (1) or off (0).

BackTransparency: numeric

Background color transparency on (1) or off (0).


Route...

Format, Font, Attributes, Gradient, specify options.


SetFontOutline

Purpose

Specifies font outline attributes for data chart text.

Syntax

SetFontOutline (TitleType: enum; Width: numeric; Red: numeric; Green: numeric; Blue: numeric; Outline: enum)

Parameters

TitleType: enum

Data chart title type to modify.

DataLabels!

Legend!

LegendTitle!

MiniTable!

OrgChart!

Subtitle!

TableCells!

Title!

XAxis!

XNames!

Y1Axis!

Y1Labels!

Y2Axis!

Y2Labels!

Width: numeric (optional)

Outline width in inches.

Red: numeric (optional)

Amount of red (0-255) in an outline color.

Green: numeric (optional)

Amount of green (0-255) in an outline color.

Blue: numeric (optional)

Amount of blue (0-255) in an outline color.

Outline: enum

State of font outline.

Off!

On!


Route...

In a data chart, select text to modify, choose Format, Text Attributes, specify color and line width in the Outline group box.


SetFontPattern

Purpose

Specifies a fill pattern for a font.  To implement specified changes, follow with RealizeFontChanges.

Syntax

SetFontPattern (BrushPattern: enum; Grad1Red: numeric; Grad1Green: numeric; Grad1Blue: numeric; Grad2Red: numeric; Grad2Green: numeric; Grad2Blue: numeric; PenBRed: numeric; PenBGreen: numeric; PenBBlue: numeric; PenFRed: numeric; PenFGreen: numeric; PenFBlue: numeric; PenHorzWidth: numeric; PenVertWidth: numeric; eFlags: enum)

Parameters

BrushPattern: enum

Fill pattern.

Arch!

Balls!

BigChecks!

BigCrosshatch!

BigSquares!

Chainlink!

Checks!

Crosses!

Crosshatch!

Fishscale!

Gray12!

Gray25!

Gray50!

Honeycomb!

HorzBricks!

HorzLines1!

HorzLines2!

Mesh!

Patio!

Plaid!

Solid!

Squares!

TiltBricks!

TiltLines1!

TiltLines2!

TiltLines3!

TiltLines4!

Triangles!

VertLines1!

VertLines2!

Waves!

Weave!

Grad1Red: numeric

Amount of red (0-255) in the foreground pattern color.

Grad1Green: numeric

Amount of green (0-255) in the foreground pattern color.

Grad1Blue: numeric

Amount of blue (0-255) in the foreground pattern color.

Grad2Red: numeric

Amount of red (0-255) in the background pattern color.

Grad2Green: numeric

Amount of green (0-255) in the background pattern color.

Grad2Blue: numeric

Amount of blue (0-255) in the background pattern color.

PenBRed: numeric

Amount of red (0-255) in the background outline color.

PenBGreen: numeric

Amount of green (0-255) in the background outline color.

PenBBlue: numeric

Amount of blue (0-255) in the background outline color.

PenFRed: numeric

Amount of red (0-255) in the foreground outline color.

PenFGreen: numeric

Amount of green (0-255) in the foreground outline color.

PenFBlue: numeric

Amount of blue (0-255) in the foreground outline color.

PenHorzWidth: numeric

Horizontal outline width.

PenVertWidth: numeric

Vertical outline width.

eFlags: enum (optional)

State of fill and frame.

Closed!

ClosedFilled!

Filled!

Framed!

FramedClosed!

FramedClosed!

FramedFilled!

None!


Route...

Format, Text Attributes, Pattern, specify options.


SetFrameOptions

Purpose

Specifies chart base and frame options.

Syntax

SetFrameOptions (Height: numeric; Front: enum; Back: enum; Left: enum; Right: enum; Top: enum; Bottom: enum)

Parameters

Height: numeric (optional)

Base height of a chart.  Values range from 0 to 100.

Front: enum (optional)

Display the front chart frame.

Off!

On!

Back: enum (optional)

Display the back chart frame.

Off!

On!

Left: enum (optional)

Display the left chart frame.

Off!

On!

Right: enum (optional)

Display the right chart frame.

Off!

On!

Top: enum (optional)

Display the top chart frame.

Off!

On!

Bottom: enum (optional)

Display the bottom chart frame.

Off!

On!


Route...

In a data chart, choose Chart, Frame, specify options.


SetGradient

Purpose

Defines a gradient fill for chart boxes or titles.

Syntax

SetGradient (TitleType: enum; GradType: enum; Grad1Red: numeric; Grad1Green: numeric; Grad1Blue: numeric; Grad2Red: numeric; Grad2Green: numeric; Grad2Blue: numeric; Steps: numeric; Angle: numeric; RefX: numeric; RefY: numeric; Flag: enum; FillOn: enum)

Parameters

TitleType: enum

Type of chart box or title.

BoxDataLabels!

BoxLegendTitle!

BoxOrgChart!

BoxPieLabels!

BoxSubtitle!

BoxTitle!

FontDataLabels!

FontLegend!

FontLegendTitle!

FontMiniTable!

FontPieLabels!

FontSubtitles!

FontTableCells!

FontTitle!

FontXAxis!!

FontXNames!

FontY1Axis!

FontY1Labels!

FontY2Axis!

FontY2Labels!

Frame!

Series1!

Series2!

Series3!

Series4!

Series5!

Series6!

Series7!

Series8!

Series9!

Series10!

Series11!

Series12!

Series13!

Series14!

Series15!

Series16!

Series17!

Series18!

Series19!

Series20!

Series21!

Series22!

Series23!

Series24!

TextChart!

FontOrgChart!

GradType: enum (optional)

Gradient type.

Circular!

Linear!

Rectangular!

Grad1Red: numeric (optional)

Amount of red (0-255) in the top color of a linear gradient or the center color of a circular or rectangular gradient.

Grad1Green: numeric (optional)

Amount of green (0-255) in the top color of a linear gradient or the center color of a circular or rectangular gradient.

Grad1Blue: numeric (optional)

Amount of blue (0-255) in the top color of a linear gradient or the center color of a circular or rectangular gradient.

Grad2Red: numeric (optional)

Amount of red (0-255) in the bottom color of a linear gradient or the outer color of a circular or rectangular gradient.

Grad2Green: numeric (optional)

Amount of green (0-255) in the bottom color of a linear gradient, or the outer color of a circular or rectangular gradient.

Grad2Blue: numeric (optional)

Amount of blue (0-255) in the bottom color of a linear gradient, or the outer color of a circular or rectangular gradient.

Steps: numeric (optional)

Number of steps between colors in a gradient.  A value of 0 represents the greatest possible number of steps.

Angle: numeric (optional)

Specifies a rotation angle for a gradient.  The top of the gradient is rotated counter-clockwise.  For example, a 90-degree angle places the top of the gradient along the left margin of the page.

RefX: numeric (optional)

Horizontal center of a circular or rectangular gradient relative to the page.  Flush left is 0, center is 50, and flush right is 100.

RefY: numeric (optional)

Specifies the vertical center of a circular or rectangular gradient or the top of a linear gradient relative to the page.  Top is 0, center is 50, and bottom is 100.

Flag: enum (optional)

Blend steps automatically.

AutoBlendOff!

AutoBlendOn!

FillOn: enum (optional)

State of gradient fill.

Off!

On!


Route...

In a data chart, select an object to modify, choose Format, Fill Attributes, Gradient, specify options.


SetGridSnapOptions

Purpose

Sets Grid/Snap options.

Syntax

SetGridSnapOptions (GridDisplay: enum; GridSnap: enum; HorizSpacing: numeric; VertSpacing: numeric; Interval: numeric; SnapZone: numeric)

Parameters

GridDisplay: enum (optional)

No!

Yes!

GridSnap: enum (optional)

Snap to grid.

No!

Yes!

HorizSpacing: numeric (optional)

Horizontal grid spacing, in WordPerfect units (1200ths of an inch).

VertSpacing: numeric (optional)

Vertical grid spacing, in WordPerfect units.

Interval: numeric (optional)

Point display interval.

SnapZone: numeric (optional)

Alignment guide snap zone, in WordPerfect units.


Route...

View, Grid/Snap, Grid/Snap Options, specify options.


SetGridTickOptions

Purpose

Specifies grid and tick options for a data chart.

Syntax

SetGridTickOptions (Axis: enum; MajRed: numeric; MajGreen: numeric; MajBlue: numeric; MinRed: numeric; MinGreen: numeric; MinBlue: numeric; MajGrid: enum; MinGrid: enum; MajTick: enum; MinTick: enum; SeparateGrid: enum)

Parameters

Axis: enum

Axis to modify.

X!

Y1!

Y2!

MajRed: numeric (optional)

Amount of red (0-255) in the major grid color.

MajGreen: numeric (optional)

Amount of green (0-255) in the major grid color.

MajBlue: numeric (optional)

Amount of blue (0-255) in the major grid color.

MinRed: numeric (optional)

Amount of red (0-255) in the minor grid color.

MinGreen: numeric (optional)

Amount of green (0-255) in the minor grid color.

MinBlue: numeric (optional)

Amount of blue (0-255) in the minor grid color.

MajGrid: enum (optional)

Appearance of the major grid.

Dashed!

Dotted!

None!

Solid!

MinGrid: enum (optional)

Appearance of the minor grid.

Dashed!

Dotted!

None!

Solid!

MajTick: enum (optional)

Appearance of the major ticks.

Both!

In!

None!

Out!

MinTick: enum (optional)

Appearance of the minor ticks.

Both!

In!

None!

Out!

SeparateGrid: enum (optional)

Use if a separate grid scale is used for each axis.

Off!

On!


Route...

In a data chart, choose Chart, Grid/Tick, specify options.


SetHLOStyle

Purpose

Specifies the style of a high/low chart.

Syntax

SetHLOStyle (Style: enum)

Parameters

Style: enum

High/low chart style.

Area!

Bar!

Error!

Line!


Route...

In a high/low chart, choose Chart, Layout, select a type.


SetLabelOptions

Purpose

Specifies options for chart labels.

Syntax

SetLabelOptions (LabelType: enum; Hide: enum; Position: enum; Stagger: enum; DispTicks: enum; Interval: numeric; FirstAxis: enum)

Parameters

LabelType: enum

DataLabels!

TableCells!

XNames!

Y1Labels!

Y2Labels!

Hide: enum (optional)

Hide labels.

Off!

On!

Position: enum (optional)

Position of data labels.

Above!

Below!

Stagger: enum (optional)

Stagger X labels.

Off!

On!

DispTicks: enum (optional)

Display label ticks.

Off!

On!

Interval: numeric (optional)

Interval between X labels.

FirstAxis: enum (optional)

Display Y-axis labels on the first axis or on all axes on a radar chart.  The Hide parameter overrides this parameter.

AllAxes!

FirstAxis!


Route...

In a data chart, choose Chart, Labels, specify options.


SetLayoutSizes

Purpose

Specifies layout sizes for charts.

Syntax

SetLayoutSizes (Width: numeric; Depth: numeric; Height: numeric; Overlap: numeric)

Parameters

Width: numeric (optional)

Bar width.  Value (0-100).

Depth: numeric (optional)

Bar depth.  Value (0-100).

Height: numeric (optional)

Line height.  Value (0-100).

Overlap: numeric (optional)

Overlap size.  Value (0-100).


Route...

In a data chart, choose Chart, Layout, specify sizes.


SetLayoutTitle

Purpose

Specifies a title for the current layout.

Syntax

SetLayoutTitle (Title: string)

Parameters

Title: string


Route...

Slide, Edit Layouts, Layouts, Name, click arrow buttons to specify a layout, type a name.


SetLegendOptions

Purpose

Specifies legend options for a data chart.

Syntax

SetLegendOptions (Display: enum; Vertical: enum; Inside: enum; Position: enum)

Parameters

Display: enum (optional)

Display a legend.

Off!

On!

Vertical: enum (optional)

Vertical legend display.

Off!

On!

Inside: enum (optional)

Display a legend inside a chart.

Off!

On!

Position: enum (optional)

Legend position.

BottomCenter!

BottomLeft!

BottomRight!

MiddleLeft!

MiddleRight!

TopCenter!

TopLeft!

TopRight!


Route...

In a data chart, choose Chart, Legend, specify options.


SetLevelFont

Purpose

Specifies a font for a bullet chart level.

Syntax

SetLevelFont (ChartLevel: numeric; FontName: string; PointSize: numeric; Bold: enum; Italic: enum; Underline: enum)

Parameters

ChartLevel: numeric

Bullet chart level to modify.

FontName: string (optional)

PointSize: numeric (optional)

Bold: enum (optional)

Off!

On!

Italic: enum (optional)

Off!

On!

Underline: enum (optional)

Off!

On!

eFlags: enum (optional)

State of fill and frame.

Closed!

ClosedFilled!

Filled!

Framed!

FramedClosed!

FramedClosed!

FramedFilled!

None!


Route...

In a bullet chart, choose Format, Define Bullets/Fonts, Font, specify options.


SetLevelGradient

Purpose

Specifies a gradient text fill for a bullet chart level.

Syntax

SetLevelGradient (ChartLevel: numeric; GradientType: enum; GradFlag: numeric; GradAngle: numeric; GradRefX: numeric; GradRefY: numeric; GradSteps: numeric; Grad1Red: numeric; Grad1Green: numeric; Grad1Blue: numeric; Grad2Red: numeric; Grad2Green: numeric; Grad2Blue: numeric; GradBRed: numeric; GradBGreen: numeric; GradBBlue: numeric; ForeTransparency: numeric; BackTransparency: numeric)

Parameters

ChartLevel: numeric

Bullet chart level.

GradientType: enum

ConcenCircles!

ConcenEllipses!

ConcenRects!

ConcenSquares!

ConverCircles!

ConverEllipses!

ConverRects!

ConverSquares!

Linear!

None!

Polygonal!

GradFlag: numeric

Specifies granularity and anchor to page.

GradAngle: numeric

Rotation angle for a gradient fill.  The top of the gradient is rotated counter-clockwise.  For example, a 90-degree angle places the top of the gradient parallel to the left margin of the page.

GradRefX: numeric

Horizontal center of a circular or rectangular gradient relative to the page.  Flush left is 0, center is 50, and flush right is 100.

GradRefY: numeric

Vertical center of a circular or rectangular gradient or the top of a linear gradient relative to the page.  Top is 0, center is 50, and bottom is 100.

GradSteps: numeric

Number of steps between colors in a gradient fill.  A value of 0 represents the greatest possible number of steps.

Grad1Red: numeric

Amount of red (0-255) in the top color of a linear gradient or the center color of a circular or rectangular gradient.

Grad1Green: numeric

Amount of green (0-255) in the top color of a linear gradient or the center color of a circular or rectangular gradient.

Grad1Blue: numeric

Amount of blue (0-255) in the top color of a linear gradient, or the center color of a circular or rectangular gradient.

Grad2Red: numeric

Amount of red (0-255) in the bottom color of a linear gradient or the outer color of a circular or rectangular gradient.

Grad2Green: numeric

Amount of green (0-255) in the bottom color of a linear gradient or the outer color of a circular or rectangular gradient.

Grad2Blue: numeric

Amount of blue (0-255) in the bottom color of a linear gradient or the outer color of a circular or rectangular gradient.

GradBRed: numeric

Amount of red (0-255) in the background gradient color.

GradBGreen: numeric

Amount of green (0-255) in the background gradient color.

GradBBlue: numeric

Amount of blue (0-255) in the background gradient color.

ForeTransparency: numeric

Foreground color transparency, with 0 specifying opaque and 255 specifying transparent.

BackTransparency: numeric

Background color transparency, with 0 specifying opaque and 255 specifying transparent.


Route...

In a bullet chart, choose Format, Define Bullets/Fonts, Font, select a level to modify, Font Color, Gradient, specify options.


SetLevelPattern

Purpose

Specifies a text fill pattern for a bullet chart level.

Syntax

SetLevelPattern (ChartLevel: numeric; BrushPattern: enum; Grad1Red: numeric; Grad1Green: numeric; Grad1Blue: numeric; Grad2Red: numeric; Grad2Green: numeric; Grad2Blue: numeric; PenBRed: numeric; PenBGreen: numeric; PenBBlue: numeric; PenFRed: numeric; PenFGreen: numeric; PenFBlue: numeric; PenHorzWidth: numeric; PenVertWidth: numeric; eFlags: enum)

Parameters

ChartLevel: numeric

Bullet chart level to modify.

BrushPattern: enum

Fill pattern.

Arch!

Balls!

BigChecks!

BigCrosshatch!

BigSquares!

Chainlink!

Checks!

Crosses!

Crosshatch!

Fishscale!

Gray12!

Gray25!

Gray50!

Honeycomb!

HorzBricks!

HorzLines1!

HorzLines2!

Mesh!

Patio!

Plaid!

Solid!

Squares!

TiltBricks!

TiltLines1!

TiltLines2!

TiltLines3!

TiltLines4!

Triangles!

VertLines1!

VertLines2!

Waves!

Weave!

Grad1Red: numeric

Amount of red (0-255) in a solid fill, the top color of a linear gradient, or the center color of a circular or rectangular gradient.

Grad1Green: numeric

Amount of green (0-255) in a solid fill, the top color of a linear gradient, or the center color of a circular or rectangular gradient.

Grad1Blue: numeric

Amount of blue (0-255) in a solid fill, the top color of a linear gradient, or the center color of a circular or rectangular gradient.

Grad2Red: numeric

Amount of red (0-255) in the bottom color of a linear gradient, or the outer color of a circular or rectangular gradient.

Grad2Green: numeric

Amount of green (0-255) in the bottom color of a linear gradient, or the outer color of a circular or rectangular gradient.

Grad2Blue: numeric

Amount of blue (0-255) in the bottom color of a linear gradient, or the outer color of a circular or rectangular gradient.

PenBRed: numeric

Amount of red (0-255) in the pen background color.

PenBGreen: numeric

Amount of green (0-255) in the pen background color.

PenBBlue: numeric

Amount of blue (0-255) in the pen background color.

PenFRed: numeric

Amount of red (0-255) in the foreground pen color.

PenFGreen: numeric

Amount of green (0-255) in the pen foreground color.

PenFBlue: numeric

Amount of blue (0-255) in the pen foreground color.

PenHorzWidth: numeric

Horizontal outline width.

PenVertWidth: numeric

Vertical outline width.

eFlags: enum (optional)

State of fill and frame.

Closed!

ClosedFilled!

Filled!

Framed!

FramedClosed!

FramedClosed!

FramedFilled!

None!


Route...

In a bullet chart, choose Format, Define Bullets/Fonts, Font, select a level to modify, Font Color, Pattern, specify options.


SetLineAttributes

Purpose

Specifies line attributes in charts.

Syntax

SetLineAttributes (AttrType: enum; LineOn: enum; Width: numeric; LineJoin: enum; LineEnd1: enum; LineEnd2: enum; PenPattern: enum; PenStyle: enum; ForeRed: numeric; ForeGreen: numeric; ForeBlue: numeric; BackRed: numeric; BackGreen: numeric; BackBlue: numeric)

Parameters

AttrType: enum

Line type to modify.

Frame!

Series1!

Series2!

Series3!

Series4!

Series5!

Series6!

Series7!

Series8!

Series9!

Series10!

Series11!

Series12!

Series13!

Series14!

Series15!

Series16!

Series17!

Series18!

Series19!

Series20!

Series21!

Series22!

Series23!

Series24!

LineOn: enum (optional)

Chart frame display.

Off!

On!

Width: numeric (optional)

Line width, in inches.

LineJoin: enum (optional)

Line joints.

Bevel!

Miter!

None!

Round!

LineEnd1: enum (optional)

End type for the beginning of a line.

Arrow!

Flat!

Round!

Square!

LineEnd2: enum (optional)

End type for the end of a line.

Arrow!

Flat!

Round!

Square!

PenPattern: enum (optional)

Pen pattern used when drawing lines.

Arch!

Balls!

BigChecks!

BigCrosshatch!

BigSquares!

Chainlink!

Checks!

Crosses!

Crosshatch!

Fishscale!

Gray12!

Gray25!

Gray50!

Honeycomb!

HorzBricks!

HorzLines1!

HorzLines2!

Mesh!

Patio!

Plaid!

Solid!

Squares!

TiltBricks!

TiltLines1!

TiltLines2!

TiltLines3!

TiltLines4!

Triangles!

VertLines1!

VertLines2!

Waves!

Weave!

PenStyle: enum (optional)

Pen style used when drawing lines.

Alternate!

Dash!

DashDot!

DashTwoDot!

Dots!

LongDash!

LongShort!

LongTwoShort!

ShortDash!

Solid!

TinyDash!

TwoDashDot!

TwoDashTwoDot!

TwoDotsDash!

TwoLongShort!

TwoLongTwoShort!

ForeRed: numeric (optional)

Amount of red (0-255) in the line foreground color.

ForeGreen: numeric (optional)

Amount of green (0-255) in the line foreground color.

ForeBlue: numeric (optional)

Amount of blue (0-255) in the line foreground color.

BackRed: numeric (optional)

Amount of red (0-255) in the line background color.

BackGreen: numeric (optional)

Amount of green (0-255) in the line background color.

BackBlue: numeric (optional)

Amount of blue (0-255) in the line background color.


Route...

In a data chart, select a line to modify, choose Format, Line Attributes, specify options.


SetLineSpacing

Purpose

Sets spacing between lines of text.

Syntax

SetLineSpacing (Spacing: numeric)

Parameters

Spacing: numeric

Spacing between lines of text.


Route...

In the Text Editor, choose Format, Line, Spacing, specify spacing.


SetOrgChartBox

Purpose

Specifies box options for organization charts.

Syntax

SetOrgChartBox (WidthSize: enum; HeightSize: enum; TextJust: enum; BoxDisplay: enum)

Parameters

WidthSize: enum (optional)

Box width.

FitToText!

Large2Small!

SameSize!

HeightSize: enum (optional)

Box height.

FitToText!

Large2Small!

SameSize!

TextJust: enum (optional)

Text justification within boxes.

Center!

Left!

Right!

BoxDisplay: numeric (optional)

Boxes to display.

AllBox!

NoBox!

TMBox!

TopBox!


Route...

In an organization chart, choose Chart, Box Options, specify options.


SetOrgChartLayout

Purpose

Specifies layout options for organization charts.

Syntax

SetOrgChartLayout (FirstPlacement: enum; MiddlePlacement: enum; LastPlacement: enum; NumberOfLevels: numeric; Orientation: enum)

Parameters

FirstPlacement: enum (optional)

Placement of first-level items.

DoubleColumn!

DoubleRow!

LeftColumn!

RightColumn!

SingleRow!

MiddlePlacement: enum (optional)

Placement of middle items.

DoubleColumn!

DoubleRow!

LeftColumn!

RightColumn!

SingleRow!

LastPlacement: enum (optional)

Placement of last-level items.

DoubleColumn!

DoubleRow!

LeftColumn!

RightColumn!

SingleRow!

NumberOfLevels: numeric (optional)

Number of levels to display.

Orientation: enum (optional)

Orientation of the organization chart.

Bottom2Top!

Left2Right!

Right2Left!

Top2Bottom!


Route...

In an organization chart, choose Chart, Layout, specify options.


SetOrgChartTop

Purpose

Moves the organization chart entry containing the insertion point to the top of the chart.

Syntax

SetOrgChartTop ()


Route...

In an organization chart, place the insertion point in an organization chart entry in the Outliner, choose Chart, Set Top.


SetPageNumbering

Purpose

Sets the page number to a specified position.  Not recordable.

Syntax

SetPageNumbering ()


SetPaintMarquee

Purpose

Selects a portion of a bitmap area.  If no parameters are specified, the whole bitmap area is selected.

Syntax

SetPaintMarquee (X1: numeric; Y1: numeric; X2: numeric; Y2: numeric)

Parameters

X1: numeric (optional)

Horizontal coordinate of the pixel in the upper left corner of the selected area.  Coordinates are numbered from the upper left pixel of the bitmap area, pixel 0,0.

Y1: numeric (optional)

Lower left vertical coordinate of the selected area.

X2: numeric (optional)

Upper right horizontal coordinate of the selected area.

Y2: numeric (optional)

Upper right vertical coordinate of the selected area.


Route...

In the Bitmap Editor, choose Edit, Select Area, drag to select a bitmap area.


SetPaletteColor

Purpose

Creates a color on a color palette.

Syntax

SetPaletteColor (Index: numeric; Red: numeric; Green: numeric; Blue: numeric)

 Parameters

Index: numeric

Index number of the color on the palette.

Red: numeric

Red value (0-255).

Green: numeric

Green value (0-255).

Blue: numeric

Blue value (0-255).


Route...

Format, Color Attributes, Define, specify a color.


SetPattern

Purpose

Specifies fill colors and patterns for parts of a chart.

Syntax

SetPattern (TitleType: enum; BrushPattern: enum; ForeRed: numeric; ForeGreen: numeric; ForeBlue: numeric; BackRed: numeric; BackGreen: numeric; BackBlue: numeric; Transparency: enum; FillOn: enum)

Parameters

TitleType: enum

BoxDataLabels!

BoxLegendTitle!

BoxOrgChart!

BoxPieLabels!

BoxSubtitle!

BoxTitle!

FontDataLabels!

FontLegend!

FontLegendTitle!

FontMiniLabels!

FontOrgChart!

FontPieLabels!

FontSubtitles!

FontTableCells!

FontTitle!

FontXAxis!!

FontXNames!

FontY1Axis!

FontY1Labels!

FontY2Axis!

FontY2Labels!

Frame!

Series1!

Series2!

Series3!

Series4!

Series5!

Series6!

Series7!

Series8!

Series9!

Series10!

Series11!

Series12!

Series13!

Series14!

Series15!

Series16!

Series17!

Series18!

Series19!

Series20!

Series21!

Series22!

Series23!

Series24!

TextChart!

BrushPattern: enum (optional)

Fill pattern.

Arch!

Balls!

BigChecks!

BigCrosshatch!

BigSquares!

Chainlink!

Checks!

Crosses!

Crosshatch!

Fishscale!

Gray12!

Gray25!

Gray50!

Honeycomb!

HorzBricks!

HorzLines1!

HorzLines2!

Mesh!

Patio!

Plaid!

Solid!

Squares!

TiltBricks!

TiltLines1!

TiltLines2!

TiltLines3!

TiltLines4!

Triangles!

VertLines1!

VertLines2!

Waves!

Weave!

ForeRed: numeric (optional)

Amount of red (0-255) in the foreground fill color.

ForeGreen: numeric (optional)

Amount of green (0-255) in the foreground fill color.

ForeBlue: numeric (optional)

Amount of blue (0-255) in the foreground fill color.

BackRed: numeric (optional)

Amount of red (0-255) in the background fill color.

BackGreen: numeric (optional)

Amount of green (0-255) in the background fill color.

BackBlue: numeric (optional)

Amount of blue (0-255) in the background fill color.

Transparency: enum (optional)

Transparency of a foreground or background color.

Background!

Foreground!

None!

FillOn: enum (optional)

Fill state.

Off!

On!


Route...

In a data chart, select a chart object to modify, Format, Fill Attributes, Pattern, specify options.


SetPerspectiveOptions

Purpose

Specifies perspective options for chart display.

Syntax

SetPerspectiveOptions (RightAngle: enum; Horizontal: numeric; Vertical: numeric)

Parameters

RightAngle: enum (optional)

Constrain chart axes to right angles.

Off!

On!

Horizontal: numeric (optional)

Angle from which the X axis is viewed.  Values range from 0 to 100 for right angle axes, and from 0 to 90 for other axes.

Vertical: numeric (optional)

Angle from which the Y axis is viewed.  Values range from 0 to 100 for right angle axes, and from 0 to 90 for other axes.


Route...

In a data chart, choose Chart, Perspective, specify options.


SetPieLabelOptions

Purpose

Specifies label options for pie charts.

Syntax

SetPieLabelOptions (Value: enum; Percentage: enum; Label: enum; Pointer: enum; Stacked: enum; Digits: numeric)

Parameters

Value: enum (optional)

Value label display in relation to the chart.

In!

None!

Out!

Percentage: enum (optional)

Percentage label display in relation to the chart.

In!

None!

Out!

Label: enum (optional)

Data label display in relation to the chart.

In!

None!

Out!

Pointer: enum (optional)

Pointer length.

Long!

Medium!

None!

Short!

Stacked: enum (optional)

Stack labels.

Off!

On!

Digits: numeric (optional)

Number of digits when values are displayed as percentages.


Route...

In a pie chart, choose Chart, Labels, specify options.


SetPieStyle

Purpose

Specifies pie chart layout options.

Syntax

SetPieStyle (PieNum: numeric; Angle: numeric; Tilt: numeric; Depth: numeric; Size: numeric; LinkSlice: numeric; Column: enum; Linked: enum; Sort: enum; Prop: enum)

Parameters

PieNum: numeric

Pie number.

Angle: numeric (optional)

Rotation angle of a pie.  Values range from 0 to 359.

Tilt: numeric (optional)

Tilt angle of a pie.

Depth: numeric (optional)

Depth of a 3-D pie.  Values range from 0 to 100.

Size: numeric (optional)

Size of a pie.  Values range from 0 to 100.

LinkSlice: numeric (optional)

In a two-pie chart, specifies a slice of one pie to link to the entire second pie.

Column: enum (optional)

Display a pie as a stacked bar.

Off!

On!

Linked: enum (optional)

Link a pie.

Off!

On!

Sort: enum (optional)

Arrange pie slices by size.

Off!

On!

Prop: enum

Show multiple pies in proportion to each other.

Off!

On!


Route...

In a pie chart, choose Chart, Layout, specify options.


SetProportionalPies

Purpose

Turns the proportional pies option on or off when editing a pie chart.

Syntax

SetProportionalPies (Flag: enum)

Parameters

Flag: enum

Off!

On!


Route...

In a pie chart with multiple pies, choose Chart, Layout, Proportional Pies.


SetRadarView

Purpose

Specifies layout options for radar charts.

Syntax

SetRadarView (RadialGrid: enum; RadarLine: enum)

Parameters

RadialGrid: enum (optional)

Radar grid is radial, rather than linear.

Off!

On!

RadarLine: enum (optional)

Radar chart is displayed as lines, rather than areas.

Off!

On!


Route...

In a radar chart, choose Chart, Layout, specify options.


SetSeriesOptions

Purpose

Specifies options for a chart series.

Syntax

SetSeriesOptions (SeriesNum: numeric; ItemType: enum; BarStyle: enum; MarkerType: enum; MarkerSize: numeric; LineWidth: numeric; LineStyle: enum; LineRed: numeric; LineGreen: numeric; LineBlue: numeric; AxisType: enum; Radar: enum; ScatterLine: enum; ScatterMarker: enum; LinLines: enum; LinMarkers: enum)

Parameters

SeriesNum: numeric

Series to modify.  Values range from 1 to 24.

ItemType: enum (optional)

Series type.  Valid only for bar, area, line, or mixed charts.

Area!

Bar!

Line!

BarStyle: enum (optional)

Shape of a bar series.

Conical!

Cylinder!

Diamond!

Hexagon!

Octagon!

Pentagon!

Pyramid!

Pyramid3!

Rectangle!

MarkerType: enum (optional)

Shape of a Marker.  Used when the ScatterMarker or LinMarker parameter value

Asterisk!

Box!

Circle!

Cross!

Diamond!

On!.

Star5!

Star6!

Sun!

Triangle!

Wedge!

X!

MarkerSize: numeric (optional)

Used when the ScatterMarker, LinMarker, or Radar parameter value On!.  Values range from 1 to 10.

LineWidth: numeric (optional)

Line width in the current unit of measure.

LineStyle: enum (optional)

Alternate!

Dash!

DashDot!

DashTwoDot!

Dots!

LongDash!

LongShort!

LongTwoShort!

ShortDash!

Solid!

TinyDash!

TwoDashDot!

TwoDashTwoDot!

TwoDotsDash!

TwoLongShort!

TwoLongTwoShort!

LineRed: numeric (optional)

Amount of red (0-255) in a line color.

LineGreen: numeric (optional)

Amount of green (0-255) in a line color.

LineBlue: numeric (optional)

Amount of blue (0-255) in a line color.

AxisType: enum (optional)

Specifies which axis a series is on.  Valid only for charts with a Y1 axis (left) and a Y2 axis (right).

Left!

Right!

Radar: enum (optional)

Display radar markers.

Off!

On!

ScatterLine: enum (optional)

Display a series as a line.  Valid only for scatter charts.

Off!

On!

ScatterMarker: enum (optional)

Display a series as markers.

Off!

On!

LinLines: enum (optional)

Display a series as a line.  Valid only for line, bar, area, or mixed charts.

Off!

On!

LinMarkers: enum (optional)

Display a series as markers.  Valid only for line, bar, area, or mixed charts.

Off!

On!


Route...

In a data chart, choose Chart, Series, specify options.


SetSlideCDAudio

Purpose

Specifies options for CD sound.

Syntax

SetSlideCDAudio (CDName: string; TrackBegin: numeric; MinuteBegin: numeric; SecondBegin: numeric; FrameBegin: numeric; TrackEnd: numeric; MinuteEnd: numeric; SecondEnd: numeric; FrameEnd: numeric)

Parameters

CDName: string

Descriptive name for a CD sound clip.

TrackBegin: numeric

Track in which to begin the sound clip.

MinuteBegin: numeric

Minute in which to begin the sound clip.

SecondBegin: numeric

Second in which to begin the sound clip.

FrameBegin: numeric

Frame in which to begin a sound clip.

TrackEnd: numeric

Track in which to end the sound clip.

MinuteEnd: numeric

Minute in which to end the sound clip.

SecondEnd: numeric

Second in which to end the sound clip.

FrameEnd: numeric

Frame in which to end a sound clip.


Route...

Slide, Sound, CD, specify options.


SetSlideLinkFile

Purpose

Links a slide show file to a gallery or .MST file.

Syntax

SetSlideLinkFile (GalleryName: string; SlideNumber: numeric; Filename: string)

Parameters

GalleryName: string

Gallery or .MST to edit.

SlideNumber: numeric

Number of slide to link.

Filename: string

Slide show file to link.


Route...

In the QuickArt gallery or Master Gallery, choose Link, specify a gallery category, specify a filename.


SetSlideLinks

Purpose

Creates Go To key links for the current slide.

Syntax

SetSlideLinks (AnyKeySlide: numeric; {Key: string; Slide: numeric})

Parameters

AnyKeySlide: numeric (optional)

Number of the slide linked to unassigned keys.

Key: string

Key linked to the slide specified in the Slide parameter.  Use multiple pairs of Key and Slide parameters to create multiple links, and enclose repeated parameters in braces {}.

Slide: numeric

Slide linked to the key specified in the Key parameter.


Route...

Slide, Go To Keys, specify options.


SetSlideNotes

Purpose

Creates speaker notes for the current slide.

Syntax

SetSlideNotes (Notes: string)

Parameters

Notes: string

Speaker notes for the current slide.


Route...

Slide, Speaker Notes, specify a slide, type notes.


SetSlideOptions

Purpose

Specifies transition options for the current slide.  Use SlideGetNext or SlideGetLast to specify a slide other than the current slide.

Syntax

SetSlideOptions (TransitionType: enum; Direction: enum; Size: enum; Overlay: enum; CascadeBullets: enum; TransitionBullets: enum; ManualDelay: enum; DelayTime: numeric; SkipCurrent: enum)

Parameters

TransitionType: enum

Type of transition between slides.

Blinds!

Box!

Close!

Diagonal!

Jigsaw!

Normal!

Open!

Overwrite!

Snake!

Spot!

Wipe!

Direction: enum

Direction for the transition action.

Down!

Horizontal!

In!

Left!

LeftDown!

LeftUp!

None!

Out!

Right!

RightDown!

RightUp!

Up!

Vertical!

Size: enum

Pattern size for the Spots or Jigsaw transitions.  For other transition types, the value of this parameter is 255.

Fine!

Large!

Medium!

None!

Small!

Xlarge!

Overlay: enum

Overlay option is active.

No!

Yes!

CascadeBullets: enum

Cascade Bullets options is active.

No!

Yes!

TransitionBullets: enum

Transition Bullets Only option is active.

No!

Yes!

ManualDelay: enum

Advance slides manually.

No!

Yes!

DelayTime: numeric

Number of seconds before the next slide appears when the timed advance option is active.

SkipCurrent: enum

Skip the current slide when the show plays.

No!

Yes!


Route...

Slide, Transition, specify options.


SetSlideOverride

Purpose

Specifies slide show override options.

Syntax

SetSlideOverride (OverrideTransition: enum; TransitionType: enum; Direction: enum; Size: enum; CascadeBullets: enum; TransitionBullets: enum; OverrideAdvance: enum; ManualDelay: enum; DelayTime: numeric)

Parameters

OverrideTransition: enum

Override slide transitions.

No!

Yes!

TransitionType: enum

Transition type.

Blinds!

Box!

Close!

Diagonal!

Jigsaw!

Normal!

Open!

Overwrite!

Snake!

Spot!

Wipe!

Direction: enum

Transition direction.

Down!

Horizontal!

In!

Left!

LeftDown!

LeftUp!

None!

Out!

Right!

RightDown!

Up!

Up!

Vertical!

Size: enum

Pattern size for the Spots or Jigsaw transitions.

Fine!

Large!

Medium!

None!

Small!

Xlarge!

CascadeBullets: enum

Cascade bullets options is active.

No!

Yes!

TransitionBullets: enum

Transition bullets option is active.

No!

Yes!

OverrideAdvance: enum

Override advance options.

No!

Yes!

ManualDelay: enum

Advance slides manually.

No!

Yes!

DelayTime: numeric

Number of seconds before the next slide appears when the timed advance option is active.


Route...

Slide, Override, specify options.


SetTemplateAll

Purpose

Specifies a template for all slides in a slide show.

Syntax

SetTemplateAll (Template: string; Background: string)

Parameters

Template: string

Template name.

Background: string (optional)

Background name.  Overrides the default background.


Route...

Slide, Apply Template, choose a template, All Slides.


SetTemplateCurrent

Purpose

Specifies a template for the current slide.

Syntax

SetTemplateCurrent (Template: string; Background: string)

Parameters

Template: string

Template name.

Background: string (optional)

Background name.  Overrides the default background.


Route...

Slide, Apply Template, choose a template, Current Slide.


SetTemplateRange

Purpose

Specifies a template for a range of slides.

Syntax

SetTemplateRange (Start: numeric; End: numeric; Template: string; Background: string)

Parameters

Start: numeric

First slide in a range.

End: numeric

Last slide in a range.

Template: string

Template name.

Background: string (optional)

Background name.  Overrides the default background.


Route...

Slide, Apply Template, select a template, Slide Range, specify  starting and ending slide numbers.


SetSoundControl

Purpose

Specifies sound options for the current slide.

Syntax

SetSoundOptions (MIDIVolume: numeric; MIDIFilename: string; DigiVolume: numeric; DigiFilename: string; CDVolume: numeric; CDFilename: string; WAMIFilename: string)

Parameters

MIDIVolume: numeric

Volume for a MIDI file.

MIDIFilename: string

MIDI filename.

DigiVolume: numeric

Volume for a digital audio file.

DigiFilename: string

Digital audio filename.

CDVolume: numeric

Volume for a CD sound clip.

CDFilename: string

CD sound clip filename.

WAMIFilename: string

Wave/Midi filename.


Route...

Slide, Sound, specify options.


SetSoundOptions

Purpose

Specifies play options for sound clips.

Syntax

SetSoundControl (MIDILoop: enum; MIDIOnDisk: enum; MIDIMT32: enum; DigiLoop: enum; DigiOnDisk: enum; CDLoop: enum; WAMILoop: enum)

Parameters

MIDILoop: enum

Play the current MIDI file continuously during a slide show until another file begins.

No!

Yes!

MIDIOnDisk: enum

Store the current MIDI file on disk, rather than in the slide show file.

No!

Yes!

MIDIMT32: enum

Ensure consistency among MIDI files written according to the MT32 standard.

No!

Yes!

DigiLoop: enum

Play the current digital audio file continuously during a slide show until another file begins.

No!

Yes!

DigiOnDisk: enum

Store the current digital audio file on disk, rather than in the slide show file.

No!

Yes!

CDLoop: enum

Play the current CD sound clip continuously during a slide show until another file begins.

No!

Yes!

WAMILoop: enum

Play the current Wave/MIDI sound clip continuously during a slide show until another file begins.

No!

Yes!


Route...

Slide, Sound, Options, specify options.


SetTableBlend

Purpose

Blends range colors in the current table.

Syntax

SetTableBlend ()


Route...

In a table, choose Chart, Layout, Blend.


SetTableSurfaceColor

Purpose

Specifies table and surface colors.

Syntax

SetTableSurfaceColor (ColorType: enum; Red: numeric; Green: numeric; Blue: numeric)

Parameters

ColorType: enum

Table or surface color to change.

ColorTable1!

ColorTable10!

ColorTable2!

ColorTable3!

ColorTable4!

ColorTable5!

ColorTable6!

ColorTable7!

ColorTable8!

ColorTable9!

GridFillColor!

GridLineColor!

SurfaceOutlineColor!

Red: numeric

Amount of red (0-255) in a color.

Green: numeric

Amount of green (0-255) in a color.

Blue: numeric

Amount of blue (0-255) in a color.


Route...

In a table or surface chart, choose Chart, Layout, specify a fill color.


SetTableSurfaceOptions

Purpose

Specifies table layout options.

Syntax

SetTableSurfaceOptions (SingleGrid: enum; FullGrid: enum; TableColor: enum; OutlinePatch: enum)

Parameters

SingleGrid: enum (optional)

Display a single grid.

Off!

On!

FullGrid: enum (optional)

Display a full grid.

Off!

On!

TableColor: enum (optional)

Display table colors.

Off!

On!

OutlinePatch: enum (optional)

Display surface outlines.

Off!

On!


Route...

In a table or surface chart, choose Chart, Layout, specify table options or surface options.


SetTextChartBox

Purpose

Specifies box options for bullet charts.

Syntax

SetTextChartBox (ShowBox: enum; BoxPosition: enum)

Parameters

ShowBox: enum

Box types to display.

All!

Body!

None!

Title!

BoxPosition: enum

Box position in relation to chart text.

Above!

AboveBelow!

Behind!

Below!


Route...

In a bullet chart, choose Format, Define Bullets/Font, Box/Frame, select or deselect Display Box, specify options.


SetTextFillAttributes

Purpose

Specifies fill attributes for text.

Syntax

SetTextFillAttributes (Style: enum; FColorRed: numeric; FColorGreen: numeric; FColorBlue: numeric; BColorRed: numeric; BColorGreen: numeric; BColorBlue: numeric; BrushPattern: enum; GradType: enum; GradRefX: numeric; GradRefY: numeric; GradAngle: numeric; GradSteps: numeric)

Parameters

Style: enum

Fill style.

Gradient!

None!

Pattern!

FColorRed: numeric (optional)

Amount of red (0-255) in the foreground fill color.

FColorGreen: numeric (optional)

Amount of green (0-255) in the foreground fill color.

FColorBlue: numeric (optional)

Amount of blue (0-255) in the foreground fill color.

BColorRed: numeric (optional)

Amount of red (0-255) in the background fill color.

BColorGreen: numeric (optional)

Amount of green (0-255) in the background fill color.

BColorBlue: numeric (optional)

Amount of green (0-255) in the background fill color.

BrushPattern: enum (optional)

Fill pattern.

Arch!

BigChecks!

BigCrosshatch!

BigSquares!

ChainLink!

Checks!

Crosses!

Crosshatch!

Fishscale!

Gray12!

Gray25!

Gray50!

Honeycomb!

HorzBricks!

HorzLines1!

HorzLines2!

Mesh!

Patio!

Solid!

Squares!

TiltBricks!

TiltLines1!

TiltLines2!

TiltLines3!

TiltLines4!

Triangles!

VertLines1!

VertLines2!

Waves!

Weave!

GradType: enum (optional)

Gradient fill type.

ConcenCircles!

ConcenEllipse!

ConcenRects!

ConcenSquares!

ConverCircles!

ConverEllipse!

ConverRects!

ConverSquares!

Linear!

None!

Polygonal!

GradRefX: numeric (optional)

Horizontal center of a circular or rectangular gradient fill.  Flush left is 0, center is 50, and flush right is 100.

GradRefY: numeric (optional)

Vertical center of a circular or rectangular gradient fill or the top of a linear gradient.  Top is 0, center is 50, and bottom is 100.

GradAngle: numeric (optional)

Rotation angle for a gradient fill.  The top of the gradient is rotated counter-clockwise.  For example, a 90-degree angle places the top of the gradient parallel to the left margin of the page.

GradSteps: numeric (optional)

Number of steps between colors in a gradient fill.  A value of 0 represents the greatest possible number of steps.


Route...

In a text area, choose Format, Fill Attributes, specify options.


SetTextLineAttributes

Purpose

Specifies line attributes for text.

Syntax

SetTextLineAttributes (State: enum; Red: numeric; Green: numeric; Blue: numeric; Width: numeric)

Parameters

State: enum

State of text outline.

Off!

On!

Red: numeric (optional)

Amount of red (0-255) in the text outline.

Green: numeric (optional)

Amount of green (0-255) in the text outline.

Blue: numeric (optional)

Amount of blue (0-255) in the text outline.

Width: numeric (optional)

Line width in WordPerfect units (1200ths of an inch).


Route...

In a text area, choose Format, Line Attributes, specify options.


SetTitleString

Purpose

Specifies a data chart title, subtitle, or axis title.

Syntax

SetTitleString (TitleType: enum; TitleString: string)

Parameters

TitleType: enum

LegendTitle!

Subtitle!

Title!

XAxis!

Y1Axis!

Y2Axis!

TitleString: string

Data chart title.


Route...

In a data chart, choose Chart, Titles, select a title to edit, type a title.


SetViewOptions

Purpose

Specifies view options for data charts.

Syntax

SetViewOptions (View3D: enum; Horizontal: enum; ShowData: enum)

Parameters

View3D: enum (optional)

Display chart in three dimensions.

Off!

On!

Horizontal: enum (optional)

Display a chart horizontally.

Off!

On!

ShowData: enum (optional)

Display a table of data with a chart.

Off!

On!


Route...

In a data chart, choose Chart, Layout, specify display options.


ShadowAttributes

Purpose

Specifies the color, offset, and transparency of shadows.

Syntax

ShadowAttributes (XOffSet: numeric; YOffSet: numeric; ShadowColorR: numeric; ShadowColorG: numeric; ShadowColorB: numeric; Transparency: enum)

Parameters

XOffSet: numeric

Shadow's horizontal offset, in WordPerfect units (1200ths of an inch).  Values range from -600 to 600 (0.5  left to 0.5  right).

YOffSet: numeric

Shadow's vertical offset in WordPerfect units.  Values range from -600 to 600 (0.5  down to 0.5  up).

ShadowColorR: numeric

Amount of red (0-255) in a shadow.

ShadowColorG: numeric

Amount of green (0-255) in a shadow.

ShadowColorB: numeric

Amount of blue (0-255) in a shadow.

Transparency: enum

Shadow transparency.

No!

Yes!


Route...

Format, Shadow Attributes, specify options.


ShadowAttributesDlg

Purpose

Displays the Shadow Attributes dialog box, which is used to modify the color, offset, and transparency of shadows.

Syntax

ShadowAttributesDlg ()


Route...

Format, Shadow Attributes, select the check box in the dialog box title bar.


ShowBackground

Purpose

Displays a specified background in the Background Editor.

Syntax

ShowBackground (BackgroundIndex: numeric)

Parameters

BackgroundIndex: numeric

Background number.


Route...

Slide, Edit Backgrounds, choose a background from the Background Selection drop-down list on the Power Bar.


ShowGrid

Purpose

Displays or hides the grid.  If no parameter is used, this command toggles grid display.

Syntax

ShowGrid (State: enum)

Parameters

State: enum (optional)

Off!

On!


Route...

View, Grid/Snap, Grid.


ShowRuler

Purpose

Displays or hides the Ruler.  If no parameter is used, this command toggles ruler display.

Syntax

ShowRuler (State: enum)

Parameters

State: enum (optional)

Off!

On!


Route...

View, Ruler.


ShowSlide

Purpose

Displays a specified slide.

Syntax

ShowSlide (Slide: numeric)

Parameters

Slide: numeric

Slide to display.


Route...

Slide, Go To, specify a slide number.


ShowLayout

Purpose

Displays a specified layout.  This command is available only in the Layout Editor.

Syntax

ShowLayout (TemplateIndex: numeric)

Parameters

TemplateIndex: numeric

Specifies a layout to display.  Layouts are numbered according to their order in the Layout drop-down list in the Slide Editor.


Route...

Slide, Edit Layouts, select a layout from the Layout Selection drop-down list on the Power Bar.


ShowToolbar

Purpose

Displays or hides the Toolbar.

Syntax

ShowToolbar ()


Route...

View, Toolbar.


SilhouetteObject

Purpose

Changes selected objects to silhouettes.

Syntax

SilhouetteObject ()


Route...

Select objects to modify, Format, Image Settings, Silhouette.


BeginSelect

Purpose

Activates the Select drawing tool, which is used to select items to modify.

Syntax

BeginSelect ()


Route...

Edit, Select, Item.


SizeObjectsAroundAnchor

Purpose

Sizes selected objects by a specified amount around a point.

Syntax

SizeObjectsAroundAnchor (Multiplier: numeric; AnchorPoint: enum; Copy: enum)

Parameters

Multiplier: numeric

Percentage by which to increase or decrease the size of objects.

AnchorPoint: enum

Center point for sizing.

Center!

LeftBottom!

LeftTop!

RightBottom!

RightTop!

Copy: enum

Copy selected objects before sizing.

No!

Yes!


Route...

Select objects to size, click the right mouse button on a sizing handle, specify options.


SizeObjectsByLeftBottomDlg

Purpose

Displays the Size dialog box, which is used to specify how far to move the left bottom edge when sizing an object.

Syntax

SizeObjectsByLeftBottomDlg ()


Route...

Select objects to size, click the right mouse button on the bottom left sizing handle, select the check box in the dialog box title bar.


SizeObjectsByLeftTopDlg

Purpose

Displays the Size dialog box, which is used to specify how far to move the left top edge when sizing an object.

Syntax

SizeObjectsByLeftTopDlg ()


Route...

Select objects to size, click the right mouse button on the top left sizing handle, select the check box in the dialog box title bar.


SizeObjectsByRightBottomDlg

Purpose

Displays the Size dialog box, which is used to specify how far to move the right bottom edge when sizing an object.

Syntax

SizeObjectsByRightBottomDlg ()


Route...

Select objects to size, click the right mouse button on the bottom right sizing handle, select the check box in the dialog box title bar.


SizeObjectsByRightTopDlg

Purpose

Displays the Size dialog box, which is used to specify how far to move the right top edge when sizing an object.

Syntax

SizeObjectsByRightTopDlg ()


Route...

Select objects to size, click the right mouse button on the top right sizing handle, select the check box in the dialog box title bar.


SkewObject

Purpose

Skews selected objects.

Syntax

SkewObject (DeltaX: numeric; DeltaY: numeric; XOffset: numeric; YOffset: numeric; SkewPtX: numeric; SkewPtY: numeric; CopyObject: enum)

Parameters

DeltaX numeric

Horizontal movement, in WordPerfect units (1200ths of an inch).

DeltaY: numeric

Vertical movement, in WordPerfect units.

XOffset: numeric

Horizontal offset, in WordPerfect units.

YOffset: numeric

Vertical offset, in WordPerfect units.

SkewPtX: numeric

Vertical position of rotation point, in WordPerfect units.

SkewPtY: numeric

Vertical position of rotation point, in WordPerfect units.

CopyObject: enum

No!

Yes!


Route...

Select objects to skew, Edit, Rotate, drag a side handle to skew, or press Ctrl while dragging to leave a copy of the original.


SkewObjectsAroundAnchor

Purpose

Skews selected objects around a point.

Syntax

SkewObjectsAroundAnchor (Percent: numeric; AnchorPoint: enum; Copy: enum)

Parameters

Percent: numeric

Percentage of the size of selected objects by which to skew objects.  Values range from -100 to 100.

AnchorPoint: enum

Anchor point around which to skew selected objects.

Bottom!

HorizontalCenter!

Left!

Right!

Top!

VerticalCenter!

Copy: enum

Copy selected objects before skewing.

No!

Yes!


Route...

Select objects to skew, Edit, Rotate, click the right mouse button on a side handle, specify options.


SkewObjectsAtBottomDlg

Purpose

Displays the Skew dialog box, which is used to skew the bottom edge of selected objects by a specified amount.

Syntax

SkewObjectsAtBottomDlg ()


Route...

Select objects to skew, Edit, Rotate, click the right mouse button on the bottom handle, select the check box in the dialog box title bar.


SkewObjectsAtLeftDlg

Purpose

Displays the Skew dialog box, which is used to skew the left edge of selected objects by a specified amount.

Syntax

SkewObjectsAtLeftDlg ()


Route...

Select objects to skew, Edit, Rotate, click the right mouse handle on the left side handle, select the check box in the dialog box title bar.


SkewObjectsAtRightDlg

Purpose

Displays the Skew dialog box, which is used to skew the right edge of selected objects by a specified amount.

Syntax

SkewObjectsAtRightDlg ()


Route...

Select objects to skew, Edit, Rotate, click the right mouse button on the right side handle, select the check box in the dialog box title bar.


SkewObjectsAtTopDlg

Purpose

Displays the Skew dialog box, which is used to skew the top edge of selected objects by a specified amount.

Syntax

SkewObjectsAtTopDlg ()


Route...

Select objects to skew, Edit, Rotate, click the right mouse button on the top handle, select the check box in the dialog box title bar.


SlideCDAudioDlg

Purpose

Displays the Slide CD-Audio dialog box, which is used to specify CD sound clip options.  Not recordable.

Syntax

SlideCDAudioDlg ()


SlideFirst

Purpose

Displays the first slide in the current slide show.

Syntax

SlideFirst ()


Route...

Press Ctrl+Home.


SlideGetLast

Purpose

Specifies the previous slide in a dialog box used to set slide options, such as the Sound dialog box.

Syntax

SlideGetLast ()


Route...

In a slide options dialog box (such as the Speaker Notes dialog box), click the left arrow button.


SlideGetNext

Purpose

Specifies the next slide in a dialog box used to set slide options, such as the Slide Transition dialog box.

Syntax

SlideGetNext ()


Route...

In a slide options dialog box (such as the Speaker Notes dialog box), click the right arrow button.


SlideLast

Purpose

Displays the last slide in the current slide show.

Syntax

SlideLast ()


Route...

Press Ctrl+End.


SlideLayoutReApply

Purpose

Re-applies a layout to selected slides.

Syntax

SlideLayoutReApply (OverrideChartStyle: enum; OverrideChartPosition: enum)

Parameters

OverrideChartStyle: enum (optional)

Override the current chart style with the chart style defined in the layout.

No!

Yes!

OverrideChartPosition: enum (optional)

Override the current chart position with the chart position defined in the layout.

No!

Yes!


Route...

Slide, Re-Apply Layout.


SlideNext

Purpose

Displays the next slide in the current slide show.

Syntax

SlideNext ()


Route...

Click the Next Slide button on the Power Bar, or press Page Down.


SlidePrevious

Purpose

Displays the previous slide in the current slide show.

Syntax

SlidePrevious ()


Route...

Click the Previous Slide button on the Power Bar, or press Page Up.


SlideShowList

Purpose

Displays a list view of the current slide show.

Syntax

SlideShowList ()


Route...

View, Slide List.


SlideShowOutline

Purpose

Displays the Outliner view of the current slide show.

Syntax

SlideShowOutline ()


Route...

View, Outliner.


SlideShowSlide

Purpose

Displays the Slide Editor view of the current slide.

Syntax

SlideShowSlide ()


Route...

View, Slide Editor.


SlideShowSort

Purpose

Displays the Slide Sorter view of the current slide show.

Syntax

SlideShowSort ()


Route...

View, Slide Sorter.


SlideTransitionsDlg

Purpose

Displays the Slide Transition dialog box, which is used to specify transition and advance options.

Syntax

SlideTransitionsDlg ()


Route...

Slide, Transition, select the check box in the dialog box title bar.


TemplateDlg

Purpose

Displays the Apply Template dialog box, which is used to apply a template to a specified slide.

Syntax

TemplateDlg ()


Route...

Slide, Apply Template, select the check box in the dialog box title bar.


SnapToGrid

Purpose

Toggles Snap to Grid, which aligns objects with the grid.

Syntax

SnapToGrid (State: enum)

Parameters

State: enum (optional)

Off!

On!


Route...

View, Grid/Snap, Snap to Grid.


SortSpreadsheetData

Purpose

Sorts data in a chart's Datasheet.

Syntax

SortSpreadsheetData (SortBy: enum; SortDirection: enum; SortKey: numeric)

Parameters

SortBy: enum

Sort by rows or columns.

Cols!

Rows!

SortDirection: enum

Sort in ascending or descending order.

Ascending!

Descending!

SortKey: string

Specifies a column or row to sort by.


Route...

In a data chart, select Datasheet cells to sort, Data, Sort, specify options.


SoundControlDlg

Purpose

Displays the Sound dialog box, which is used to add sound to a slide.

Syntax

SoundControlDlg ()


Route...

Slide, Sound, select the check box in the dialog box title bar.


SoundOptionsDlg

Purpose

Displays the Sound Options dialog box, which is used to specify how sound is played.  Not recordable.

Syntax

SoundOptionsDlg ()


SpaceObjectsHorizontally

Purpose

Evenly spaces three or more selected objects horizontally.

Syntax

SpaceObjectsHorizontally ()


Route...

Select objects to arrange, choose Graphics, Space Evenly, Left/Right.


SpaceObjectsVertically

Purpose

Evenly spaces three or more selected objects vertically.

Syntax

SpaceObjectsVertically ()


Route...

Select objects to arrange, choose Graphics, Space Evenly, Top/Bottom.


SpeakerNotesDlg

Purpose

Displays the Speaker Notes dialog box, which is used to select and edit notes.

Syntax

SpeakerNotesDlg ()


Route...

Slide, Speaker Notes, select the check box in the dialog box title bar.


Speller

Purpose

Opens Spell Check, which checks text for misspelled words, double words and letters, and irregular capitalization.

Syntax

Speller ()


Route...

In the Text Editor, choose Tools, Spell Check.


StretchObjectsAroundAnchor

Purpose

Stretches selected objects horizontally or vertically from an anchor point.

Syntax

StretchObjectsAroundAnchor (Multiplier: numeric; AnchorPoint: enum; Copy: enum)

Parameters

Multiplier: numeric

Percentage of selected objects' size by which to stretch selected objects.

AnchorPoint: enum

Point around which to center stretching.

Bottom!

CenterHorizontally!

CenterVertically!

Left!

Right!

Top!

Copy: enum

Copy selected objects before stretching.

No!

Yes!


Route...

Select objects to stretch, click the right mouse button on a stretch handle, specify options.


StretchObjectsByBottomDlg

Purpose

Displays the Stretch dialog box, which is used to stretch the bottom edge of selected objects.

Syntax

StretchObjectsByBottomDlg ()


Route...

Select objects to stretch, click the right mouse button on the bottom stretch handle, select the check box in the dialog box title bar.


StretchObjectsByLeftDlg

Purpose

Displays the Stretch dialog box, which is used to stretch the left edge of selected objects.

Syntax

StretchObjectsByLeftDlg ()


Route...

Select objects to stretch, click the right mouse button on the left stretch handle, select the check box in the dialog box title bar.


StretchObjectsByRightDlg

Purpose

Displays the Stretch dialog box, which is used to stretch the right edge of selected objects.

Syntax

StretchObjectsByRightDlg ()


Route...

Select objects to stretch, click the right mouse button on the right stretch handle, select the check box in the dialog box title bar.


StretchObjectsByTopDlg

Purpose

Displays the Stretch dialog box, which is used to stretch the top edge of selected objects.

Syntax

StretchObjectsByTopDlg ()


Route...

Select objects to stretch, click the right mouse button on the top stretch handle, select the check box in the dialog box title bar.


SwitchDocument

Purpose

Switch to another document.  This command exists for OS/2 integration and is only recordable from the OS/2 WorkPlace Shell.

Syntax

SwitchDocument (DocumentNumber: numeric)

Parameters

DocumentNumber: numeric


TemplateChartCreateDlg

Purpose

Displays the Create Chart Template dialog box.

Syntax

TemplateChartCreateDlg ()


Route...

Slide, Apply Template, choose Data Chart from the Template pop-up list, OK, double click the area labeled Double Click to Add Data, select the check box in the dialog box title bar.


TextAttributesDlg

Purpose

Displays the Text Attributes dialog box, which is used to specify text colors, pattern, and outline width.

Syntax

TextAttributesDlg ()


Route...

Format, Text Attributes, select the check box in the dialog box title bar.


TextBlock

Purpose

Toggles the text tool between select and insert mode.  Not recordable.

Syntax

TextBlock ()


TextBold

Purpose

Turns Bold on or off in the Text Editor.

Syntax

TextBold ()


Route...

In the Text Editor, click the right mouse button, choose Bold.


TextBoxCreate

Purpose

Creates a new text area.

Syntax

TextBoxCreate ()

See Also

AddTextBox


Route...

Insert, Text Box, drag to create a text box.


TextChartNext

Purpose

Moves the insertion point to the next level in a bullet chart.

Syntax

TextChartNext ()


Route...

In a bullet chart, press Tab.


TextChartPrevious

Purpose

Moves the insertion point up one level in a bullet chart.

Syntax

TextChartPrevious ()


Route...

In a bullet chart, press Shift+Tab.


TextDown

Purpose

Moves the insertion point down one line in a text area.

Syntax

TextDown ()


Route...

In the Text Editor, press Down Arrow.


TextEditExit

Purpose

Closes the Text Editor.

Syntax

TextEditExit ()


Route...

In a text area, click the right mouse button, choose Exit Text Editor.  In a text line, press Enter.


TextFontDlg

Purpose

Display the Font dialog box, which is used to change the current font.

Syntax

TextFontDlg ()


Route...

Format, Font, select the check box in the dialog box title bar.


TextInsertMode

Purpose

Toggles the text tool between typeover mode and insert mode.

Syntax

TextInsertMode ()


Route...

In the Text Editor, press Insert.


TextItalic

Purpose

Turns italics on or off.

Syntax

TextItalic ()


Route...

In the Text Editor, click the right mouse button, choose Italic.


TextKerning

Purpose

Specifies how far to advance text to the right or left.

Syntax

TextKerning (Distance: numeric)

Parameters

Distance: numeric

Distance to advance text, in WordPerfect units (1200ths of an inch.) Use positive values for right advance, negative values for left advance.


Route...

In the Text Editor, choose Format, Manual Kerning, Left or Right, specify a distance.


TextLayoutBackTab

Purpose

Moves selected text or the current line of text one tab stop to the left.

Syntax

TextLayoutBackTab ()


Route...

In the Text Editor, choose Format, Paragraph, Back Tab.


TextLayoutCenter

Purpose

Centers selected text or the current line of text.

Syntax

TextLayoutCenter ()


Route...

In the Text Editor, choose Format, Justification, Center.


TextLayoutDoubleIndent

Purpose

Moves left and right margins of the current paragraph inward one tab stop.

Syntax

TextLayoutDoubleIndent ()


Route...

In the Text Editor, choose Format, Paragraph, Double Indent.


TextLayoutFlushRight

Purpose

Aligns selected text or the current line of text at the right margin.

Syntax

TextLayoutFlushRight ()


Route...

In the Text Editor, choose Format, Line, Flush Right.


TextLayoutHangingIndent

Purpose

Moves all but the first line of the current paragraph one tab stop to the right.

Syntax

TextLayoutHangingIndent ()


Route...

In the Text Editor, choose Format, Paragraph, Hanging Indent.


TextLayoutIndent

Purpose

Moves the left margin of the current paragraph one tab stop to the right.

Syntax

TextLayoutIndent ()


Route...

In the Text Editor, choose Format, Paragraph, Indent.


TextLeft

Purpose

Moves the insertion point one character to the left.

Syntax

TextLeft ()


Route...

In the Text Editor, press Left Arrow.


TextLineCreate

Purpose

Creates a new text line.

Syntax

TextLineCreate ()

See Also

AddTextBox


Route...

Insert, Text Line.


TextReplace

Purpose

Searches for and replaces specified text.

Syntax

TextReplace (SearchString: string; SearchDirection: enum; SearchBeep: enum; ReplaceString: string; ReplaceType: enum)

Parameters

SearchString: string (optional)

Text to search for.

SearchDirection: enum (optional)

Search forward or backward.

Backward!

Forward!

SearchBeep: enum (optional)

Beep when a word is not found.  When recording this parameter, the Search Failure setting in the Environment dialog box determines the value.

Off!

On!

ReplaceString: string (optional)

Text to replace the text in the SearchString parameter.

ReplaceType: enum (optional)

Replace all occurrences or one occurrence of the character string specified in the SearchString parameter.

Global!

ReplaceOne!


Route...

In the Text Editor, choose Edit, Find and Replace, type text to find, type replacement text, choose a direction, Replace or Replace All.


TextRight

Purpose

Moves the insertion point right one character.

Syntax

TextRight ()


Route...

In the Text Editor, press Right Arrow.


TextScreenTop

Purpose

TextScreenTop moves the insertion point to the top of the current text window.

Syntax

TextScreenTop ()


Route...

In the Text Editor, press Ctrl+Home.


TextSearch

Purpose

Locates specified text in the current text area.

Syntax

TextSearch (SearchString: string; SearchDirection: enum; SearchBeep: enum)

Parameters

SearchString: string

Text string to search for.

SearchDirection: enum

Search forward or backward through the text.

Backward!

Forward!

SearchBeep: enum

Beep when a word is not found.  When recording this parameter, the Search Failure setting in the Environment dialog box determines the value.

Off!

On!


Route...

In the Text Editor, choose Edit, Find and Replace, type text to find, choose a direction, Find Next.


TextTab

Purpose

Inserts a tab at the insertion point in a text area.

Syntax

TextTab ()


Route...

In the Text Editor, press Tab.


TextToCurvesCmd

Purpose

Explodes text into lines and curves, so text becomes a graphic object.

Syntax

TextToCurvesCmd ()


Route...

Select text, choose Graphics, Text to Curves.


TextUnderline

Purpose

Turns underlining on or off.

Syntax

TextUnderline ()


Route...

In the Text Editor, click the right mouse button, choose Underline.


TextUp

Purpose

Moves the insertion point up one line in a text area.

Syntax

TextUp ()


Route...

In the Text Editor, press Up Arrow.


Thesaurus

Purpose

Opens the Thesaurus, which displays synonyms and antonyms for a specified word.

Syntax

Thesaurus ()


Route...

In the Text Editor, choose Tools, Thesaurus.


ToolbarCopy

Purpose

Copies a selected Toolbar.

Syntax

ToolbarCopy (ToolbarName: string; DestName: string)

Parameters

ToolbarName: string

Name of the Toolbar to copy.

DestName: string

New name for the copy.


Route...

Edit, Preferences, Toolbar, highlight a Toolbar, Copy, type a name.


ToolbarCreate

Purpose

Creates a new Toolbar.

Syntax

ToolbarCreate (ToolbarName: string)

Parameters

ToolbarName: string


Route...

Edit, Preferences, Toolbar, Create, type a name, OK, specify options and click Add Button for each button added to the new Toolbar.


ToolbarDelete

Purpose

Deletes a specified Toolbar.

Syntax

ToolbarDelete (ToolbarName: string)

Parameters

ToolbarName: string


Route...

Edit, Preferences, Toolbar, highlight a Toolbar, Delete.


ToolbarEdit

Purpose

Displays the Toolbar Editor dialog box, which is used to add, move, or delete buttons on the current Toolbar.

Syntax

ToolbarEdit ()


Route...

Edit, Preferences, Toolbar, highlight a Toolbar, Edit.


ToolbarRename

Purpose

Renames a specified Toolbar.

Syntax

ToolbarRename (ToolbarName: string; NewName: string)

Parameters

ToolbarName: string

Toolbar to rename.

NewName: string


Route...

Edit, Preferences, Toolbar, highlight a Toolbar, Rename, type a new name.


ToolbarSelect

Purpose

Specifies a Toolbar to display.  If no parameter is specified, the default Toolbar is displayed.

Syntax

ToolbarSelect  (ToolbarName: string)

Parameters

ToolbarName: string (optional)

Toolbar to display.


Route...

Edit, Preferences, Toolbar, highlight a Toolbar, Select.


Type

Purpose

Specifies text to insert into a text area.

Syntax

Type (Text: string)

Parameters

Text: string

Text to insert.


Route...

In the Text Editor, type text.


UndeleteDlg

Purpose

Displays the Undelete dialog box, which is used to restore deleted text.

Syntax

UndeleteDlg ()


Route...

In the Text Editor, press Alt+Shift+Backspace after deleting text, select the check box in the dialog box title bar.


Undo

Purpose

Reverses the most recent editing change.

Syntax

Undo ()


Route...

Edit, Undo.


UnselectAllObjects

Purpose

Deselects all selected objects.

Syntax

UnselectAllObjects ()


Route...

Press Esc.


ViewPrevious

Purpose

Switches to the previous view of the drawing area.

Syntax

ViewPrevious ()


Route...

View, Zoom, Previous View.


WindowsCascade

Purpose

Arranges windows so they overlap with title bars showing.

Syntax

WindowsCascade ()


Route...

Window, Cascade.


WindowsTile

Purpose

Arranges drawing windows so all open windows are visible at once.

Syntax

WindowsTile ()


Route...

Window, Tile.


WordLeft

Purpose

Moves the insertion point one word to the left in the Text Editor.

Syntax

WordLeft ()


Route...

In the Text Editor, press Ctrl+Left Arrow.


WordPerfectCharactersDlg

Purpose

Displays the Wordperfect Characters dialog box, which is used to insert WordPerfect characters into a text area.

Syntax

WordPerfectCharactersDlg ()


Route...

In the Text Editor, choose Insert, Character.


WordRight

Purpose

Moves the insertion point one word to the right in the Text Editor.

Syntax

WordRight()


Route...

In the Text Editor, Press Ctrl+Right Arrow.


ZoomArea

Purpose

Enlarges the view of an area in the drawing window.  Follow with ZoomToBox, which specifies the area to enlarge.

Syntax

ZoomArea ()


Route...

View, Zoom, Zoom Area.


ZoomIn

Purpose

Enlarges the view of the current drawing by 20%.

Syntax

ZoomIn ()


Route...

View, Zoom, Zoom In.


ZoomOut

Purpose

Reduces the view of the current drawing by 20%.

Syntax

ZoomOut ()


Route...

View, Zoom, Zoom Out.


ZoomPercent100

Purpose

Displays the current document at printed size.

Syntax

ZoomPercent100 ()


Route...

View, Zoom, Actual Size (100%).


ZoomPercent150

Purpose

Displays the current document at 150% printed size.

Syntax

ZoomPercent150 ()


Route...

Select 150% from the Zoom Options drop-down list on the drawing Power Bar.


ZoomPercent200

Purpose

Displays the current document at 200% printed size.

Syntax

ZoomPercent200 ()


Route...

Select 200% from the Zoom Options drop-down list on the drawing Power Bar.


ZoomPercent50

Purpose

Displays the current document at 50% printed size.

Syntax

ZoomPercent50 ()


Route...

Select 50% from the Zoom Options drop-down list on the drawing Power Bar.


ZoomPercent75

Purpose

Displays the current document at 75% printed size.

Syntax

ZoomPercent75()


Route...

Select 75% from the Zoom Options drop-down list on the drawing Power Bar.


ZoomToBox

Purpose

Sizes the view of the current drawing to a specified area.  Precede with ZoomArea.

Syntax

ZoomToBox (Left: numeric; Bottom: numeric; Right: numeric; Top: numeric)

Parameters

Left: numeric

Left coordinate of an area, in WordPerfect units (1200ths of an inch).

Bottom: numeric

Bottom coordinate of an area, in WordPerfect units.

Right: numeric

Right coordinate of an area, in WordPerfect units.

Top: numeric

Top coordinate of an area, in WordPerfect units.


Route...

View, Zoom, Zoom Area, drag to define area.


ZoomToDrawingArea

Purpose

Returns to the default view of the current drawing.

Syntax

ZoomToDrawingArea ()


Route...

View, Zoom, Margin Size.


ZoomToObjects

Purpose

Enlarges the view of selected objects.

Syntax

ZoomToObjects ()


Route...

Select objects, View, Zoom, Selected Objects.


ZoomToPage

Purpose

Displays a full-page view of the current drawing.

Syntax

ZoomToPage ()


Route...

View, Zoom, Full Page.


ZoomToSlideShowSize

Purpose

Sizes the current view to match the display size when shown in a slide show.

Syntax

ZoomToSlideShowSize ()


Route...

Choose Screen Size from the Zoom Options drop-down list on the drawing Power Bar.


ObexPublishDlg

Purpose

Displays the Use Publications dialog box.  Quattro Pro or Paradox must be installed for this command to function.

Syntax

ObexPublishDlg ()


Route...

File, Publish.


SlideSelect

Purpose

Selects or deselects one or more slides.

Syntax

SlideSelect (Additive: enum; Select: enum; SlideIndex: numeric)

Parameters

Additive: enum

Select specified slides in addition to current slide selection.

No!

Yes!

Select: enum

Use No! to deselect slides, Yes! to select slides.

No!

Yes!

SlideIndex: numeric

Index number for a slide.


Route...

In the Slide List or Slide Sorter, press Shift and click to select slides.


SlideSetCurrent

Purpose

Selects slides and specifies which slide is the current slide.

Syntax

SlideSetCurrent (Additive: enum; Select: enum; SlideIndex: numeric)

Parameters

Additive: enum

Select specified slides in addition to current slide selection.

No!

Yes!

Select: enum

Use No! to deselect slides, Yes! to select slides.

No!

Yes!

SlideIndex: numeric

Index number for a slide.


Route...

In the Slide List or Slide Sorter, click to select slides.  Press Ctrl while clicking to select multiple slides.


EnvOpenDocuments

Purpose

Returns the path and filename of each open document.  Not recordable.

Syntax

string EnvOpenDocuments ()

Return Value

string

See Also

System Variables


EnvSlideTitle

Purpose

Returns title of the current slide.  Not recordable.

Syntax

string EnvSlideTitle ()

Return Value

string

See Also

System Variables


EnvBackgroundTitle

Purpose

Returns the title of the current background.  Not recordable.

Syntax

string EnvBackgroundTitle ()

Return Value

string

See Also

System Variables


EnvCurrentBackgroundNumber

Purpose

Returns the number of the current background.  Not recordable.

Syntax

numeric EnvCurrentBackgroundNumber ()

Return Value

numeric

See Also

System Variables


EnvCurrentLayoutNumber

Purpose

Returns the number of the current layout.  Not recordable.

Syntax

numeric EnvCurrentLayoutNumber ()

Return Value

numeric

See Also

System Variables


EnvLayoutTitle

Purpose

Returns the title of the current layout.  Not recordable.

Syntax

string EnvLayoutTitle ()

Return Value

string

See Also

System Variables


EnvNumberOfBackgrounds

Purpose

Returns the total number of backgrounds.  Not recordable.

Syntax

numeric EnvNumberOfBackgrounds ()

Return Value

numeric

See Also

System Variables


EnvNumberOfLayouts

Purpose

Returns the total number of layouts.  Not recordable.

Syntax

numeric EnvNumberOfLayouts ()

Return Value

numeric

See Also

System Variables


EnvSingleSpaceInSentence

Purpose

Returns the state of smart space in QuickCorrect.  Not recordable.

Syntax

numeric EnvSingleSpaceInSentence ()

Return Value

numeric

See Also

System Variables


WritingTool1

Purpose

Activates a user-defined writing tool added to the Tools menu.  The number that records with this command indicates which writing tool to activate when multiple writing tools have been added.

Syntax

WritingTool1 ()


Route...

Tools, choose a user-defined writing tool (options vary according to the writing tools added).


// (Comment)

Purpose

The compiler ignores all text between // and the next hard return [HRt].

Comment text does not affect macro execution.  The comment line, including spaces, has a maximum length of 512 characters.

Syntax

// ...comments... [HRt]


APPACTIVATE

Purpose

Activates and displays a window.

Use APPLOCATE to return the window handle in a variable.

ASSIGN(hWnd; APPLOCATE("Program Manager"))

IF(hWnd)  // if hWnd not equal to 0

    APPACTIVATE(hWnd)

ELSE

    QUIT

ENDIF

Syntax

APPACTIVATE (WindowHandle)

Parameters

WindowHandle: numeric

The window handle of the window to activate (see APPLOCATE).

See Also

APPEXECUTE

APPLOCATE


APPEXECUTE

Purpose

Starts an application and displays it.

The macro terminates if the application is not successfully started.  APPEXECUTE is the equivalent of the Windows Program Manager Run command.

Syntax

APPEXECUTE (CommandLine)

Parameters

CommandLine: string

The path and name of a program file.

See Also

APPACTIVATE

APPEXECUTEEXT

APPLOCATE


APPEXECUTEEXT

Purpose

Starts an application and specifies how its window is displayed.

Syntax

ReturnValue := APPEXECUTEEXT (CommandLine; ShowWindow)

Return Value

The application handle (unique number) if the application is successfully started, or an error value less than 32 if not.  For the list of error values, see Windows 3.1 WinExec documentation (Programmer's Reference, Volume 2: Functions).  A partial list follows:

0	System out of memory or program file is corrupt.

2	File not found.

3	Path not found.

8	Insufficient memory to start application.

10	Incorrect Windows version.

11	Non-windows application.

Check error values with code similar to the following:

vError := APPEXECUTEEXT(CommandLine; ShowWindow)

SWITCH(vError)

CASEOF 0: ...statement block...

CASEOF 2: ...statement block...

ENDSWITCH

Parameters

CommandLine: string

The path and name of a program file.

ShowWindow: numeric

Specifies how an application's window is displayed.  The values are:

0	Hide window.  APPLOCATE and DDEINITIATE return the window handle of a hidden window.  DDEEXECUTE sends a command string to a hidden window.  APPACTIVATE activates a hidden window.  Accelerator keys choose a hidden window's menu options.

1	Show window at normal size.

2	Minimize window to an icon.

3	Maximize window to full screen size.

See Also

APPACTIVATE

APPEXECUTE

APPLOCATE

DDEEXECUTE


APPLICATION

Purpose

Identifies, for the compiler, an application to use in a macro.

APPLICATION is a non-executable statement that can occur anywhere in a macro, but must precede product commands to the application it identifies.

Applications used in the macro automatically start unless already active.  The user cannot terminate an application used in a macro can until the macro ends.

Syntax

APPLICATION (ProductPrefix; ApplicationName; Default!; Language)

Parameters

ProductPrefix: string

A two-character identifier that begins with a letter.  The second character can be a letter or number.  ProductPrefix directs product commands to non-default applications.  It is also used in NEWDEFAULT and ENDAPP statements.

Use a period to attach ProductPrefix to a product command.  If WordPerfect is the application and WP the product prefix, WP.AboutDlg is a valid command statement.  A recorded macro returns a product prefix of A1, A2, A3, and so forth, depending on the number of applications involved.

ApplicationName: string

The name of an application.  For example, "WordPerfect" for WordPerfect 6.0 for Windows.

Default!

An enumeration that identifies a default application.  Product commands to the default application do not require a product prefix.  There can be only one default application.

Language: string

The application's language code.  For example, "US" is the language code for United States English.

See Also

ENDAPP

NEWDEFAULT


APPLOCATE

Purpose

Returns a window handle.

APPLOCATE compares a name to the title bar text of all open windows.  If a match is found, the window handle of the matching window is returned.  If the search criteria matches more than one window, the window handle of the most recently opened window is returned.  If no match is found, zero is returned.

You can use an asterisk (*) as a wildcard character at any position in the APPLOCATE parameter.  If the parameter contains only an asterisk, APPLOCATE returns the window handle of the active window.

Syntax

ReturnValue := APPLOCATE (WindowTitle)

Return Value

The window handle of the window found in the search, or 0 if no window is found.

Parameters

WindowTitle: string

The window title to find.  The match between this parameter and the title must be exact unless you use an asterisk as a wildcard character.  Titles are case sensitive.

See Also

APPACTIVATE

APPEXECUTE


ASSERT

Purpose

Creates a Cancel, Error, or Not Found condition.

A Cancel, Error, or Not Found condition stops a macro unless preceded by ONCANCEL, ONERROR, or ONNOTFOUND, which direct macro execution to a specified LABEL.  ASSERT has no effect when preceded by CANCEL(Off!), ERROR(Off!), or NOTFOUND(Off!).

An error value is assigned to variable ErrorNumber when one of the three conditions occurs.  The values are:

1	Cancel condition.

2	Error condition.

7	Not found condition.

You cannot assign a value to ErrorNumber.

Use code similar to the following to check all three conditions with one subroutine (see Using Subroutines).

ONERROR(Condition)

ONCANCEL(Condition)

ONNOTFOUND(Condition)

...other statements...

LABEL(Condition)

SWITCH(ErrorNumber)

CASEOF 1: ...statement block...

CASEOF 2: ...statement block...

CASEOF 7: ...statement block...

ENDSWITCH

Syntax

ASSERT (Condition)

Parameters

Condition: enum

A condition to assert.

CancelCondition!

ErrorCondition!

NotFoundCondition!

CancelCondition! stops a macro unless preceded by ONCANCEL.  ErrorCondition! stops a macro unless preceded by ONERROR.  NotFoundCondition! stops a macro unless preceded by ONNOTFOUND.

See Also

CANCEL

ERROR

LABEL

NOTFOUND

ONCANCEL

ONERROR

ONNOTFOUND

RETURN

SWITCH


ASSIGN

Purpose

Assigns a value to a variable.

ASSIGN is equivalent to the assignment operator (:=).  Consider the following four statements and their equivalents:

ASSIGN(A; B) // assign the contents of B to A

ASSIGN(A; 487) // assign 487 to A

ASSIGN(A; B + 487) // assign the contents of B + 487 to A

ASSIGN(A; "John Doe") // assign the name John Doe to A

A := B // assign the contents of B to A

A := 487 // assign 487 to A

A := B + 487 // assign the contents of B + 487 to A

A := "John Doe" // assign the name John Doe to A

Syntax

ASSIGN (VariableName; Value)

Parameters

VariableName: variable

Contains the contents of Value.

Value: any

A variable, constant, character string, or expression.  The source line has a maximum length of 512 characters.

See Also

DISCARD

GLOBAL

INDIRECT

LOCAL

PERSIST

PERSISTALL


BEEP

Purpose

Causes a computer speaker or installed sound board to beep.

BEEP is commonly used with warning messages, or to signal when a macro pauses or finishes a task.

Syntax

BEEP


BIFFILEPATH

Purpose

Retrieves the path and filename of a Binary Initialization File (BIF).

See the shared code software developer's reference manual for more information about the BIF approach to initialization files.

Syntax

BIFFILEPATH (BIFFilePath; BIFFileType)

Parameters

BIFFilePath: string

The BIF path and filename is returned in this variable.

BIFFileType: enum

The BIF type that is returned in BIFFilePath.  A user can have only two active BIF files.

Private!	A BIF file containing settings that apply to a single user.

Public!	A BIF file containing settings that are shared by many, possibly concurrent, users.

See Also

BIFINFO

BIFREAD

BIFWRITE


BIFINFO

Purpose

Retrieves information from a Binary Initialization File (BIF).

See the shared code software developer's reference manual for more information about the BIF approach to initialization files.

Syntax

BIFINFO (Status; Group; Section; Item; DateTime; ItemFlags; ItemLength; ItemType; UseCount; ItemInfoType; BIFFile).

Parameters

Status: numeric

The status of a BIF call is returned in this variable.  The values are:

 0	Call was successful.

-2	Length of Group, Section, or Item exceeds buffer size.

-3	Requested Group, Section, or Item not found.

-4	Unknown error.

Group: string

The name of a Group.  If this parameter is not used, the number of Group names is returned in the UseCount parameter.

Section: string

The name of a Section.  If this parameter is not used, the number of Section names in the specified Group is returned in the UseCount parameter.

Item: string

The name of an Item.  If this parameter is not used, the number of Item names in the specified Group and Section is returned in the UseCount parameter.

DateTime: variable

The date and time the item was created is returned in this variable.  If Group, Section, and Item are not used, the current date and time is returned.

ItemFlags: variable

The flags associated with an item are returned in this variable.  If Group, Section, and Item are not used, 0 is returned.

ItemLength: variable

The length of an item entry is returned in this variable.  If Group, Section, and Item are not used, 0 is returned.

ItemType: variable

The item type is returned in this variable.  If Group, Section, and Item are not used, 0 is returned.

UseCount: variable

If Group, Section, or Item is not used, the number of Groups, Sections, or Items in a BIF is returned in this variable (see Group, Section, and Item parameters).  Otherwise, 0 is returned.

ItemInfoType: enum

The standard BIF types to examine.

Both!	Look in both standard BIFs.  Only valid when counting Groups, Sections, or Items.

Private!	Look in Private BIF only.

Public!	Look in Public BIF only.

BIFFile: string

The name of a non-standard BIF.

See Also

BIFFILEPATH

BIFREAD

BIFWRITE


BIFREAD

Purpose

Reads a Binary Initialization File (BIF), and returns Group, Section, or Item names, or item value.

Group, the highest BIF level.  For example, in the standard BIF, Group is associated with a WordPerfect product such as WP Macros, WP Shared Code, and WordPerfect.

Section, the next BIF level after Group, is associated with Group subdivisions.  For example, WordPerfect Sections include features such as Ruler, Power Bar, Table of Authorities, Repeat Value, and Files.

Item, the lowest BIF level, is associated with a Section entry.  For example, in the WordPerfect Section named Files, Items include Hyphenation Directory, Timed Document Backup, Macros Directory, and Template File.

Items contain values.  For example, the value of Macros Directory may be C:\WPWIN61\MACROS.

Group, Section, and Item names are subject to change.  See an application's documentation for more information.

Syntax

BIFREAD (Status, Group; Section; Item; Value; ItemType; NameSeparator; NameListType; BIFFile)

Parameters

Status: variable

The status of a BIF call is returned in this variable.  The values are:

 0	(or positive integer) Number of bytes read from the BIF.

-1	ItemType does not match returned item type (see ItemType parameter).

-2	Length of Group, Section, or Item exceeds buffer size.

-3	Requested Group, Section, or Item was not found.

-4	Unknown error.

Group: string

Contains a Group name.  If Group is not used, the BIF Group names are returned in a variable (see Value parameter).

Section: string

Contains a Section name.  If Group is used and Section is not, the BIF Section names for the specified Group are returned in a variable (see Value parameter).

Item: string

Contains an Item name.  If Group and Section are used and Item is not, the BIF Item names for the specified Group and Section are returned in a variable (see Value parameter).

Value: variable

The Group, Section, or Item names are returned in this variable, depending on which one is not used.  If Group, Section, and Item are used, the Item value is returned.  For example, given that "c:\wpwin61\macros\" is the default macros directory in a standard BIF,

BIFREAD(vStatus; "WordPerfect"; "Files"; "Macro Directory"; vEntry; AnsiString!; ; ;)

returns 18 to vStatus (the number of bytes returned in Value) and "C:\WPWIN61\MACROS\" to the Value parameter, vEntry.

ItemType: variable

The expected item type to return in a variable (see Value parameter).  ItemType is not used if Group, Section, or Item is not used.

0	Any!

1	Boolean!

2	SignedByte!

3	UnsignedByte!

4	SignedWord!

5	UnsignedWord!

6	SignedDWord!

7	UnsignedDWord!

8	Float4!

9	Float8!

10	AnsiString!

11	WPWordString!

12	BagOfbits!

NameSeparator: string (optional)

A delimiter string that separates Group, Section, or Item names.  The delimiter is not limited to a single character.  If not used, the default is a semicolon.  NameSeparator is not used when returning an item value (Group, Section, and Item are used).

NameListType: enum (optional)

A standard BIF to read.  Standard BIFs are associated with WordPerfect products (see BIFFile parameter).  The values are:

Both!	Look in both standard BIFs.

Private!	Look in Private BIF only.

Public!	Look in Public BIF only.

You cannot specify Public! to read an Item value.  Public! is ignored unless you are reading a list (Group, Section, or Item names).

BIFFile: string (optional)

The name of a non-standard BIF (a user-defined or non-WordPerfect product BIF).  If both parameters are used, BifFile overrrides NameListType.  If neither parameter is used, the default is NameListType.

See Also

BIFFILEPATH

BIFINFO

BIFWRITE


BIFWRITE

Purpose

Writes data to a Binary Initialization File (BIF).

See BIFREAD Comments for a description of BIF Groups, Sections, Items, and Values.

     	To write data to a BIF, you must use the Group, Section, Item, and Value parameters.  If you do not specify a value for each parameter, you will delete a level or item from the BIF.  See parameter descriptions below.

Syntax

BIFWRITE (Status, Group; Section; Item; Value; ItemType; ItemFlags, BIFFile)

Parameters

Status: variable

The status of a BIF call is returned in this variable.  The values are:

 0	(or positive integer) Number of bytes written to the BIF.

-1	Unknown Group, Section, or Item type.

-2	Requested Group, Section, or Item not found.

-3	Unknown error.

Group: string (optional)

A Group name.  To delete a Group, specify the Group name and do not use the Section parameter.  To delete all Groups, Sections, and Items, do not use the Group parameter.

Section: string (optional)

A Section name.  The Group name must be used.  To delete a Section, specify the Section name and do not use the Item parameter.

Item: string (optional)

An Item name.  The Group and Section names must be used.  To delete an Item, specify the Item name and do not use the Value parameter.

Value: string (optional)

The Item value to write to the BIF.  For example,

BIFWRITE(vStatus; "WordPerfect"; "Files"; "Macro Directory"; "C:\WPWIN60\MACROS"; AnsiString!; 0; )

writes "C:\WPWIN60\MACROS" to a private BIF.  It is the value of the "Macro Directory" item in the "Files" section of the "WordPerfect" group.

     	Do not write to a standard BIF while the associated WordPerfect application is running.  Standard BIFs remain open while Shared Code is running.  Play the previous example from Macro Facility.

ItemType: enum

The Value data type to write to the BIF.

0	Any!

1	Boolean!

2	SignedByte!

3	UnsignedByte!

4	SignedWord!

5	UnsignedWord!

6	SignedDWord!

7	UnsignedDWord!

8	Float4! (32-bit float)

9	Float8! (64-bit float)

10	AnsiString!

11	WPWordString!

12	BagOfbits!

If you write a new value to a BIF item, you must specifiy the same type as the previous item.  If not specified, ItemType is determined by the default value for each data type.

If ItemType does not match the current value type, it is converted if possible.  If not converted properly, you may not be able to read the value back later (see BIFFILEREAD).

ItemFlags: enum

Flags (attributes) only affect the public BIF.  Value 4 is processed when an item is read from a BIF.  All other values are processed when Shared Code starts.

None!	No flags.

DeletePrivate!	Removes an item in a private BIF that has the same name as an item in the public BIF.

OverridePrivate!	The public BIF item has precedence over an item with the same name in a private BIF.  Normally, the opposite is true.

DistributeToPrivate!	An item is copied to the private BIF when opened.

BIFFile: string

Contains the name of a non-standard BIF to write to.  If the BIF does not exist, it is created with specified Group, Section, and Item names, and Item value.  To write to a private BIF, do not use this parameter (see BIFREAD, NameListType parameter).

See Also

BIFFILEPATH

BIFINFO

BIFREAD


BREAK

Purpose

Ends a loop, and directs macro execution to the first statement after the ending loop statement (see Using Loop Statements).  In a SWITCH statement, BREAK directs macro execution to the first statement after ENDSWITCH.

BREAK bypasses the normal test expression of a loop or conditional statement.  Statements after BREAK are ignored.

Syntax

BREAK

See Also

FOR

FOREACH

FORNEXT

NEXT

REPEAT

SWITCH

WHILE


CALL

Purpose

Calls a subroutine that ends with RETURN (see Using Subroutines).

RETURN directs macro execution to the statement that follows the subroutine's caller.

Syntax

CALL (label)

Parameters

Label: label

A LABEL, PROCEDURE, or FUNCTION name that begins with a letter and consists of one or more letters or numbers.  The format for calling LABEL is,

CALL(LabelSub)

...other statements...

LABEL(LabelSub)

    ...statement block...

    RETURN

The formats for callng PROCEDURE and FUNCTION are,

CALL ProcSub(Parameter; Parameter)

...other statements...

PROCEDURE ProcSub(Parameter; Parameter)

    ...statementblock...

ENDPROC

CALL FuncSub(Parameter; Parameter)

...other statements...

FUNCTION FuncSub(Parameter; Parameter)

    ...statementblock...

ENDFUNC

See Also

CASE

CASE CALL

GO

INDIRECT

LABEL

RETURN


CANCEL

Purpose

Determines how a macro responds to a Cancel condition.

Create a Cancel condition by pressing Esc, or with ASSERT(CancelCondition!).

Syntax

CANCEL (State)

Parameters

State: enum

Specifies the Cancel state.  The default is CANCEL(On!).

Off!	Overrides a Cancel condition.

On!	Stops a macro unless preceded by ONCANCEL, which directs macro execution to a specified LABEL.

See Also

ASSERT

ERROR

LABEL

NOTFOUND

ONCANCEL


CASE

Purpose

A conditional statement that tests for matching expressions.  If a match is found, a LABEL is executed.  See Using Condtional Statements.

CASE compares Test to a set of Cases (values).  If the first comparison is true (if Test and Case match), the label following Case is executed.  If the comparison is false, the next Case is evaluated and so forth.  If no comparison is true, DefaultLabel is executed.

Syntax

The general form of a CASE statement is,

CASE (Test; {Case; label; Case; Label...}; DefaultLabel)

Parameters

Test: any

The control expression.  Variables are assigned values by commands such as GETSTRING, GETNUMBER, or MENU.

Case: any

An expression (variable, constant, character) with a value that is usually assigned before the macro is compiled.  It is possible to assign the value at run-time.

Label: label

The LABEL to execute if Case matches Test.

DefaultLabel: label (optional)

The LABEL to execute if no Case matches Test.  If not specified, statement immediately following CASE is executed.

See Also

CASE CALL

IF

INDIRECT

LABEL

SWITCH


CASE CALL

Purpose

A conditional statement that tests for matching expressions.  If a match is found, a LABEL is called.  See Using Condtional Statements.

CASE CALL compares Test to a set of Cases (values).  If the first comparison is true (if Test and Case match), the label following Case is executed.  If the comparison is false, the next Case is evaluated and so forth.  If no comparison is true, DefaultLabel is executed.

CASE is different from CASE CALL, in that a RETURN statement after LABEL directs macro execution to the statement that follows CASE CALL.

Syntax

The general form of a CASE CALL statement is,

CASE CALL (Test; {Case; label; Case; Label...}; DefaultLabel)

Parameters

Test: any

The control expression.  Variables are assigned values by commands such as GETSTRING, GETNUMBER, or MENU.

Case: any

An expression (variable, constant, character) with a value that is usually assigned before the macro is compiled.  It is possible to assign the value at run-time.

Label: label

The LABEL to execute if Case matches Test.

DefaultLabel: label (optional)

The LABEL to execute if no Case matches Test.  If not specified, statement immediately following CASE CALL is executed.

See Also

CASE

IF

INDIRECT

LABEL

RETURN

SWITCH


CHAIN

Purpose

Calls (starts) another macro when the parent macro ends.

A CHAIN macro does not return to its caller (see RUN).  A macro must be compiled before it is called by CHAIN.

Although CHAIN can occur anywhere in a macro, it is the last statement to execute.  You can cancel CHAIN (macro is not executed) with a QUIT statement.  For example,

CHAIN(EnvPaths + "Test4.wcm")

...other statements...

SWITCH(Test)

    CASEOF 1: CHAIN(EnvPaths + "Test1.wcm")

    CASEOF 2: CHAIN(EnvPaths + "Test2.wcm")

    CASEOF 3: CHAIN(EnvPaths + "Test3.wcm")

    CASEOF 4: CALL(DoSomethingElse)

    DEFAULT: QUIT

ENDSWITCH

Explanation: If Test equals 1, 2, or 3, the corresponding macro plays when the parent macro ends.  If Test equals 4, the DoSomethingElse subroutine is called and Test4.wcm plays when the parent macro ends.  If Test does not equal 1, 2, 3, or 4, the macro quits and a CHAIN statement does not execute.

Syntax

CHAIN (MacroFilename; {Parameter})

Parameters

MacroFilename: string

The path and name of a compiled macro.

Parameter: any (optional)

Enclose multiple parameters in braces ({}), separated by a semicolon.  For example: CHAIN ("macro"; {"a"; "b"; "c"}).  Parameter values are passed to a special array variable named MacroArgs.

See Also

RUN


CHARLEN

Purpose

Returns the number of characters in a string, including codes.

The string can be a variable, constant, character string, or result of an expression.  See STRLEN for examples.

Syntax

ReturnValue := CHARLEN (String)

Return Value

The number of characters, including codes, in a string.

Parameters

String: string

A variable, constant, character string, or result of an expression.

See Also

CHARPOS

STRLEN

SUBCHAR


CHARPOS

Purpose

Determines whether a character string is also a substring.

Syntax

ReturnValue := CHARPOS (String; SubString)

Return Value

The beginning position of a substring, or zero if a substring is not found.

vPos := CHARPOS("WordPerfect"; "Perfect") // vPos = 5

vPos := CHARPOS("WordPerfect"; "Scott") // vPos = 0

Parameters

String: string

A character string to evaluate.

Substring: string

A substring to locate in String.

See Also

CHARLEN

STRPOS

SUBCHAR


CLOSEFILE

Purpose

Closes one file or all files.

     	Close file(s) when no longer needed, or system resources will be lost.  Files are closed automatically when macro ends.  See OPENFILE.

Syntax

boolean CLOSEFILE (FileID: numeric)

Return Value

boolean True if successful, False if not.

Parameters

FileID: numeric (optional)

If not specified, all open files are closed.

See Also

FILEERROR

FILEISEOF

FILEPOSITION

FILEREAD

FILESIZE

FILETRUNCATE

FILEWRITE


COACHANIMATE

Purpose

Specifies mouse actions or key strokes to execute without user intervention.  This allows a Coach macro to demonstrate how to perform a function.  You cannot use COACHANIMATE when a filter is enabled.

Syntax

COACHANIMATE (Type; Specification)

Parameters

Type

Specifies whether COACHANIMATE animates the mouse or the keyboard.

Mouse!	Mouse movements are animated.

Keyboard!	Keystrokes are animated.

Specification

Wpstring: specifies actions to animate.  It contains a keystring or a mouse string, depending on the value of Type.  See KEYSTRING and MOUSE STRING.


COACHFILTERADD

Purpose

Defines a filter.  COACHFILTERENABLE enables defined filters.

Filters monitor: 1) mouse clicks in a specified area of the screen, 2) a single keystroke, 3) a combination of keystrokes (keystring), and 4) commands (tokens).

Compound Filters

To monitor more than one type of event, create a compound filter by using COACHFILTERADD several times, each time with the same filter name but with different filter specifications.  A compound filter can monitor single keystrokes and mouse events, but cannot also monitor keystrings or commands.  A compound filter can monitor several different commands, but cannot also monitor mouse events or keystrokes.  A filter that monitors keystrings cannot be a compound filter.

For example, to create a compound filter that waits for either 1) a left mouse click in the OK button of a specified dialog, or 2) an Enter keystroke, use COACHFILTERADD twice with the same name each time.  Specify a mouse string for the first command and a keystroke for the second.

You can enable one interface filter and one command filter at the same time (See COACHFILTERENABLE).

Filter Callback Procedure

Each filter can call at least one associated callback procedure which may give additional help when the user makes a mistake.  A callback procedure begins with a label name and ends with RETURN.

After an enabled filter compares the user's actions with those defined in the filter, it determines whether to execute the filter callback procedure.  LabelCondition in COACHFILTERADD determines when to call the callback:  1) the user's actions match the filter definition, 2) the user's actions do not match the filter definition, and 3) all cases.

When the macro executes a callback, return and array variables are created by the macro system and are accessible to the callback.

Filter Array Variable

Contains information about the user's actions while a filter is enabled.  The callback can access the array values for information about the event.  The name of the array is formed from the label name.  For example, if the label is LABEL1@, the array elements are LABEL1[1], LABEL1[2] and so on.

The information in the array depends on the type of callback receiving the array.  There are three callback types:  1) mouse, 2) key (key and keystring), and 3) command.

Mouse Filter Callbacks

The array element values are:

[1]	CBTYPE_MOUSE (0).  Mouse callback type.

[2]	Result of comparison between user's action and defined action.  The possible values are:

-1	Error.  The macro system did not complete the array.

0	Match.  The user's actions exactly match the defined actions.

1	No match.  The user's actions do not match the defined actions.

2	Partial Match.  The user's actions partially match the defined actions.  Possible only for a keyboard callback.

3	Regression.  The event undoes previous events (for example, the Backspace key is pressed).  A regression is not a match.  A callback receives this value only if LabelType is All! or NonMatch!.

4	Quit Filter.  The callback is not called.

[3]	Handle (hWnd) of the window in which the event occurs.

[4]	Horizontal coordinate of the mouse position.

[5]	Vertical coordinate of the mouse position.

[6]	Windows flags for the message.  Specific to the event message.  (See the Microsoft Windows Software Development Kit.)

[7]	Windows event message, such as WM_LBUTTONDOWN or WM_LBUTTONUP.

Key Filter Callbacks

The array element values are:

[1]	CBTYPE_KEY (1).  Key type.

[2]	Filter Compare result (see Mouse Filter Callback above).

[3]	Key code.

[4]	Windows flags for the event message.  Specific to the event message.  (See the Microsoft Windows Software Development Kit.)

[5]	Windows event message, such as WM_KEYDOWN or WM_KEYUP.

Command Callbacks

The array element values are:

[1]	CBTYPE_TOKEN (2).  Command type.

[2]	Filter compare result (see Mouse Filter Callback above).

[3]	Application that sent the command.

[4]	Command MacroID.  If a macro sent the command, this contains the macro ID.

[5]	Unique command ID.

[6]	Number of parameters for this command.

[7]	Command Flags.  MAC_REQUIRED (required parameter), MAC_REPEATING (parameter part of a repeating group), and/or MAC_NODATA (no paramters).  See command flags below.

[8]	Value of first parameter.

[9]	Value of second parameter (command flags):

MAC_REQUIRED	0x0100

MAC_REPEATING	0x0400

MAC_NODATA	0x8000

Filter Return Variable

Specifies whether to ignore an event or send it to the application.  Return variables have the same name as the callback label.

When a macro executes a callback's RETURN, the macro system checks the return variable, then passes the event to the application or throws it away.  If the variable is undefined the macro system performs the default action.

Callback Type	Default Action

Mouse	Throw away the event.

Key	Throw away the event.

Command	Pass the event to the application.

If the return variable is defined, the callback overrides the default action:

Value	Action

0	Pass the event to the application.

1	Throw away the event.

Compound Filters and Callbacks

A compound filter may have several associated callback procedures, such as a different callback procedure for each filter specification (for example, one callback to handle mouse clicks and a second callback to handle key presses).  An enabled compound filter checks its specifications in the order defined in the macro.  After the filter determines that a callback procedure should be called, the remaining filter specifications are not checked.

Performance

While the macro system processes a filter callback, all mouse movements, mouse clicks, and keystrokes are disabled until the callback returns.

Syntax

COACHFILTERADD (Name; Label; LabelCondition; Type; Filter; AppName; Command; RepeatingGroup)

Parameters

Name: Wpstring

The name of the filter to define.  If a filter with this name already exists, the new filter definition is appended to the existing definition to create a compound filter (see Compound Filters above).

Mouse! and Key! filters can be combined.  KeyString! filters cannot be added to other filters.  Command! filters can be appended to other Command! filters.

Label: Wpstring

The macro label which is the name of a callback.  Macro execution moves to this label as determined by LabelCondition (see Filter Callback Procedure above).

LabelCondition: enum

Specifies when to call the callback procedure marked by the label label.

All!	All user actions call the callback.

Match!	All user actions that match the filter call the callback.

Nonmatch!	Only user actions that do not match the filter call the callback.

Type: enum

Specifies the type of user action to filter (mouse movements, keystrokes, or generated product commands) and what values to assign to some of the remaining parameters.

Mouse!	Filter mouse actions.

Key!	Filter single keystrokes.

KeyString!	Filter a series of keystrokes (keystring).

Command!	Filter a product command.

Filter: WPstring (optional)

Specifies the actions to filter.  For example, a mouse filter can specify that the user should click in the OK button of a particular dialog.  A keystring filter can specify that the user should press Ctrl+B.

If Type is Mouse!, this parameter is a mouse string (see MOUSE STRING below).  If Type is Key!, this parameter is a single keystroke specification (see KEYSTRING).  If Type is KeyString!, this parameter is a keystring (see KEYSTRING).  If Type is Command!, this parameter is ignored.

AppName: Ansistring (optional)

Non-translatable application name, such as "WordPerfect".

Command: Unsigned word (optional)

Name of a product command to filter.  Required if Type is Command!.

RepeatingGroup (optional)

Filters parameter information for the product command specified in Command.  Required only if Type is Command!.

If any parameter in a repeating group is assigned a value, all parameters of the repeating group must be assigned a value.  You can specify more than one repeating group in the same COACHFILTERADD command.

Parameter: Unsigned word (First parameter of repeating group)

The parameter number to filter.  The Value command evaluates a parameter to a number.  For example, the Filename parameter of FileOpenDlg is "Value(FileOpenDlg.Filename)".

Compare: enum (Second parameter of repeating group)

Specifies how to compare Parameter and Value.

Equal!	Parameter is equal to Value.

NotEqual!	Parameter is not equal to Value.

Less!	Parameter is less than Value.

Greater!	Parameter is greater than Value.

NotGreater!	Parameter is less than or equal to Value.

Exist!	Parameter exists but can be any value.

NotExist!	Parameter does not exist.

DontCare!	Parameter may or may not exist.  If it exists, it can be any value.

Value: any (Third parameter of repeating group)

Contains any value type to compare with Parameter.

See Also

COACHFILTERENABLE


COACHFILTERDESTROY

Purpose

Removes a filter definition.

Only one interface filter and one command filter can be enabled at a time.

When a filter is enabled, it compares a mouse movement, keystroke, or token to actions defined in the filter,  then calls a callback procedure or passes the event unchanged.

When several filters are enabled, the filters are chained together.  When an event occurs, the first filter filters the event.  If that filter does not call a callback, the second filter filters the event, and so on.  As soon as a filter calls a callback, no other filters can filter the event.

A filter must be defined by COACHFILTERADD before it can be enabled.  An enabled filter remains enabled until it is disabled by COACHFILTERDISABLE or destroyed by COACHFILTERDESTROY.

Syntax

COACHFILTERDESTROY (Name)

Parameters

Name: Wpstring

The name of a filter to destroy.

See Also

COACHFILTERDISABLE


COACHFILTERDISABLE

Purpose

Disables an active filter.  A filter definition remains in memory until COACHFILTERDESTROY destroys it, or until the macro ends.

Syntax

COACHFILTERDISABLE (Command; Interface)

Parameters

Command: WPstring (optional)

The name of a command filter to disable.

Interface: WPstring (optional)

The name of an interface filter to disable.

See Also

COACHFILTERDESTROY


COACHFILTERENABLE

Purpose

Enables (activates) specified filters.

Syntax

COACHFILTERENABLE (Command; Interface)

Parameters

Command: WPstring (optional)

The name of a command filter to enable.

Interface: WPstring (optional)

The name of an interface filter to enable.  Only one interface filter can be enabled at a time.

See Also

COACHFILTERADD

COACHFILTERDESTROY

COACHFILTERDISABLE


COACHGETREGIONINFO

Purpose

Returns information about a named region, such as a window handle, rectangle, existence of the window, and control ID.

Syntax

COACHGETREGIONINFO ("Region"; Existvar:exist; Hwndvar:hwnd; Leftvar:left; Topvar:top; RightVar:right; Bottomvar:bottom)

Parameters

Region

Name of the region to test.  For example:

"WordPerfect.Bookmark.GoToBttn"

Existvar

Returns 0 if the region does not exist, and 1 if it does exist.

Hwndvar

Windows handle value of a specified region.

Leftvar

Screen coordinates for the left edge of a specified region.

Topvar

Screen coordinates for the top edge of a specified region.

Rightvar

Screen coordinates for the right edge of a specified region.

Bottomvar

Screen coordinates for the bottom edge of a specified region.


COACHMESSAGEBOX

Purpose

Displays a message box.

Message boxes display available options, such as a list of Coaches.  Message boxes can include title, text, two bitmap images, radio buttons, check boxes, and pushbuttons.

Users can display more than one message box at a time and drag them to different postions on the screen.

Message Box Callback Procedure

Message boxes can have associated callback procedures. The callback procedure responds to events such as radio button, check box, and push button.  For example, if the user clicks a message box Close button, the callback procedure calls COACHMESSAGEBOXCLOSE to dismiss the message box.

When macro execution moves to a callback, the macro system creates an array variable that the callback can access.  The array name is formed from the label name. For example, the array elements of LABEL1@ are LABEL1[1], LABEL1[2], and so on.  The array variable contains information about the message box and identifies the selected control.  The element values are:

[1]	CBTYPE_MESSAGEBOX (4).  Message Box callback.

[2]	Name of the message box specified in MessageBoxName of COACHMESSAGEBOX.

[3]	Name of the control specified in ControlName of COACHMESSAGEBOX.

[4]	A value that specifies whether a control is checked/pressed (1) or unchecked (0).

Syntax

COACHMESSAGEBOX (MessageBoxName; Title; Text; Library; IdBitmap1; IdBitmap2; Bmp2RedMask; Bmp2GreenMask; Bmp2BlueMask; BorderType; Bitmap1Position; Bitmap2Position; Top; Left; TitleFont; TitleFontSize; TextFont; TextFontSize; Modality; Label; ResultVariable; RepeatingGroup)

Parameters

MessageBoxName: Ansistring

Unique name of a message box.  Passed to COACHMESSAGEBOXCLOSE to close the message box.  COACHMESSAGEBOXCLOSE is required only if the message box modality is Modal! or Modeless! (see Modality below).

The same name can be used for more than one message.  All messages with the same name close at the same time.

Title: WPstring (optional)

Message box title.  The title is displayed at the top of the message box, below the bitmap specified in Bitmap1.  TitleFont and to specify font and font size.

Text: Wpstring (optional)

Formatted text:

Character	Result

\n	Insert hard return.

\b	Toggle bold.

\u	Toggle underline.

\i	Toggle italic.

Bitmap2Position specifies text position.  TextFont and TextFontSize specify font and font size.

Library: Dword (optional)

The Windows handle of the DLL that contains the bitmaps specified in IdBitmap1 and IdBitmap2.  DLLOAD retrieves the handle.  DLLFREE removes the DLL from memory.

IdBitmap1: Word (optional)

Specifies a bitmap image, such as the Coach graphic, to display at the top of the message box.

Each bitmap specified in IdBitmap1 must be followed by a monochrome version of the bitmap (transparency bitmap) in the DLL library.  White areas in a transparency bitmap are transparent, black areas are not.

IdBitmap2: Word (optional)

Specifies a bitmap image to display in the message box.  Bitmap2Position specifies bitmap location.

Bitmaps specified by IdBitmap2 do not require a transparency bitmap.  Bmp2RedMask, Bmp2GreenMask, and Bmp2BlueMask specify a transparency color for IdBitmap2 bitmaps to conserve disk space.  Areas filled with the transparency color are transparent.

Bmp2RedMask: Byte  (optional)

Bmp2RedMask, Bmp2GreenMask and Bmp2BlueMask set red, green, and blue values (RGB) for the Bitmap2 transparency color.

The transparency color is the fill color that is transparent when the bitmap is displayed.

Bmp2GreenMask: Byte (optional)

See Bmp2RedMask above.

Bmp2BlueMask: Byte (optional)

See Bmp2RedMask above.

Bitmap1Position: enum (optional)

Bitmap1 position in the message box.

Left!	Display bitmap in the top left corner.  The top of the message box is flat.

Top!	Display bitmap in a semicircle at the top.

Bitmap2Position: enum (optional)

Bitmap2 position in the message box.

Left!	Align the left edge of the bitmap with the left edge of the message box. If the message box is longer than the bitmap, position the bitmap at the top of the message box.  Text and controls will wrap to the right.

Top!	Align the top edge of the bitmap directly under the message box title.  If the message box is wider than the bitmap, display the bitmap at the left of the message box.  Text and controls appear below the bitmap.

Right!	Align the right edge of the bitmap with the right edge of the message box.  If the message box is longer than the bitmap, display the bitmap at the top of the message box.  Text and controls wrap to the left.

Bottom!	Position the bottom edge of the bitmap above button controls, and below text and all other controls.  Pushbuttons always appear at the bottom of the box.  If the message box is wider than the bitmap, display the bitmap at the left of the message box.

LeftCenter!	Center bitmap vertically.

TopCenter!	Center bitmap horizontally.

RightCenter!	Center bitmap vertically.

BottomCenter!	Center bitmap horizontally.

Top: Word (optional)

Specifies the percentage of the document window's vertical space above the center of the message box.

Left: Word (optional)

Specifies the percentage of the document window's horizontal space left of the center of the message box.

TitleFont: Ansistring (optional)

The name of the Windows font to use to display the title.  If no titlefont is specified, the default dialog font is used.

TitleFontSize: Word (optional)

The point size of the message box title.

TextFont: Ansistring (optional)

The name of the Windows font to display text.  If no font is specified, the default font (MS Sans Serif 8pt) is used.

TextFontSize: Word (optional)

The point size of the message box text.

Modality: enum

The modality of the message box:  1) whether to dismiss the message box when a control is selected,  2) whether to call a callback procedure while a message box is displayed, and  3) whether the user can perform actions in the document window while the message box is displayed.

Simple!	Dismiss the message box when the user clicks a control.  No callback procedure.  User cannot perform actions in the document window while the message box is displayed.

Modal!	Do not dismiss the message box until COACHMESSAGEBOXCLOSE is called.  The callback procedure specified in label is called when the user selects a control.  The user cannot perform actions in the document window while the message box is displayed.

Modeless!	Do not dismiss the message box until COACHMESSAGEBOXCLOSE is called.  The callback procedure specified in label is called when the user selects a control.  The user can perform actions in the document window while the message box is displayed.

Label: Wpstring (optional)

The label name of a message box callback procedure.  Set this parameter only if the message box modality is Modal! or Modeless!.  If Modality is Simple!, this parameter is ignored.

The message box calls this label when the user selects a control (radio button, check box, or pushbutton) on the message box.  Also see Message Box Callback Procedure above.

ResultVariable: variable (optional)

Used only if Modality is set to Simple!.  When a message box's modalityis simple, the message box is automatically dismissed when the user selects a control.  The result variable specified in this parameter holds the name of the control (ControlName) that was selected.

RepeatingGroup (optional)

Specifies the controls (such as radio buttons, check boxes, and pushbuttons) to display in the message box.  Each repeating group contains three parameters which hold the information for one control.  You can specify multiple controls.

Controls always appear beneath the message box text (see Text).  Regardless of the order in which the controls are specified, they appear in the message box in this order:  radio buttons, check boxes, and pushbuttons.  If Bitmap2Position is Bottom!, bitmap2 displays below radio buttons and check boxes, and above pushbuttons (pushbuttons always display at the bottom of the message box).

If one parameter of a repeating group is specified, all three must be specified.

ControlName: Ansistring (First Parameter of Repeating Group)

A control name.  The name does not appear on the message box.  If thiscontrol is selected in the message box, the control name is displayed in Array[3].  If the message box modality is Simple!, the control name is copied to ResultVariable.

ControlType: enum (Second Parameter of Repeating Group)

Indicates a control type.

RadioButton!

CheckBox!

Button!

ControlText: Ansistring (Third Parameter of Repeating Group)

Control text.  Text is displayed to the right of radio buttons and checkboxes, and inside push buttons.

See Also

COACHMESSAGEBOXCLOSE


COACHMESSAGEBOXCLOSE

Purpose

Closes a message box.  Required only for Modeless! or Modal! message boxes (see Modality in COACHMESSAGEBOX).

Syntax

COACHMESSAGEBOXCLOSE (MessageBoxName)

Parameters

MessageBoxName: Ansistring

Name of a message box to close.  This should be the same name as in MessageBoxName of COACHMESSAGEBOX.

See Also

COACHMESSAGEBOX


COACHPROMPT

Purpose

Displays a prompt.

The prompt can display a message and a bitmap image that points to an item, such as a prompt that points to the File menu with the text "Click the File menu item."

The prompt location is set relative to a region (see Location and Region), or set to a fixed position in the document window.

When you set a location relative to a region, you can have a prompt display to the right, left, upper right, upper left, lower right, or lower left of the region.  The system adjusts the size of the prompt box to fit in the display area.  If the prompt is too large, the system checks for a suitable location by rotating the prompt clockwise.  For example, if the prompt is to display to the right of a region, but there isn't room, the system checks to the lower right.  If it will not fit there, the system checks the lower left, and so on.

COACHPROMPT points to items with bitmap images.  The bitmap image is displayed between the prompt box and the item.

IdBitmap specifies the bitmap image ID.  For example, if the prompt is displayed at the upper left, and the bitmap is a pointing hand, the fingers point down and to the right.

Bitmaps for all 6 prompt locations must be defined in order, starting with the upper left bitmap and proceding clockwise.  The transparency bitmap must immediately follow each bitmap.  IdBitmap should always contain the first bitmap ID (upper left).

Syntax

COACHPROMPT (PromptName; Message; Font; FontSize; Library; IdBitmap; Location; Top; Left; Region)

Parameters

PromptName: Ansistring

A unique name for the prompt.

Message: Wpstring (optional)

Message to display in the prompt.  Formatting codes are optional:

Character	Result

\n	Insert Hard Return

\b	Toggle Bold

\u	Toggle Underline

\i	Toggle Italic

Font: Ansistring (optional)

Name of the Windows font for prompt text.  If no font is specified, the default dialog font is used.

FontSize: Word (optional)

Point size of the prompt text.  If no font is specified, the default font (MS Sans Serif 8pt) is used.

Library: Dword (optional)

The Windows handle of the DLL that contains the bitmap to display outside the prompt.  DLLOAD retrieves the handle.  DLLFREE removes the DLL from memory.

IdBitmap: Word (optional)

The identifier of the first bitmap image defined for COACHPROMPT.

In the bitmap DLL library each bitmap specified by IdBitmap must be immediately followed by a transparency bitmap.  A transparency bitmap is a monochrome version of a bitmap.  White areas in the transparency bitmap are transparent, black areas are not.

Location: enum (optional)

Specifies where to display the prompt in relation to the region (see Region).

UpperLeft!	Display prompt upper left.

UpperRight!	Display prompt upper right.

Right!	Display prompt right.

LowerRight!	Display prompt lower right.

LowerLeft!	Display prompt lower left.

Left!	Display prompt left.

Specify!	Display prompt as specified by Top and Left.

Top: Word (optional)

Specifies the percentage of the document window's vertical space above the center of the message box.  Required only if Location is Specify!.

Left: Word (optional)

Specifies the percentage of the document window's horizontal space left of the center of the message box.  Required only if Location is Specify!.

Region: WPstring (optional)

The named region the prompt points to.  Not required if Top and Left are specified.

See Also

COACHPROMPTCLOSE

DLLFREE

DLLLOAD


COACHPROMPTCLOSE

Purpose

Closes a prompt.

Syntax

COACHPROMPTCLOSE (PromptName)

Parameters

PromptName: Ansistring

Name of the prompt to close.  This is the same name specified in PromptName of COACHPROMPT.

See Also

COACHPROMPT


COACHREMOVEDIALOGFILTER

Purpose

Removes a dialog box filter from memory.  (Not available in Shared Code 2.0.)

Syntax

COACHREMOVEDIALOGFILTER (Dialog Name)

Example:  COACHREMOVEDIALOGFILTER ("WordPerfect.Tabs")

Parameters

Dialog Name

Specifies a dialog filter to remove.

See Also

COACHSETDIALOGFILTER


COACHSETDIALOGFILTER

Purpose

Defines a filter for a dialog box.  The filter definition remains in memory until removed by CoachRemoveDialogFilter or until the macro ends.  When the dialog box is initialized, macro execution moves to the dialog filter callback.  (Not available in Shared Code 2.0.)

Syntax

COACHSETDIALOGFILTER (DialogRegionName; Label; DefaultAction)

Example:  COACHSETDIALOGFILTER ("WordPerfect.Tabs"; Tabsetcb@)

Parameters

DialogRegionName

Specifies a dialog to filter.

Label

Specifies the name of a callback label to go to when the dialog box is displayed.

DefaultAction (optional)

Specifies whether the default allows an event or throws it away.  If a default action is not specified, all events are allowed.

Allow!	Allow the event.

ThrowAway!	Do not allow the event.

Return Value

When the dialog is invoked or a control on the dialog is activated, a variable array is created indicating the actions the user is taking.  The dialog callback procedure can test each item in the array and perform appropriate operations.

The variable array's name is the same as the callback label.  For example, the variable array of TabSetCB@ is TabSetCB[array item].

The variable array contains the following information depending on the message sent in Callback[5].

Element	Description

Callback[1]	Callback type (always 3 for a dialog callback)

Callback[2]	Dialog name

Callback[4]	Dialog window handle

Callback[5]	Message sent to the callback

The following messages are valid and require the additional information shown.

272 = WM_INITDIALOG.  Sent when the dialog is first displayed.  This message is for notification only and cannot be altered or prevented by the callback.  If Callback[5] is 272, the following information is contained in the callback array:

Callback[6]  =  Window handle of the control that will receive the focus.

2 = WM_DESTROY.  Sent when the dialog goes down.  This message is for notification only and cannot be altered or prevented by the callback.  No additional information is contained in the callback array.

6 = WM_ACTIVATE.  Sent when the dialog is activated or inactivated.  This message is for notification only and cannot be altered or prevented by the callback.  If Callback[5] is 6, the following information is contained in the callback array:

Callback[6]  =  Activation state of the dialog

0  =  WA_INACTIVE (dialog becomes inactive)

1  =  WA_ACTIVE (dialog becomes active)

2  =  WA_CLICKACTIVE (dialog becomes active from a mouse click in the window)

Callback[8]  =  Minimized flag (A nonzero value means that the dialog is minimized.)

Callback[9]  =  Window handle of the window being activated or deactivated

3 = WM_MOVE.  Sent when the dialog is moved to a new location on screen.  This message is for notification only and cannot be altered or prevented by the callback.  If Callback[5] is 3, the following information is contained in the callback array:

Callback[8]  =  New X position of the window

Callback[9]  =  New Y position of the window

273 = WM_COMMAND.  Sent when the user interacts with a control or menu item owned by the dialog.  WM_COMMAND events can be altered by the callback.  To prevent the dialog from acting on the control or menu item, set the return variable to 1.  To enable the dialog to act on the menu item, set the return variable to 0.  The default is 0.  The information in the callback array depends on the menu or control type.  If Callback[5] is 273, the following information is contained in the array:

Callback[3]  =  Control name (blank if the notification is from a menu item).

Callback[6]  =  Control or menu item ID.

Callback[9]  =  Control window handle (blank if the notification is from a menu item).

Menu Items

No additional information in the array.

ListBoxes

Callback[8]  =  LBN_DBLCLK (2).  List box item was double-clicked.

ComboBoxes

Callback[8]  =  CBN_DBLCLK (2).  Combo box item was double-clicked.

Button

Callback[8]  =  BN_CLICKED (0).  Button was clicked

Callback[8]  =  BN_DOUBLECLICKED (5).  Button was double-clicked.

FileNameEntry

Callback[8]  =  FNEN_DLGDISMISS (0).  Open dialog was dismissed.

Callback[8]  =  FNEN_DLGRAISE (1).  Open dialog was displayed.

HotSpot

Callback[8]  =  BMPN_CLICKED (0).  Bitmap was clicked.

Callback[8]  =  BMPN_DOUBLECLICKED (1).  Bitmap was double-clicked.

See Also

COACHREMOVEDIALOGFILTER


COPYFILE

Purpose

Copies a file.

Syntax

boolean COPYFILE (SourceFilename: string; DestinationFilename: string; Prompts: enum)

Return Value

boolean True if successful, False if not.

Parameters

SourceFilename: string

DestinationFilename: string

Prompts: enum (optional)

Confirm replacement if destination file exists.

NoPrompts!

Prompts!

See Also

DELETEFILE

DOESFILEEXIST

RENAMEFILE


CREATEDIRECTORY

Purpose

Creates a directory.

Syntax

boolean CREATEDIRECTORY (DirectoryName: string; Prompts: enum)

Return Value

boolean True if successful, False if not.

Parameters

DirectoryName: string

Include full path.

Prompts: enum (optional)

Prompt if directory exists.

NoPrompts!

Prompts!

See Also

DELETEDIRECTORY

DOESDIRECTORYEXIST

GETCURRENTDIRECTORY

RENAMEDIRECTORY

SETCURRENTDIRECTORY


CTON

Purpose

Converts a keyboard character to its decimal equivalent.

Syntax

ReturnValue := CTON (Character)

Return Value

The decimal equivalent of a keyboard character.

Parameters

Character: string

A keyboard character to convert.  If a string is used, the decimal equivalent of the first character is returned.

See Also

NTOC


DDEEXECUTE

Purpose

Sends a command string to a client application.

See the client application's documentation for command names and syntax.

Syntax

DDEEXECUTE (ConversationID; Command)

Parameters

ConversationID: numeric

A number that links the server and client applications.  DDEINITIATE returns the number in a variable.

Command: string

A command to execute.

See Also

DDEEXECUTEEXT

DDEINITIATE


DDEEXECUTEEXT

Purpose

Sends a command to a client application, and returns a value that indicates if the command was successfully processed.

See the client application's documentation for command names and syntax.

Syntax

ReturnValue := DDEEXECUTEEXT (ConversationID; Command; TimeOut; Label)

Returns

A number greater than 0 if successful, or 0 if not.

Parameters

ConversationID: numeric

A number that links the server and client applications.  DDEINITIATE returns the number in a variable.

Command: string

A command to execute.

TimeOut: numeric

Asychronous DDE: Set TimeOut to 0 or a negative value.  DDE returns immediately, and notifies the macro that the command was delivered.  When the client application acknowledges receiving the command, DDE notifies the macro and the macro calls label.  The return value is invalid for asychronous DDE, because the client application has not yet processed the command.

Synchronous DDE: Set TimeOut to a positive integer, which specifies the maximum number of milliseconds to wait while the client application processes the command.  The result is returned when the command is processed or DDE times out (command is not processed within the specified time).  See Return above.

Label: label

The LABEL to call when the client application acknowledges receiving the command (see TimeOut parameter).  If the LABEL statement does not include RETURN, macro behavior is unpredictable.

See Also

DDEEXECUTE

DDEINITIATE

LABEL


DDEINITIATE

Purpose

Starts a DDE conversation with a client application.

A conversation must be started between server and client applications before you can use commands such as DDEPOKE, DDEREQUEST, and DDEEXECUTE.

Syntax

DDEINITIATE (ConversationID; ServiceName; TopicName)

Parameters

ConversationID: variable

A number that links the server and client applications is returned in this variable, or zero if the conversation is not started.

ServiceName: string

A DDE service name.  See a client application's documentation.  For Presentation 3.0, ServiceName is "WPPresentations".

TopicName: string

A topic name.  See the client application's documentation.  For Presentations 3.0, TopicName is "Command".

See Also

DDEEXECUTE

DDEPOKE

DDEREQUEST

DDETERMINATE

DDETERMINATEALL


DDEPOKE

Purpose

Assigns data to an item in a client application.

Syntax

DDEPOKE (ConversationID; ItemName; ItemData)

Parameters

ConversationID: numeric

A number that links the server and client applications.  DDEINITIATE returns the number in a variable.

ItemName: string

A client application item.  See the client application's documentation for item names.

ItemData: string

The data to assign to a client application item.

See Also

DDEINITIATE

DDEREQUEST


DDEREQUEST

Purpose

Assigns the contents of a client application item to a macro variable.

Syntax

ReturnValue := DDEREQUEST (ConversationID; ItemName)

Return Value

The contents of the client application item specified by ItemName.

Parameters

ConversationID: numeric

A number that links the server and client applications.  DDEINITIATE returns the number in a variable.

ItemName: string

The name of a client application item.

See Also

DDEINITIATE

DDEPOKE

ONDDEADVISE CALL


DDETERMINATE

Purpose

Ends a DDE conversation with a client application.

Syntax

DDETERMINATE (ConversationID)

Parameters

ConversationID: numeric

A number that links the server and client applications.  DDEINITIATE returns the number in a variable.

See Also

DDEINITIATE

DDETERMINATEALL


DDETERMINATEALL

Purpose

Ends all DDE conversations.

Syntax

DDETERMINATEALL

See Also

DDEINITIATE

DDETERMINATE


DECLARE

Purpose

Creates a local variable or array, which stores as many variables, constants, or expressions as memory allows.

An array can have up to 10 dimensions, and up to 32,767 elements per dimension depending on the amount of available memory.  In the following example, DECLARE creates ArrayA with ten elements and ArrayB with five elements.  An element in each array is assigned a value.  Parentheses are optional.

DECLARE(ArrayA[10]; ArrayB[5])

ArrayA[3] := "John"

Explanation: Assigns "John" to the third element in ArrayA

ArrayB[5] := ArrayA[3]

Explanation: Assigns "John" to the fifth element in ArrayB.

In the next example, DECLARE creates a two-dimensional array (ArrayC) with 100 elements (ten rows and ten columns).  One element is assigned a value.

DECLARE ArrayC[10;10]

ArrayC[2;3] := 3+6

Explanation: Assigns 9 to the element at row 2, column 3.

Syntax

DECLARE (VariableName[Elements]; ...)

Parameters

VariableName: variable

The name of a local variable or array.  Use a semicolon to separate names when declaring more than one variable or array.

Elements: numeric

The number of elements in an array, enclosed in brackets.  Use a semicolon to separate elements in a multi-dimensional array.

See Also

GLOBAL

LOCAL

PERSIST

PERSISTALL


DEFAULTUNITS

Purpose

DEFAULTUNITS specifies the default unit of measure.

In the first example, Advance uses the default unit of measure (WP Units).  In the second, Advance overrides the default unit of measure and uses inches.  In the third, DEFAULTUNITS specifies centimeters as the default unit of measure.

Advance(AdvanceFromTop!; 4)

Explanation: Advance insertion point 4 WP Units.

Advance(AdvanceFromTop!; 4")

Explanation: Advance insertion point 4 inches.

DEFAULTUNITS(Centimeters!)

Advance(AdvanceFromTop!; 4)

Explanation: Advance insertion point 4 centimeters.

The default unit of measure is effective until changed by another DEFAULTUNITS command.  If not specified by DEFAULTUNITS, the default unit of measure is WP Units.

Syntax

DEFAULTUNITS (Units)

Parameters

Units: enum

A unit of measure.

Inches!

Centimeters!

Millimeters!

Points!	(One Point equals 1/72 of an inch)

WPUnits!	(One WordPerfect unit equals 1/1200 of an inch)

WP1200ths!	(Synonym for WPUnits!)


DELETEDIRECTORY

Purpose

Deletes a directory.

Syntax

boolean DELETEDIRECTORY (DirectoryName: string; Prompts: enum)

Return Value

boolean True if successful, False if not.

Parameters

DirectoryName: string

Include full path.

Prompts: enum (optional)

Prompt if directory does not exist.

NoPrompts!

Prompts!

See Also

CREATEDIRECTORY

DOESDIRECTORYEXIST

GETCURRENTDIRECTORY

RENAMEDIRECTORY

SETCURRENTDIRECTORY


DELETEFILE

Purpose

Deletes a file(s).

Syntax

boolean DELETEFILE (Filename: string; Prompts: enum)

Return Value

boolean True if successful, False if not.

Parameters

Filename: string

Include full path.  If file not specified, deletes all files in directory!

Prompts: enum (optional)

Prompt if file does not exist.

NoPrompts!

Prompts!

See Also

COPYFILE

DOESFILEEXIST

RENAMEFILE


DIALOGADDCHECKBOX

Purpose

Adds a check box control to a dialog box.

Syntax

DIALOGADDCHECKBOX (Dialog; Control; Left; Top; Width; Height; Text; MacroVar)

Parameters

Dialog: string

The name or number of the dialog box to contain the check box control (see DIALOGDEFINE).

Control: string

A name or number that identifes the check box control (see DIALOGSHOW).

Left: numeric

Number of dialog units from the left side of the dialog box to the left side of the check box.

Top: numeric

Number of dialog units from the top of the dialog box to the top of the check box.

Width: numeric

Width of the check box control in dialog units.

Height: numeric

Height of the check box control in dialog units.

Text: string

Text displayed to the right of the check box.

MacroVar: variable

1 is returned in this variable when check box is checked, and 0 when not checked.  The default value is 0.  If MacroVar is assigned a value greater than 0 before the macro compiles, the check box is checked when the dialog box is displayed.

See Also

DIALOGDEFINE

DIALOGSHOW


DIALOGADDCOLORWHEEL

Purpose

Adds a color wheel control to a dialog box, and returns a number that represents the selected color.

The color selection consists of three color elements (red, green, and blue), separated into color values by the formula given below (see MacroVar parameter).  These values are used in Windows programming to specify the color of a pen or brush.

Syntax

DIALOGADDCOLORWHEEL (Dialog; Control; Left; Top; Width; Height; MacroVar)

Parameters

Dialog: string

The name or number of the dialog box to contain the color wheel control (see DIALOGDEFINE).

Control: string

A name or number that identifes the color wheel control (see DIALOGSHOW).

Left: numeric

Number of dialog units from the left side of the dialog box to the left side of the color wheel control.

Top: numeric

Number of dialog units from the top of the dialog box to the top of the color wheel control.

Width: numeric

Width of the color wheel control in dialog units.

Height: numeric

Height of the color wheel control in dialog units.

MacroVar: variable

A number corresponding to a color selection is returned in this variable.  This number can be divided into three other numbers which correspond to red, green, and blue.  The formulas are:

vRed := MacroVar % 256

(vRed contains the red component, which is the remainder of MacroVar divided by 256)

vGreen := MacroVar / 256 % 256

(vGreen contains the green component, which is the remainder of MacroVar divided by 256 divided by 256)

vBlue := MacroVar / 256 / 256

(vBlue contains the blue component, which is the result of MacroVar divided by 256 divided by 256)

See Also

DIALOGDEFINE

DIALOGSHOW


DIALOGADDCOMBOBOX

Purpose

Adds a combo box control to a dialog box.

Displays an edit box and a list box.  You enter text in the edit box, or double-click a list item to insert.  Use DIALOGADDLISTITEM to create list box items.

Syntax

DIALOGADDCOMBOBOX (Dialog; Control; Left; Top; Width; Height; Style; MacroVar; LimitText)

Parameters

Dialog: string

The name or number of the dialog box to contain the combo box control (see DIALOGDEFINE).

Control: string

A name or number that identifes the combo box control (see DIALOGSHOW).

Left: numeric

Number of dialog units from the left side of the dialog box to the left side of the combo box.

Top: numeric

Number of dialog units from the top of the dialog box to the top of the combo box.

Width: numeric

Width of the combo box control in dialog units.

Height: numeric

Height of the combo box control in dialog units.

Style: enum

Combo box styles.  Type | between enumerations to combine styles.

Simple!	Displays an edit control and an opened drop-down list box.

Sort!	Items are sorted alphabetically.  If Sort! is used by itself, Simple! is the default combo box style.  See DIALOGADDLISTITEM.

Dropdown!	Displays an edit control.  Clicking the arrow to the right of the edit control displays a drop-down list box.

Droplist!	Displays a read-only edit control.  Clicking the arrow to the right of the edit control displays a drop-down list box.

WPChars!	Non-keyboard characters allowed in a list item.  See DIALOGADDLISTITEM.

Style combination examples

Sort! | Simple!

Explanation: Name search allowed on a sorted list box.  A vertical scrollbar automatically appears when needed.

MacroVar: variable

The selected combo box item is returned in this variable.  An item can be assigned to MacroVar before the macro compiles.

LimitText: numeric

Maximum number of characters the edit control accepts, up to the number of characters that fit in the edit box.  This number has no effect if you choose style 16 (DropDown3D!).

See Also

DIALOGADDLISTBOX

DIALOGADDLISTITEM

DIALOGADDPOPUPBUTTON

DIALOGDEFINE

DIALOGSHOW


DIALOGADDCONTROL

Purpose

Adds a custom control to a dialog box.

Syntax

DIALOGADDCONTROL (Dialog; Control; Left; Top; Width; Height; Class; Style; WindowName; MacroVar; Instance)

Parameters

Dialog: string

The name or number of the dialog box to contain the custom control (see DIALOGDEFINE).

Control: string

A name or number that identifes the custom control (see DIALOGSHOW).

Left: numeric

Number of dialog units from the left side of the dialog box to the left side of the custom control.

Top: numeric

Number of dialog units from the top of the dialog box to the top of the custom control.

Width: numeric

Width of the custom control in dialog units.

Height: numeric

Height of the custom control in dialog units.

Class: string

The name of the control class.  Standard Windows classes include Button, ComboBox, Edit, ListBox, ScrollBar, and Static.  Other controls such as Meters and Spin buttons must be defined in a DLL (see Instance parameter).  Class names for WordPerfect custom controls are in the TKSHWIN.H file on the diskette that comes with GroupWise Software Developer's Kit.

Style: numeric

A number that defines a class style.  For exampe, an edit control includes styles such as left, multiline, and password.  The values for standard Windows styles are in the WINDOWS.H file.

WindowName: string

Control text.  For example, the text that appears on a button control.  Set this value to "" if the control does not accept text.

MacroVar: variable

The value returned by a control.  For example, a check box returns 1 if checked, and 0 if not checked.

Instance: numeric

The handle of the DLL that contains the custom control.  DLLLOAD returns the handle of a custom DLL in a variable.  The Shared Code default is 0 (see GroupWise Software Developer's Kit for information about custom controls).

See Also

DIALOGDEFINE

DIALOGSHOW

MacroDialogResult


DIALOGADDCOUNTER

Purpose

Adds a counter control to a dialog box.

Click the counter button to insert a number in the edit box that is within a specified range (see CountMin and CountMax parameters).

Syntax

DIALOGADDCOUNTER (Dialog; Control; Left; Top; Width; Height; Format; MacroVar; CountMin; CountMax; CountStep)

Parameters

Dialog: string

The name or number of the dialog box to contain the counter control (see DIALOGDEFINE).

Control: string

A name or number that identifes the counter control (see DIALOGSHOW).

Left: numeric

Number of dialog units from the left side of the dialog box to the left side of the counter control.

Top: numeric

Number of dialog units from the top of the dialog box to the top of the counter control.

Width: numeric

Width of the counter control in dialog units.

Height: numeric

Height of the counter control in dialog units.

Format: numeric

Reserved for future use.  Set parameter to 0.

MacroVar: variable

The selected counter number is returned in this variable.  A number can be assigned to MacroVar before the macro compiles.

CountMin: numeric

The minimum number that you can insert by clicking the counter button.  You can enter a number in the edit control beyond the minimum and maximum range.

CountMax: numeric

The maximum number that you can insert by clicking the counter button.  You can enter a number in the edit control beyond the minimum and maximum range.

CountStep: numeric

The increment and decrement step value.

See Also

DEFAULTUNITS

DIALOGDEFINE


DIALOGADDEDITBOX

Purpose

Adds an edit control to a dialog box.

The text entered in the edit box is returned in MacroVar (see MacroVar parameter).

Syntax

DIALOGADDEDITBOX (Dialog; Control; Left; Top; Width; Height; Style; MacroVar; LimitText)

Parameters

Dialog: string

The name or number of the dialog box to contain the edit control (see DIALOGDEFINE).

Control: string

A name or number that identifes the edit control (see DIALOGSHOW).

Left: numeric

Number of dialog units from the left side of the dialog box to the left side of the edit control.

Top: numeric

Number of dialog units from the top of the dialog box to the top of the edit control.

Width: numeric

Width of the edit control in dialog units.

Height: numeric

Height of the edit control in dialog units.

Style: enum

Edit control styles.  Type | between enumerations to combine styles.  Not all combinations are possible.

Left!	Text is left justified.

Right!	Text is right justified if Multiline! style is set and WPChars! style is not set.

Center!	Text is centered if Multiline! style is set and WPChars! style is not set.

VScroll!	Edit control with a vertical scroll bar.

HScroll!	Edit control with a horizontal scroll bar.

WPChars!	Can display WP Character box (press Ctrl+W).  Non-keyboard characters allowed.

Multiline!	Multiple lines of input automatically wrap to the next line.  Press Enter to cause the default button action (see DIALOGADDPUSHBUTTON).  If Enter2Hrtn! style is set in DIALOGDEFINE, press enter to move the insertion point to the next line.

Uppercase!	Text automatically converted to uppercase.

Lowercase!	Text automatically converted to lowercase.

Password!	Text automatically displayed with astersik (*) characters.  The actual characters are stored by the edit control.

WordWrap!	Text wraps if Multiline! style is set.

SoftReturn!	Text contains Soft Return codes [SRt].

Attributes!	Underline (press Ctrl+U) and italics (press Ctrl+I) allowed if WPChars! style is set.

NoTabs!	Tab codes not exported with output.

NoWPChar!	Cannot display WP Character dialog box.  Non-keyboard characters not allowed.

MacroVar: variable

The text entered in the edit box is returned in this variable.  Text can be assigned to MacroVar before the macro compiles.

LimitText: numeric

The maximum number of characters the edit control accepts.

See Also

DIALOGDEFINE

DIALOGSHOW


DIALOGADDFILENAMEBOX

Purpose

Adds a filename edit control to a dialog box.

The filename edit control consists of an edit control and a button control.  Clicking the button displays the Select Directory or Select File dialog box depending on the control style (see Style parameter).

Syntax

DIALOGADDFILENAMEBOX (Dialog; Control; Left; Top; Width; Height; Style; MacroVar; DefaultDir; Template)

Parameters

Dialog: string

The name or number of the dialog box to contain the filename edit control (see DIALOGDEFINE).

Control: string

A unique expression) or number that identifes the filename edit control (see DIALOGSHOW).

Left: numeric

Number of dialog units from the left side of the dialog box to the left side of the filename edit control.

Top: numeric

Number of dialog units from the top of the dialog box to the top of the filename edit control.

Width: numeric

Width of the filename edit control in dialog units.

Height: numeric

Height of the filename edit control in dialog units.

Style: enum

Filename edit control styles.  Type | between enumerations to combine styles.

FilesAndDirs!	Directories and filenames allowed.

DirOnly!	Only directories allowed.

NoValidate!	No verification that a directory exists.

MacroVar: variable

The directory or filename entered in the edit box is returned in this variable.  A name can be assigned to MacroVar before the macro compiles.

DefaultDir: string (optional)

The default directory when the Select File dialog box is displayed.

Template: string (optional)

The filenames to display in the Select File dialog box.  For example, "*.*" (all files) and "*.bat" (all batch files).

See Also

DIALOGDEFINE

DIALOGSHOW


DIALOGADDFRAME

Purpose

Adds a frame to a dialog box.

You can combine frame styles by creating two frames the same size and at the same position.  For example, a black frame and a white-filled frame (see Control and Style parameters).  You can also create custom controls by combining frames and hot spots (see DIALOGADDHOTSPOT and DIALOGSHOW).

Syntax

DIALOGADDFRAME (Dialog; Control; Left; Top; Width; Height; Style)

Parameters

Dialog: string

The name or number of the dialog box to contain the frame control (see DIALOGDEFINE).

Control: string

A name or number that identifes the frame control (see DIALOGSHOW).

Left: numeric

Number of dialog units from the left side of the dialog box to the left side of the frame control.

Top: numeric

Number of dialog units from the top of the dialog box to the top of the frame control.

Width: numeric

Width of the frame control in dialog units.

Height: numeric

Height of the frame control in dialog units.

Style: enum

Frame styles.  Type | between enumerations to combine styles.  Not all combinations are possible.

Frame!	Frame only.

Black!	Black frame.

Gray!	Gray frame.  Gray is the default DeskTop color of the Windows Default color scheme.  To select a different color, choose Colors in the Windows Control Panel.

White!	White frame.

Filled!	Filled frame.

Style combination examples

Frame! | White!

Explanation: White frame displayed.

Filled! | White!

Explanation: White-filled frame displayed.

See Also

DIALOGADDGROUPBOX

DIALOGDEFINE

DIALOGSHOW


DIALOGADDGROUPBOX

Purpose

Draws a rectangle around related dialog controls such as buttons.

Grouping related controls helps narrow user options.

Syntax

DIALOGADDGROUPBOX (Dialog; Control; Left; Top; Width; Height; Title)

Parameters

Dialog: string

The name or number of the dialog box to contain the group box control (see DIALOGDEFINE).

Control: string

A name or number that identifes the group box control (see DIALOGSHOW).

Left: numeric

Number of dialog units from the left side of the dialog box to the left side of the group box control

Top: numeric

Number of dialog units from the top of the dialog box to the top of the group box control.

Width: numeric

Width of the group box control in dialog units.

Height: numeric

Height of the group box control in dialog units.

Title: string

The title displayed at the top left corner.

See Also

DIALOGADDFRAME

DIALOGADDHLINE

DIALOGADDVLINE

DIALOGDEFINE

DIALOGSHOW


DIALOGADDHLINE

Purpose

Adds a horizontal line to a dialog box.

Syntax

DIALOGADDHLINE (Dialog; Control; Left; Top; Length)

Parameters

Dialog: string

The name or number of the dialog box to contain the horizontal line control (see DIALOGDEFINE).

Control: string

A name or number that identifes the horizontal line control.

Left: numeric

Number of dialog units from the left side of the dialog box to the left side of the horizontal line control.

Top: numeric

Number of dialog units from the top of the dialog box to the top of the horizontal line control.

Length: numeric

Length of the horizontal line control in dialog units.

See Also

DIALOGADDFRAME

DIALOGADDGROUPBOX

DIALOGADDVLINE

DIALOGDEFINE

DIALOGSHOW


DIALOGADDHOTSPOT

Purpose

Creates an invisible area (hot spot) in a dialog box that closes the dialog box when clicked.  Other responses are possible when you use DIALOGADDHOTSPOT with a callback function (see DIALOGSHOW).

To create a hot spot within a frame (see DIALOGADDFRAME), overlap size and position parameters.

Syntax

DIALOGADDHOTSPOT (Dialog; Control; Left; Top; Width; Height; Style)

Parameters

Dialog: string

The name or number of the dialog box to contain the hot spot control (see DIALOGDEFINE).

Control: string

A name or number that identifes the hot spot control (see DIALOGSHOW).  The Control value is returned in the implicit variable MacroDialogResult (see DIALOGADDPUSHBUTTON or DIALOGDEFINE) if the user chooses the hot spot to dismiss the dialog box.

Left: numeric

Number of dialog units from the left side of the dialog box to the left side of the hot spot control.

Top: numeric

Number of dialog units from the top of the dialog box to the top of the hot spot control.

Width: numeric

Width of the hot spot control in dialog units.

Height: numeric

Height of the hot spot control in dialog units.

Style: enum

Hot spot styles.

Click!	Single click closes dialog box.

DblClick!	Double click closes dialog box.

See Also

DIALOGDEFINE


DIALOGADDICON

Purpose

Adds an icon to a dialog box.

Syntax

DIALOGADDICON (Dialog; Control; Left; Top; Width; Height; IconName; Instance)

Parameters

Dialog: string

The name or number of the dialog box to contain the icon control (see DIALOGDEFINE).

Control: string

A name or number that identifes the icon control (see DIALOGSHOW).

Left: numeric

Number of dialog units from the left side of the dialog box to the left side of the icon control.

Top: numeric

Number of dialog units from the top of the dialog box to the top of the icon control.

Width: numeric

Width of the icon control in dialog units.

Height: numeric

Height of the icon control in dialog units.

IconName: string

The name of an icon in a DLL.  If an icon is identified by a number, precede the number with a pound sign (#).  For example, "#160".

ModuleInstance: numeric

The handle of the DLL that contains the icon.  The Shared Code default is 0.  DLLLOAD returns the handle in a variable.

See Also

DIALOGDEFINE

DIALOGSHOW

DLLLOAD


DIALOGADDLISTBOX

Purpose

Adds a list box control to a dialog box.

Displays a list of options to choose from.  The option you choose is returned in MacroVar (see MacroVar parameter).  Use DIALOGADDLISTITEM to create list box items.

Syntax

DIALOGADDLISTBOX (Dialog; Control; Left; Top; Width; Height; Style; MacroVar)

Parameters

Dialog: string

The name or number of the dialog box to contain the list box control (see DIALOGDEFINE).

Control: string

A name or number that identifes the list box control (see DIALOGSHOW).

Left: numeric

Number of dialog units from the left side of the dialog box to the left side of the list box control.

Top: numeric

Number of dialog units from the top of the dialog box to the top of the list box control.

Width: numeric

Width of the list box control in dialog units.

Height: numeric

Height of the list box control in dialog units.

Style: enum

List box control styles.  Type | between enumerations to combine styles.

Unsorted!	Items listed in order defined.  Type a keyboard character to give the input focus to the first item that begins with that character.  A vertical scrollbar automatically appears when needed.  See DIALOGADDLISTITEM.

Sorted!	Default.  Items sorted alphabetically.  Type a keyboard character to give the input focus to the first item that begins with that character.  See DIALOGADDLISTITEM.

NameSearch!	Item search allowed.  Begin typing the name of an item to select.  An edit control is displayed above the list box, and the input focus is given to the item that most closely matches the characters you type.

MultiColumn!	Items automatically roll into other columns as needed.  A horizontal scrollbar automatically appears when needed.  Column width is set by Windows.

WPChars!	Non-keyboard characters allowed in a list item.  See DIALOGADDLISTITEM.

Style combination examples

Sort! | NameSearch!

Explanation: Name search allowed on a sorted list box.  A vertical scrollbar automatically appears when needed.

Sort! | NameSearch! | MultiColumn!

Explanation: Name search allowed on a sorted list box.  Items automatically roll in other columns as needed.  A horizontal scrollbar automatically appears when needed.

MacroVar: variable

The selected list box item is returned in this variable.  An item can be assigned to MacroVar before the macro compiles.

See Also

DIALOGADDCOMBOBOX

DIALOGADDLISTITEM

DIALOGDEFINE

DIALOGSHOW


DIALOGADDLISTITEM

Purpose

Creates a list item for DIALOGADDCOMBOBOX, DIALOGADDLISTBOX, or DIALOGADDPOPUPBUTTON.

Syntax

DIALOGADDLISTITEM (Dialog; Control; Item)

Parameters

Dialog: string

The name or number of the dialog box to contain the list item (see DIALOGDEFINE).

Control: string

The name or number of the control to contain the list item.

Item: string

A list box item.  Use NTOC programming command to include non-keyboard characters in a list item for DIALOGADDCOMBOBOX and DIALOGADDLISTBOX, when the WPChars! style is set.  For example,

DIALOGADDLISTITEM(1000; 100; "Sample" + NTOC(5;10))

See Also

DIALOGADDCOMBOBOX

DIALOGADDLISTBOX

DIALOGADDPOPUPBUTTON

DIALOGDEFINE

DIALOGSHOW


DIALOGADDPOPUPBUTTON

Purpose

Adds a popup button control to a dialog box.

Use DIALOGADDLISTITEM to create items for a popup button control.  Unless MacroVar is assigned a default item, the item displayed on the popup button is the first item created by DIALOGADDLISTITEM.

Syntax

DIALOGADDPOPUPBUTTON (Dialog; Control; Left; Top; Width; Height; MacroVar)

Parameters

Dialog: string

The name or number of the dialog box to contain the popup button control (see DIALOGDEFINE).

Control: string

A name or number that identifes the popup button control (see DIALOGSHOW).

Left: numeric

Number of dialog units from the left side of the dialog box to the left side of the popup button control.

Top: numeric

Number of dialog units from the top of the dialog box to the top of the popup button control.

Width: numeric

Width of the popup button control in dialog units.

Height: numeric

Height of the popup button control in dialog units.

MacroVar: variable

The item displayed on the popup button is returned in this variable.  An item can be assigned to MacroVar before the macro compiles.

See Also

DIALOGADDCOMBOBOX

DIALOGADDLISTBOX

DIALOGADDLISTITEM

DIALOGDEFINE

DIALOGSHOW


DIALOGADDPUSHBUTTON

Purpose

Adds a push button to a dialog box.

When you choose this button, the Control parameter value is returned in the implicit variable MacroDialogResult (see DIALOGDEFINE).  If you choose another push button, its Control parameter value is returned: 1 for OK, 2 for Cancel, 2 for Close (system menu box), 2 if you double-click the system menu box, 2 if you press Alt+F4, the Control parameter value of another user-defined push button, or the Control parameter value of a hot spot.

Syntax

DIALOGADDPUSHBUTTON (Dialog; Control; Left; Top; Width; Height; Style; ButtonText)

Parameters

Dialog: string

A name or number that matches the Dialog parameter of the dialog box to contain the push button control (see DIALOGDEFINE).

Control: string

A unique string or number that identifes the push button control.

Left: numeric

Number of dialog units from the left side of the dialog box to the left side of the push button control.

Top: numeric

Number of dialog units from the top of the dialog box to the top of the push button control.

Width: numeric

Width of the push button control in dialog units.

Height: numeric

Height of the push button control in dialog units.

Style: enum

Push button styles.

NonDefaultBttn!	Creates a push button that dismisses the dialog box.

DefaultBttn!	Creates a default push button, with a heavy black border, that dismisses the dialog box.  Press Enter to choose the default button.  If Enter2HRtn! style is specified in DIALOGDEFINE, pressing Enter in a multiline edit control produces a hard return rather than the default button action.

ButtonText: string

The text displayed on the push button.

See Also

DIALOGDEFINE

DIALOGDESTROY

DIALOGSHOW

MacroDialogResult


DIALOGADDRADIOBUTTON

Purpose

Adds a radio button to a dialog box.

Radio buttons represent mutually exclusive choices.  Selecting one radio button deselects another.  Group them together by a control such as a group box or horizontal or vertical line.  For multiple selections, see DIALOGADDCHECKBOX.

Syntax

DIALOGADDRADIOBUTTON (Dialog; Control; Left; Top; Width; Height; ButtonText; MacroVar)

Parameters

Dialog: string

The name or number of the dialog box to contain the radio button control (see DIALOGDEFINE).

Control: string

A name or number that identifes the radio button control (see DIALOGSHOW).

Left: numeric

Number of dialog units from the left side of the dialog box to the left side of the radio button control.

Top: numeric

Number of dialog units from the top of the dialog box to the top of the radio button control.

Width: numeric

Width of the radio button control in dialog units.

Height: numeric

Height of the radio button control in dialog units.

ButtonText: string

The text displayed to the right of the radio button.

MacroVar: variable

1 is returned in this variable if the radio button is selected, and 0 if not.  The default value is 0.  If MacroVar is assigned a value greater than 0 before the macro compiles, the radio button is automatically selected.

See Also

DIALOGADDCHECKBOX

DIALOGDEFINE

DIALOGSHOW


DIALOGADDSCROLLBAR

Purpose

Adds a horizontal or vertical scroll bar to a dialog box.

A callback function (see DIALOGSHOW) can receive Windows WM_HSCROLL and WM_VSCROLL messages from DIALOGADDSCROLLBAR.  The wParam parameter of both messages indicates the mouse location when the scroll bar is clicked, or the thumb position when the thumb is dragged.  The values are:

0	Right arrow clicked.

1	Left arrow clicked.

2	Area between the right arrow and thumb clicked.

3	Area between the left arrow and thumb clicked.

4	Position of thumb after it is dragged, passed as the low-order word of lParam.

5	The current position of thumb as it is dragged, passed as the low-order word of lParam.

6	Home key pressed while scroll bar has the input focus.

7	End key pressed while scroll bar has the input focus.

8	Scroll bar activity has ended.

See WM_HSCROLL and WM_VSCROLL in Programmer's Reference, Volume 3: Messages, Structures, and Macros (Windows 3.1 documentation).

Syntax

DIALOGADDSCROLLBAR (Dialog; Control; Left; Top; Width; Height; Style; MacroVar; Minimum; Maximum)

Parameters

Dialog: string

The name or number of the dialog box to contain the scroll bar control (see DIALOGDEFINE).

Control: string

A name or number that identifes the scroll bar control (see DIALOGSHOW).

Left: numeric

Number of dialog units from the left side of the dialog box to the left side of the scroll bar control.

Top: numeric

Number of dialog units from the top of the dialog box to the top of the scroll bar control.

Width: numeric

Width of the scroll bar control in dialog units (0 for vertical scroll bar).

Height: numeric

Height of the scroll bar control in dialog units (0 for horizontal scroll bar).

Style: enum

Scroll bar thumb position and type styles.  Type | between enumerations to combine styles.  Not all combinations are possible.

Left!	Position the thumb at the left end of a horizontal scroll bar.  Initializing MacroVar parameter overrides this parameter.

Top!	Position the thumb at the top end of a vertical scroll bar.  Initializing MacroVar parameter overrides this parameter.

Right!	Position the thumb at the right end of a horizontal scroll bar.  Initializing MacroVar parameter overrides this parameter.

Bottom!	Position the thumb at the bottom end of a vertical scroll bar.  Initializing MacroVar parameter overrides this parameter.

VScroll!	Create a vertical scroll bar.  The Width parameter does not apply to this style.

HScroll!	Create a horizontal scroll bar.  The Height parameter does not apply to this style.

Style combination examples

Left! | HScroll!

Explanation: Creates a horizontal scroll bar with the thumb at the left end.

Top! | VScroll!

Explanation: Creates a vertical scroll bar with the thumb at the top.

MacroVar: variable

The position of the thumb is returned in this variable.  To pre-select a thumb position, initialize MacroVar to the desired position.

Minimum: numeric

The minimum thumb position.  If the maximum position is 6 and the minimum position is 1, there are six positions on the scroll bar.  If the maximum position is 6 and the minimum position is 2, there are five positions on the scroll bar.

Maximum: numeric

The maximum thumb position.  See Minimum parameter.

See Also

DIALOGDEFINE

DIALOGDESTROY

DIALOGSHOW


DIALOGADDTEXT

Purpose

Displays a line of text in a dialog box.

Syntax

DIALOGADDTEXT (Dialog; Control; Left; Top; Width; Height; Style; Text)

Parameters

Dialog: string

The name or number of the dialog box to contain the text control (see DIALOGDEFINE).

Control: string

A name or number that identifes the text control (see DIALOGSHOW).

Left: numeric

Number of dialog units from the left side of the dialog box to the left side of the text control.

Top: numeric

Number of dialog units from the top of the dialog box to the top of the text control.

Width: numeric

Width of the text control in dialog units.  This parameter determines how much horizontal space the control occupies, not the text width which is fixed by the system.

Height: numeric

Height of the text control in dialog units.  This parameter determines how much vertical space the control occupies, not the text height which is fixed by the system.

Style: enum

Text control styles.  Type | between enumerations to combine styles.  Not all combinations are possible.

Left!	Left justified.

Right!	Right justified unless WPChars! style is set.

Center!	Centered inside Width parameter

       	value unless WPChars! style is set.

RecessBox!	Recessed background.

ShadowBox!	Shadowed background.

WPChars!	Non-keyboard characters allowed.  See Text parameter.

Multiline!	Text wraps if WPChars! is set.

Filename!	Ellipsis truncate path and filename to length of Width parameter.

Style combination examples

Left! | RecessBox!

Explanation: Text is left justified in a recess box.

Center! | ShadowBox!

Explanation: Text is centered in a shadow box.

Text: string

Text to display on the dialog box.  Use NTOC programming command to display a non-keyboard charcter.  For example,

Text: "A bullet character " + NTOC(4; 0)

See Also

DIALOGDEFINE

DIALOGSHOW

DIALOGDESTROY


DIALOGADDVIEWER

Purpose

Adds a read-only edit control to a dialog box.  The edit control displays a file.

The edit control has horizontal and vertical scroll bars.  The horizontal scroll bar contains text that identifies the text file format and indicates whether text wraps.

Syntax

DIALOGADDVIEWER (Dialog; Control; Left; Top; Width; Height; Filename)

Parameters

Dialog: string

The name or number of the dialog box to contain the viewer control (see DIALOGDEFINE).

Control: string

A name or number that identifes the viewer control (see DIALOGSHOW).

Left: numeric

Number of dialog units from the left side of the dialog box to the left side of the viewer control.

Top: numeric

Number of dialog units from the top of the dialog box to the top of the viewer control.

Width: numeric

Width of the viewer control in dialog units.

Height: numeric

Height of the viewer control in dialog units.

Filename: string

The path and name of a file to view.

See Also

DIALOGDEFINE


DIALOGADDVLINE

Purpose

Adds a vertical line to a dialog box.

Syntax

DIALOGADDVLINE (Dialog; Control; Left; Top; Length)

Parameters

Dialog: string

The name or number of the dialog box to contain the vertical line control (see DIALOGDEFINE).

Control: string

A name or number that identifes the vertical line control.

Left: numeric

Number of dialog units from the left side of the dialog box to the left side of the vertical line control.

Top: numeric

Number of dialog units from the top of the dialog box to the top of the vertical line control.

Length: numeric

Length of the vertical line in dialog units.

See Also

DIALOGADDFRAME

DIALOGADDGROUPBOX

DIALOGADDHLINE

DIALOGDEFINE

DIALOGSHOW


DIALOGDEFINE

Purpose

Creates a dialog box in memory.

Use DIALOGSHOW to display a dialog box created by DIALOGDEFINE.

The value of the control that dismisses a dialog box is returned in an implicit variable named MacroDialogResult: 1 for OK, 2 for Cancel, 2 for Close (system menu box), 2 if you double-click the system menu box, 2 if you press Alt+F4, or the value of the Control parameter of a user-defined push button or hot spot (see DIALOGADDPUSHBUTTON, DIALOGADDHOTSPOT).

MacroDialogResult is replaced or destroyed when you close a dialog box or call DIALOGDESTROY.  To save its value, assign it to a variable.  For example, vResult := MacroDialogResult.

Dialog boxes are positioned and sized in dialog units.  A vertical unit equals 1/8 of the font height, and a horizontal unit equals 1/4 of the font width.

Syntax

DIALOGDEFINE (Dialog; Left; Top; Width; Height; Style; Caption)

Parameters

Dialog: string

A name or number that identifies the dialog box.  This name or number is used by DIALOGSHOW and by DIALOGADD commands.

Left: numeric

Number of dialog units from the left side of the screen to the left side of the dialog box.  When used with Percent! (see Style parameter), this number is a percentage of the screen width minus the width of the dialog box.

Top: numeric

Number of dialog units from the top of the screen to the top of the dialog box.  When used with Percent! (see Style parameter), this number is a percentage of the screen height minus the height of the dialog box.

Width: numeric

Width of the dialog box in dialog units.

Height: numeric

Height of the dialog box in dialog units.

Style: enum

Dialog box styles.  Type | between enumerations to combine styles.  Not all combinations are possible.

OK!	Create an OK button.

Cancel!	       Create a Cancel button.

Modeless!	Dialog box can lose input focus without closing.  The WordPerfect command, InhibitInput, must be Off!.  Default is modal dialog box.

Percent!	Sets Top and Left parameters to a percentage of the screen width or height minus the width or height of the dialog box.  Use 50 to display the dialog box in the center of the screen.

NoFrame!	Create dialog box without a frame.

Sizeable!	Resizing of dialog box allowed.

NoTitle!	Remove the caption (title) bar.  Prevents moving the dialog box.

Enter2HRtn!	Press Enter in a multiline edit control (see DIALOGADDEDITBOX) to move the insertion point to the next line.  This does not cause the default button action (see DIALOGADDPUSHBUTTON).

Style combination example

OK! | Percent! | NoFrame!

Explanation: Creates a modal dialog box without a frame, and positions it in the center of the screen.

Caption: string

The text displayed in the caption (title) bar.

See Also

DIALOGDESTROY

DIALOGDISMISS

DIALOGSHOW


DIALOGDESTROY

Purpose

Removes an old-style dialog box from memory.

Syntax

DIALOGDESTROY (Dialog)

Parameters

Dialog: string

The name or number of a dialog box to destroy (see DIALOGDEFINE).

See Also

DIALOGDEFINE

DIALOGDISMISS

DIALOGSHOW


DIALOGDISMISS

Purpose

Hides a dialog box.  Use DIALOGSHOW to display a hidden dialog box.

Syntax

DIALOGDISMISS (Dialog; Control)

Parameters

Dialog: string

The name or number of the dialog box to hide (see DIALOGSHOW).

Control: string

OKBttn or 1 for OK, CancelBttn or 2 for Cancel, or the control value of a user-defined push button or hot spot.  CancelBttn cancels value assignments to control return variables.  For example, an edit control does not return the text entered in the edit box.  The value of Control is returned in MacroDialogResult as OKBttn, CancelBttn, or the control value of another push button or hot spot.

See Also

MacroDialogResult


DIALOGDISPLAY

Purpose

Displays a dialog box (backward compatibility only).  Use DIALOGSHOW.


DIALOGHANDLE

Purpose

Returns the handle of a dialog box or dialog box control.

Syntax

DIALOGHANDLE (MacroVar; Dialog; Control)

Return Value

The handle of a dialog box or dialog box control (see MacroVar parameter).

Parameters

MacroVar: variable

The handle of a dialog box or dialog box control is returned in this variable (see Dialog and Control parameters).

Dialog: string

The name or number of a dialog box (see DIALOGDEFINE).

Control: string (optional)

The name or number of a dialog box control (see Control parameter of any dialog control).  If you omit this parameter, the handle of the dialog box is returned in MacroVar.

See Also

DIALOGADDCONTROL

DIALOGDEFINE


DIALOGSHOW

Purpose

Displays a dialog box, and, optionally, identifies a callback function.  Use DIALOGDISMISS to hide a dialog box.

A callback function enables a macro to respond immediately and in specific ways to events such as selecting a radio button or check box, without waiting until the dialog box is dismissed.  Without a callback function, user input is acted upon only after the dialog box is dismissed and the macro resumes execution.

To create a callback function, use the Label parameter of DIALOGSHOW, and a loop statement after DIALOGSHOW.  For example,

DIALOGSHOW(1000; "WordPerfect"; Msgs)

WHILE(x = 0)

ENDWHILE

LABEL(Msgs)

... other statements ...

RETURN

The value of the control that dismisses a dialog box is returned in an implicit variable named MacroDialogResult: 1 for OK, 2 for Cancel, 2 for Close (system menu box), 2 if you double-click the system menu box, 2 if you press Alt+F4, or the value of the Control parameter of a user-defined push button or hot spot (see DIALOGADDPUSHBUTTON, DIALOGADDHOTSPOT).

If DIALOGSHOW is used with DIALOG commands, such as DIALOGDEFINE and DIALGOADDEDITBOX (old-style dialog box), the first control that can return a value has the input focus.

Syntax

DIALOGSHOW (Dialog; Parent; Label)

Parameters

Dialog: string

The name of a dialog box to display (see DIALOGDEFINE for old-style dialog boxes).

Parent: string

The name of the parent window, such as "WordPerfect" for WordPerfect 6.1 for Windows.  The parameter is required by new-style dialog boxes (see WordPerfect 6.1 for Windows, Dialog Editor Help), but optional for old-style dialog boxes.

Label: label (optional)

Identifies a callback function (LABEL to call) when the dialog box becomes active, or the user

-Chooses Close from the system menu.

-Presses Alt+F4.

-Double-clicks the system menu box.

-Chooses a push button, radio button, check box, hot spot, or scroll bar control.

The Windows messages are:

-WM_ACTIVATE

-WM_COMMAND

-WM_HSCROLL

-WM_SYSCOMMAND

-WM_VSCROLL

An array is automatically created for callback functions that contains Windows message information.  The array is given the same name as the Label parameter.

If Label is named DoItNow, array elements are defined as DoItNow[1], DoItNow[2], DoItNow[3], and so forth.  The element values are:

[1]	CallbackType  Dialog box (type 3).

[2]	Dialog  Name (character string) or number that matches the Dialog parameter of the dialog box that contains the callback function.

[3]	Control  Name (character string) or number that matches the Control parameter of the control that causes the callback function to be called.  The value is "OKBttn" if OK is pressed; or, "CancelBttn" if Cancel is pressed.

[4]	DialogHandle  Handle of the dialog box that starts the callback function.

[5]	Message  The Windows message received from the dialog box.  The values are:

6  The dialog box becomes active (WM_ACTIVATE).

273  The user chooses a window control, such as a hot spot, push button, or radio button (WM_COMMAND).

276  The user clicks a scroll bar (WM_HSCROLL).

274  The user chooses Close from the system menu, presses Alt+F4, or double-clicks the system menu box (WM_SYSCOMMAND).

277  The user clicks a scroll bar (WM_VSCROLL).

[6]	wParam  Contains a WORD (16-bit unsigned integer) value that is passed with Message.  For example, if element 5 equals 273 (WM_COMMAND), the value of element 6 is 1 if you choose OK, or 2 if you choose Cancel.  If element 5 equals 274 (WM_SYSCOMMAND), the value of element 6 is 61536 if you choose Close from the system menu, press Alt+F4, or double-click the system menu box.

[7]	lParam  Contains a DWORD (32-bit unsigned integer) value that is passed with Message.  This value contains a high-order value and a low-order value, which you calculate with bitwise operators.  The low-order value equals x := x & 65535 (mask hi-order value).  The high-order value equals x := x >> 16 (shift right 16 bits).

Elements 6 (wParam) and 7 (lParam) have different meanings for every Windows message.  See specified messages in Programmer's Reference, Volume 3: Messages, Structures, and Macros (Windows 3.1 documentation) for more information.

See Also

MacroDialogResult


DIALOGUNDISPLAY

Purpose

Hides a dialog box (backward compatibility only).  Use DIALOGDISMISS.


DIMENSIONS

Purpose

Returns dimension information about an array variable.

Syntax

numeric DIMENSIONS (VariableName: variable; IndexNumber: numeric)

Return Value

numeric Number of array dimensions, total number of array elements, number of array elements in a single dimension, or 0 if the index number is out of range (see IndexNumber parameter).

Parameters

VariableName: variable

Array variable.

IndexNumber: numeric (optional)

If not specified, the number of array dimensions is returned. Use 0 to return the total number of array elements.  Use a dimension number to return the number of elements in that dimension.  Given the following declaration,

DECLARE array[4; 2; 5]

DIMENSION returns the following values:

3	DIMENSION(array[]) // number of dimensions

40	DIMENSION(array[]; 0) // total elements

4	DIMENSION(array[]; 1) // elements in dimension 1

2	DIMENSION(array[]; 2) // elements in dimension 2

5	DIMENSION(array[]; 3) // elements in dimension 3

0	DIMENSION(array[]; 4) // out of range

0	DIMENSION(c) // not an array

0	DIMENSION(b[]) // doesn't exist


DISCARD

Purpose

Removes LOCAL, GLOBAL, and PERSIST variables from memory, in that order.

DISCARD does not specify a variable table.  If a variable by the same name exists in all three tables, call DISCARD three times.

WHILE(EXISTS(VariableName))

    DISCARD(VariableName)

ENDWHILE

Syntax

DISCARD (VariableName; VariableName; ... VariableName)

Parameters

VariableName: variable

Begins with a letter and can include any other combination of letters or numbers.  Separate multiple variables with a semicolon.

See Also

EXISTS

GLOBAL

LOCAL

PERSIST

PERSISTALL


DLLCALL

Purpose

Calls a function in a Dynamic Link Library (DLL).

     	Do not use this command unless you are familiar with Windows programming.  Incorrect DLL calls can damage files and/or reset your computer.

Syntax

DLLCALL (ModuleInstance; FunctionName; ReturnVariable; ReturnType; {Parameter; Parameter; ...})

ModuleInstance: numeric

A DLL handle.  DLLLOAD returns the handle in a variable.

FunctionName: string

A function name.  See DLL documentation for function names.

ReturnVariable: variable

The DLL function may return a value in this variable.  The ReturnType parameter defines the expected data type.

ReturnType: enum

The data type to return (see ReturnVariable parameter).

Data Type	Description

WPString	WordPerfect 6.0 wordstring

AnsiString	Windows type LPSTR

OemString	Windows type LPSTR

String	Windows type LPSTR

Bool	Windows type BOOL

DWord	Windows type DWORD

Integer	Windows type LONG

Word	Windows type WORD

Real	Microsoft C type double

Void	Nothing

ReturnType must match the data type returned in ReturnVariable (see DLL function documentation for return types).  If it does not, an Unrecoverable Application Errror or system crash may result.

Parameter: any

Parameter information passed to a DLL function, enclosed in braces and separated by a semicolon.  The type of information depends on the function being called (see DLL function documentation for parameter values to pass).  Use LOWORD specifier to pass byte data.

Data Types	Description

Integer	LONG or DWORD

String	FAR pointer to an ANSI string

Boolean	BOOL

Real	Microsoft c-type double

ANSISTRING(string)	FAR pointer to an ANSI string

OEMSTRING(string)	FAR pointer to an OEM string

WPString(string)	FAR pointer to a WP 6.0 word string

LOWORD(Integer)	int, short, or WORD (low order bits passed to DLL function)

HIWORD(Integer)	int, short, or WORD (high order bits passed to DLL function)

ADDRESS(Integer)	LPDWORD

ADDRESS(WORD(Integer))

ADDRESS(DWORD(Integer))

ADDRESS(Boolean)	BOOL FAR*

ADDRESS(BOOLEAN(Boolean))	BOOL FAR*

ADDRESS(string)	FAR pointer to an ANSI string

ADDRESS(ANSISTRING(string))	FAR pointer to an ANSI string

ADDRESS(OEMSTRING(string))	FAR pointer to OEM string

ADDRESS(WPSTRING(string))	FAR pointer to a WP 6.0 word string.

ADDRESS(Real)	FAR pointer to a MicroSoft C-type double

ADDRESS(REAL(Real))	FAR pointer to a MicroSoft C-type double

See Also

DLLFREE

DLLLOAD


DLLCALL PROTOTYPE

Purpose

Defines the calling format of a DLL routine (see example).

DLLCALL PROTOTYPE accepts only literal strings (no expressions), and must occur before calling a DLL function.  The DLL library is loaded and freed each time the DLL function is called.

DLLCALL PROTOTYPE makes a macro easier to read, and provides safer DLL calls (routines can only be called as defined).

     	Do not use this command unless you are familiar with Windows programming.  Incorrect DLL calls can damage files and/or reset your computer.

Syntax

DLLCALL PROTOTYPE Name (ModuleFileName; FunctionName; ReturnType; {Parameter; Parameter; ...})

Parameters

Name: string

The name used to call the DLL function.

ModuleFileName: string

DLL library file containing the DLL function.

FunctionName: string

A function name.  See DLL documentation for function names.

ReturnType: enum

The data type returned by the DLL function.  See DLLCALL.

AnsiString!

Bool!

DWord!

Integer!

OemString!

Real!

String!

Word!

Void!

Parameter: any

Parameter information passed to a DLL function, enclosed in braces and separated by a semicolon.  The type of information depends on the function being called (see DLL function documentation for parameter values to pass).  See DLLCALL.

See Also

DLLFREE

DLLLOAD


DLLFREE

Purpose

Removes a dynamic link library (DLL) from memory.

     	If you use DLL commands incorrectly, they can damage files and/or reset your computer.

Syntax

DLLFREE (ModuleInstance)

Parameters

ModuleInstance: numeric

A DLL handle.  DLLLOAD returns the handle in a variable.

See Also

DLLCALL

DLLLOAD


DLLLOAD

Purpose

Loads a dynamic link library (DLL) into memory.

You should respond to error values with code similar to the following (see ModuleInstance parameter):

DLLLOAD(vResult; Filename)

SWITCH(vResult)

    CASEOF 0: ...statement block...

    CASEOF 2: ...statement block...

ENDSWITCH

     	If you use DLL commands incorrectly, they can damage files and/or reset your computer.

Syntax

DLLLOAD (ModuleInstance; Filename)

Parameters

ModuleInstance: numeric

A DLL handle if the DLL successfully loads, or an error value less than 32 if not.  Partial list of error values:

0	Not enough system memory.

2	File not found.

3	Path not found.

10	Incorrect Windows version.

20	DLL is invalid.

See LoadLibrary function in Programmer's Reference, Volume 2: Functions (Windows 3.1 documentation) for the complete list of error values.

Filename: string

A DLL path and filename.

See Also

DLLCALL

DLLFREE


DOESDIRECTORYEXIST

Purpose

Returns True if a directory exists, False if not.

Syntax

boolean DOESDIRECTORYEXIST (DirectoryName: string)

Return Value

boolean True/False.

Parameters

DirectoryName: string

Include full path.

See Also

CREATEDIRECTORY

DELETEDIRECTORY

GETCURRENTDIRECTORY

RENAMEDIRECTORY

SETCURRENTDIRECTORY


DOESFILEEXIST

Purpose

Returns True if a file exists, False if not.

Syntax

boolean DOESFILEEXIST (Filename: string)

Return Value

boolean True/False.

Parameters

Filename: string

Include full path.

See Also

COPYFILE

DELETEFILE

RENAMEFILE


ENDAPP

Purpose

Identifies, for the compiler, an application that is no longer used in a macro (see APPLICATION).

ENDAPP is a non-executable statement that can occur anywhere in a macro.  After ENDAPP, a product command to the application specified by ENDAPP creates a compile-time syntax error.

Syntax

ENDAPP (ProductPrefix)

Parameters

ProductPrefix: string

A unique identifier that matches the ProductPrefix parameter of an APPLICATION statement.

See Also

APPLICATION

NEWDEFAULT


ERROR

Purpose

Determines how a macro responds to an Error condition.

Create an Error condition with ASSERT(ErrorCondition!).

Syntax

ERROR (State)

Parameters

State: enum

Specifies the Error state.  The default is ERROR(On!).

Off!	Overrides an Error condition.

On!	Stop a macro unless preceded by ONERROR, which directs macro execution to a specified LABEL.

See Also

ASSERT

CANCEL

LABEL

NOTFOUND

ONERROR


EXISTS

Purpose

Determines if a variable exists.

To exist, a variable must be declared and initialized.  Given that variable w is declared and not initialized, and that LOCAL x is initialized to 5, GLOBAL y to 10, and PERSIST z to 15, the following statements are valid:

vNoInit := EXISTS(w)

Result: vNoInit equals 0

vLocal := EXISTS(x)

Result: vLocal equals 1

vGlobal := EXISTS(y)

Result: vGlobal equals 2

vPersist := EXISTS(z)

Result: vPersist = 3

Examples in shorthand notation

IF(EXISTS(vLocal))

BEEP

ENDIF

Explanation: Computer beeps because EXISTS returns a value greater than 0.

IF(EXISTS(vLocal) = 3)

BEEP

ENDIF

Explanation: The computer does not beep because EXISTS returns 1.  (vLocal is a Local variable, not a Persist variable).

Syntax

ReturnValue := EXISTS (VariableName)

Return Value

An integer.  The values are:

0	Does not exist

1	Local variable

2	Global variable

3	Persist variable

Parameters

VariableName: variable

A variable declared as LOCAL, GLOBAL, or PERSIST.  Variables begin with a letter and can include any other combination of letters or numbers.

See Also

DISCARD

LOCAL

GLOBAL

PERSIST

PERSISTALL


FILEERROR

Purpose

Returns the error associated with the last file command.

Syntax

numeric FILEERROR ()

Return Value

numeric A number greater than 0 (last file error), -1 (unknown error), or 0 (no error).  Error numbers have loword and hiword values.  The loword contains an error code generated by WordPerfect's I/O routines, described in the WordPerfect for Windows SDK (WERROR.H file).  The hiword contains a Windows specific error value, described in the Microsoft SDK, volume 3 (page 344).

See Also

CLOSEFILE

FILEISEOF

FILEPOSITION

FILEREAD

FILESIZE

FILETRUNCATE

FILEWRITE

OPENFILE


FILEFIND

Purpose

Finds a file that matches user-defined search criteria (filename and DOS attributes).

Syntax

string FILEFIND (Filename: string; Attributes: enum; Context: numeric)

Return Value

string Filename, or an empty filename if no match is found.

Parameters

Filename: string

Include full path.  Wild card specification is optional.  Example: "*.WPD".

Attributes: enum (optional)

Normal!

ReadOnly!

Hidden!

System!

Label!

Directory!

Archived!

Default: Normal!.

Context: numeric (optional)

User-defined number which identifies the search.  If not specified, 0 is used.  To find the next file to match the search criteria, call FILEFIND with an empty filename.  For example,

vFilename = FILEFIND (Filename: "*.WPD"; Attributes: Normal!; Context: 1)

finds the first occurrence of a file with a WPD extension.  The following statement finds the next file to match the same search criteria:

vFilename = FILEFIND (Filename: ""; Context: 1)

Use different Context values to perform multiple searches simultaneously.  If you perform more than one search before the macro ends, you can repeat any search by using the appropriate Context value.  The subsequent search begins where it left off.

See Also

COPYFILE

DELETEFILE

DOESFILEEXIST

FILESIZE

RENAMEFILE


FILEISEOF

Purpose

Returns True if the insertion point is at the end of a file, or False if not.  The access mode must be Read! (see OPENFILE).

Syntax

boolean FILEISEOF (FileID: numeric)

Return Value

boolean True/False.

Parameters

FileID: numeric

See OPENFILE.

See Also

CLOSEFILE

FILEERROR

FILEPOSITION

FILEREAD

FILESIZE

FILETRUNCATE

FILEWRITE


FILEPOSITION

Purpose

Returns the current marker position or sets a new position.

A user can preallocate file size by setting the position marker past the end-of-file marker.

Syntax

numeric FILEPOSITION (FileID: numeric; NewPosition: numeric; PositionFrom: enum)

Return Value

numeric Position of old position marker, or negative number if error occurs.

Parameters

FileID: numeric

See OPENFILE.

NewPosition: numeric (optional)

Number of bytes to move position marker.

PositionFrom: enum (optional)

Move position marker relative to one of the following positions.  If not specified, then position is relative to the start of the file.

FromBeginning!

FromCurrentPosition!

FromEnd!

See Also

CLOSEFILE

FILEERROR

FILEISEOF

FILEREAD

FILESIZE

FILETRUNCATE

FILEWRITE


FILEREAD

Purpose

Reads text data from an open file.

Syntax

numeric FILEREAD (FileID: numeric; Data: variable)

Return Value

numeric Number of bytes read, or negative number if error occurs.

Parameters

FileID: numeric

See OPENFILE.

Data: variable

Starting from the position marker, one line of data is converted to a WP character string and returned in this variable.

See Also

CLOSEFILE

FILEERROR

FILEISEOF

FILEPOSITION

FILESIZE

FILETRUNCATE

FILEWRITE


FILESIZE

Purpose

Returns a file's size in bytes.

Syntax

numeric FILESIZE (Filename: string)

Return Value

numeric File size in bytes, or negative number if error occurs.

Parameters

Filename: string

Include full path.

See Also

COPYFILE

DELETEFILE

DOESFILEEXIST

FILEFIND

RENAMEFILE


FILETRUNCATE

Purpose

Removes all text data after the position marker (see FILEPOSITION).

Syntax

numeric FILETRUNCATE (FileID: numeric)

Return Value

numeric Truncated file size (bytes) if successful, or negative number if error occurs.

Parameters

FileID: numeric

See OPENFILE.

See Also

CLOSEFILE

FILEERROR

FILEISEOF

FILEREAD

FILESIZE

FILEWRITE


FILEWRITE

Purpose

Writes text data to a file.

Syntax

numeric FILEWRITE (FileID: numeric; Data: string; NewLine: enum; ParameterData: string)

Return Value

numeric Number of bytes written, or a negative number if error occurs.

Parameters

FileID: numeric

See OPENFILE.

Data: string

Text data is converted to the type specified when the file is opened.  A caret (^) followed by a number is replaced by the corresponding character string in the ParameterData parameter.  To write a caret, use two carets (^^).

NewLine: enum

NoNewLine!

NewLine!

Default: NewLine! (inserts an end-of-line marker).

ParameterData: string

Text data inserted in the data string (see Data parameter).  Up to ten strings separated by semicolons are allowed.  Numbering begins with 0.  For example,

FILEWRITE (FileID; Data: "My friend ^0 is ^1 years old."; NewLine: NewLine!; ParameterData: {"Dan"; "41"})

writes "My friend Dan is 41 years old." followed by an end-of-line marker.

See Also

CLOSEFILE

FILEERROR

FILEISEOF

FILEPOSITION

FILEREAD

FILESIZE

FILETRUNCATE


FOR-ENDFOR

Purpose

A loop statement that executes a specified number of times (see Using Loop Statements).

The loop executes only if TerminateExp is true, and continues to execute until ControlVariable's value makes TerminateExp false.

ENDFOR closes a FOR statement.

Syntax

The general form of a FOR statement is,

FOR (ControlVariable; InitialValue; TerminateExp; IncrementExp)

...statement block...

ENDFOR

For example, the following statement initializes vTest to one, repeats the statement block while vTest is less than ten, and increments vTest by two after each loop.

FOR(vTest; 1; vTest < 10; vTest + 2)

...statement block...

ENDFOR

Parameters

ControlVariable: variable

Control variable.

InitialValue: any

Value assigned to ControlVariable at the start of a loop.

TerminateExp: boolean

The loop executes while TerminateExp is true.

IncrementExp: any

The value to increment ControlVariable after each loop.

See Also

FOREACH

FORNEXT

REPEAT

WHILE


FOREACH-ENDFOR

Purpose

A loop statement that executes a number of times equal to the number of specified expressions (see Using Loop Statements).

ControlVariable is assigned the first value before the first loop; the second value before the second loop; the third value before the third loop, and so forth.  The statement block uses the value of ControlVariable to direct macro execution.

ENDFOR closes a FOREACH statement.

Syntax

The general form of a FOREACH statement is,

FOREACH (ControlVariable; {ValueList; ...})

...statement block...

ENDFOR

For example, the following statement repeats three times.  The variable vTest is initialized to "Apples" before the first loop, to "Oranges" before the second, and to "Bananas" before the third.

FOREACH(vTest; {"Apples"; "Oranges"; "Bananas"})

... statement block ...

ENDFOR

Parameters

ControlVariable: variable

Control variable.

ValueList: any

Variables, constants, or expressions, enclosed in braces and separated by a semicolon.

See Also

FOR

FORNEXT

REPEAT

WHILE


FORNEXT-ENDFOR

Purpose

A loop statement that executes a specified number of times (see Using Loop Statements).

The loop executes if ControlVariable is less than or equal to FinalValue, and executes until ControlVariable is greater than FinalValue.  If you use a negative value in IncrementValue, the loop executes until ControlVariable is less than FinalValue.

ENDFOR closes a FORNEXT statement.

Syntax

The general form of a FORNEXT statement is,

FORNEXT (ControlVariable; InitialValue; FinalValue; IncrementValue)

...statement block...

ENDFOR

The following statement initializes vTest to one, repeats the statement block while vTest is less than or equal to five, and increments vTest by two after each loop.

FORNEXT(vTest; 1; 5; 2)

...statement block...

ENDFOR

Parameters

ControlVariable: variable

Control variable.

InitialValue: any

The value assigned to ControlVariable at the start of a loop.

FinalValue: any

A variable, constant, or expression.  The loop executes while FinalValue is greater than ControlVariable, or less than if IncrementValue is a negative value.

IncrementValue: any (optional)

The value to increment ControlVariable after each loop.  Default is 1.

See Also

FOR

FOREACH

REPEAT

WHILE


FRACTION

Purpose

Returns the fractional portion of a real number.

Syntax

ReturnValue := FRACTION (Value)

Return Value

A fraction.

vFraction := FRACTION(1.5)

Result: vFraction equals 0.5

vResult := FRACTION(1.77 * 2)

Result: vResult = 0.54Parameters

Value: numeric

A real number.

See Also

INTEGER


FUNCTION

FUNCTION-ENDFUNC

Purpose

Identifies a macro subroutine that can receive one or more values from a calling statement (see Using Calling Statements).  FUNCTION also returns a value to the calling statement (caller).

Functions contain one or more statements that execute when the function is called.  Unlike LABEL statements, functions do not execute unless called.  A calling statement consists of the function's name, and can have one or more parameters that pass values to the function.  RETURN, ENDFUNC, or ENDFUNCTION direct macro execution to the statement that follows the function's caller.  RETURN also returns the result of a function operation, or 0 if no result is specified.  For example,

y := 5

x := Add(y) // calling statement

FUNCTION Add(z)

z := z + 5

RETURN(z)

ENDFUNC

assigns the value 10 to variable x.   Add is the name of the function, and y contains a value to pass.  Variable z has no value until the function is called, when the value of z is 5 (the value of variable y).  The first function statement assigns 10 to variable z.  The next statement returns the value of z to the calling statement, which is then assigned to variable x.  If the function did not contain a RETURN statement, or if RETURN did not return a value, x would be equal to 0.

Address Mode

In the above example, the value of y does not change.  The function returns the value of z in variable x.  To change the value of a variable passed to a function, precede the calling statement parameter and its corresponding function parameter with an ampersand (&).  For example,

y := 5

x := Add(&y)

FUNCTION Add(&z)

ASSIGN(z; z + 5)

RETURN(z)

ENDFUNC

assigns the value 10 to both x and y.  The ampersand before variable x means the variable's address (location in memory) is passed to the function, not the variable's value.  Changes made at the address of x are made to the contents of x.

Arrays

You pass arrays to functions the same way you pass variables.  If you are passing the entire array, every array element must be assigned a value.  If not, a run-time error identifies a reference to the undefined element.  For example,

DECLARE w[10]

FORNEXT(x; 1; 9; 1) // assign only 9 elements

w[x] = x

ENDFOR

FUNCTION Test(z[])

FORNEXT(x; 1; 10; 1)

x[z] = x * 10

ENDFOR

RETURN(z[]) // the value of 10 elements returned

ENDFUNC

y[] = Test(w[]) // 10 elements returned in array y[]

Type(y[10]) // y[10] equals 100

Type(w[10]) // Run-time error: Undefined variable "W[10]"

In the previous example, if you preceed the calling statement parameter and the corresponding function parameter with an ampersand (&), 100 is returned in w[10].  No run-time error occurs.  You are passing the address of array w[], not its value.  The value is assigned inside the function (see Address Mode above).  The two statements look like this:

FUNCTION Test(&z[])

and

y[] = Test(&w[])

Pass the value of an array element, the same way you pass a variable.  For example,

DECLARE w[10]

FORNEXT(x; 1; 10; 1)

w[x] = x

ENDFOR

FUNCTION Test(z)

z := z * 10

RETURN(z)

ENDFUNC

y = Test(w[1])

Type(y + " - ")

Type(w[1])

The value of y equals 10.  The value of w[1] equals 1.  If you preceed the calling statement parameter and the corresponding function parameter with an ampersand (&), the value of y equals 10 and the value of w[1] equals 10.  Passing the address of w[1] causes its value to change inside the function.  The two statements look like this:

FUNCTION Test(&z)

and

y = Test(&w[1])

Syntax

The general form of a FUNCTION statement is,

FUNCTION Name (Parameter; Parameter; ... Parameter)

    ...statement block...

ENDFUNC

The syntax accepts ENDFUNC or ENDFUNCTION.

Parameters

Name: label

The name of a function.  It begins with a letter and consists of one or more letters or numbers.

Parameter: variable

Receives a value from a calling statement (see Using Calling Statements).  If an ampersand precedes the calling statement variable, an ampersand must precede the corresponding function variable (see Address Mode above).  Multiple variables are separated by a semicolon.

See Also

CALL

LABEL

PROCEDURE

RETURN

USE


FUNCTION PROTOTYPE

Purpose

Verifies the syntax of a FUNCTION statement (see FUNCTION).

If the syntax of a function contained in a USE macro file is incorrect and the function is called from the main macro, you get a run-time error but not a compile-time error (see Macro Errors).  Using FUNCTION PROTOTYPE at the start of a main macro ensures that you get a compile-time error.

Syntax

FUNCTION PROTOTYPE Name (Parameter; Parameter; ... Parameter)

Parameters

Name: label

The name of the function.  It begins with a letter and consists of one or more letters or numbers.

Parameter: variable

Receives a value from a calling statement (see Using Calling Statements).  If an ampersand precedes the calling statement variable, an ampersand must precede the corresponding function variable (see Address Mode under FUNCTION).  Multiple variables are separated by a semicolon.


GETCURRENTDIRECTORY

Purpose

Returns name of current directory.

Syntax

string GETCURRENTDIRECTORY ()

Return Value

string Name of current directory.

See Also

CREATEDIRECTORY

DELETEDIRECTORY

DOESDIRECTORYEXIST

RENAMEDIRECTORY

SETCURRENTDIRECTORY


GETFILEATTRIBUTES

Purpose

Returns DOS file attributes.

Syntax

numeric GETFILEATTRIBUTES (Filename: string)

Return Value

numeric One of the following values, or a negative number if error occurs.

0	Error!

1	ReadOnly!

2	Hidden!

4	System!

8	Label!

16	Directory!

32	Archived!

Archived! file has changed since last save.

Parameters

Filename: string

Include full path.

See Also

SETFILEATTRIBUTES


GETFILEDATEANDTIME

Purpose

Returns a file's creation date and time.

Syntax

numeric GETFILEDATEANDTIME (Filename: string)

Return Value

numeric File date and time (number of seconds since January 1, 1980), or -1 if error occurs.

Parameters

Filename: string

Include full path.

See Also

SETFILEDATEANDTIME


GETNUMBER

Purpose

Displays a dialog box that contains an edit control to enter an integer or real number.

Syntax

GETNUMBER (MacroVar; Prompt; Title)

Parameters

MacroVar: variable

The number entered in the edit box is returned in this variable.

Prompt: string (optional)

Text displayed above the edit control.  Use NTOC(0F90Ah) to insert a hard return code in the prompt string.  For example,

GETNUMBER(vAns; "First line" + NTOC(0F90Ah) + "Second line"; "Title")

creates two lines above the edit box.  The next example creates three lines, including one blank line:

ASSIGN(HdReturn; NTOC(0F90Ah))

GETNUMBER(vAns; "First line" + HdReturn + HdReturn + "Second line"; "Title")

Title: string (optional)

Text displayed in the title bar.

See Also

GETSTRING

GETUNITS


GETSTRING

Purpose

Displays a dialog box that contains an edit control to enter a character string.

Syntax

GETSTRING (MacroVar; Prompt; Title; Length)

Parameters

MacroVar: variable

The character string entered in the edit box is returned in this variable.

Prompt: string (optional)

The text displayed above the edit control.  Use NTOC(0F90Ah) to insert a hard return code in the prompt string.  For example,

GETSTRING(vAns; "First line" + NTOC(0F90Ah) + "Second line"; "Title")

creates two lines above the edit box.  The next example creates three lines, including one blank line:

ASSIGN(HdReturn; NTOC(0F90Ah))

GETSTRING(vAns; "First line" + HdReturn + HdReturn + "Second line"; "Title")

Title: string (optional)

The text displayed in the title bar.

Length: numeric (optional)

The maximum number of characters the edit control accepts.  Default is unlimited.

See Also

GETNUMBER

GETUNITS


GETUNITS

Purpose

Displays a dialog box that contains an edit control to enter a number and unit of measure.

The units of measure are " (inches); i (inches); c (centimeters); m (millimeters); p (points—72 per inch); and w (WordPerfect units—1200 per inch).  If a unit of measure is not specified, the default is WordPerfect units.  To change the default use DEFAULTUNITS.

Syntax

GETUNITS (MacroVar; Prompt; Title)

Parameters

MacroVar: variable

The number and unit of measure entered in the edit box is returned in this variable.  If no unit of measure is specified, the default is returned.

Prompt: string (optional)

The text displayed above the edit control.  Use NTOC(0F90Ah) to insert a hard return code in the prompt string.  For example,

GETUNITS(vAns; "First line" + NTOC(0F90Ah) + "Second line"; "Title")

creates two lines above the edit box.  The next example creates three lines, including one blank line:

ASSIGN(HdReturn; NTOC(0F90Ah))

GETUNITS(vAns; "First line" + HdReturn + HdReturn + "Second line"; "Title")

Title: string (optional)

The text displayed in the title bar.

See Also

DEFAULTUNITS

GETNUMBER

GETSTRING

UNITSTR


GLOBAL

Purpose

Declares global variables and arrays, and assigns them to the global variable table.

Global variables can be used in RUN or CHAIN macros.

Syntax

GLOBAL (VariableName; VariableName; ... VariableName)

Parameters

VariableName: variable

One or more user-defined variables separated by a semicolon.  Variables must begin with a letter and can include any other combination of letters or numbers.  Parentheses are optional.  For example,

GLOBAL VariableName; VariableName

GLOBAL(VariableName; VariableName)

are both valid statements.  The following example declares global arrays with 10 elements and 20 elements,

GLOBAL FirstArray[10]; NextArray[20]

The last example simultaneously declares a variable and assigns a value:

GLOBAL x := 2

or...

GLOBAL x

x := 2

If you create two variables with the same name (for example, GLOBAL x and PERSIST x), the following statement

GLOBAL x := 5

specifies which variable x is assigned the value 5.

See Also

CHAIN

DECLARE

DISCARD

EXISTS

LOCAL

PERSIST

PERSISTALL

RUN


GO

Purpose

Jumps to a LABEL statement and does not return.

Go is generally used to exit multiple layers of nested statements, or to create a loop.

Syntax

Go (label)

Parameters

Label: label

The name of a label.  It begins with a letter and consists of one or more letters or numbers.

See Also

CALL

INDIRECT

LABEL


IF-ELSE-ENDIF

Purpose

A conditional statement that determines whether a statement (or statement block) is executed.  See Using Condtional Statements.

If Test is true, the statements between IF and ELSE are executed.  If false, the statements between ELSE and ENDIF are executed.

ELSE is optional.  If Test is false and ELSE is not used, the macro skips the statements between IF and ENDIF, and executes the first statement after ENDIF.

ENDIF closes an IF statement.

Syntax

The general form of an IF statement is,

IF (Test)

...statement block...

ELSE

...statement block...

ENDIF

Parameters

Test: boolean

Evaluates to true or false.

See Also

CASE

CASE CALL

SWITCH


IFPLATFORM-ENDIFPLATFORM

Purpose

A conditional statement that specifies a platform or platforms for which subsequent statements are compiled.

If the current platform matches one of the specified platforms, the statements between IFPLATFORM and ENDIFPLATFORM are compiled and executed.

ENDIFPLATFORM closes an IFPLATFORM statement.

Syntax

The general form of an IFPLATFORM statement is,

IFPLATFORM (PlatformID; PlatformID; ... PlatformID)

...statement block...

ENDIFPLATFORM

Parameters

PlatformID: enum

One or more platform identifiers.  Separate multiple platforms with a semicolon.  The identifiers for DOS and Windows are DOS and WIN.  See platform documentation for other identifiers.


INCLUDE

Purpose

Specifies a macro file with executable statements, functions, and/or procedures.  The functions and procedures can be called from another macro (see Macro File Libraries).

INCLUDE is a non-executable statement that can occur anywhere in a macro.  INCLUDE macros are automatically compiles when the parent macro compiles.  All statements in an INCLUDE macro are executed before macro execution returns to the parent macro.  RETURN or QUIT statements in an INCLUDE macro end all macro execution.

Syntax

INCLUDE (FileName)

Parameters

FileName: string

The path and name of a macro file.  You cannot substitute string with a variable.

See Also

USE

FUNCTION

PROCEDURE


INDIRECT

Purpose

Creates variable and label names out of a combination of character strings and/or numbers.

You can use INDIRECT wherever you use a variable.  The actual variable must be declared and initialized before INDIRECT.  You can use INDIRECT to call a LABEL, but not to create one.

State1 := "Utah"

x := INDIRECT("State" + 1) // x equals Utah

Variable example in shorthand notation

State1 := "Utah"

State2 := "Idaho"

State3 := "Arizona"

FORNEXT(Nmbr; 1; 3; 1)

    Type("State of " + INDIRECT("State" + Nmbr))

    HardReturn

ENDFOR

Explanation: Types three lines, State of Utah, State of Idaho, and State of Arizona.

LABEL example

FORNEXT(x; 1; 3; 1)

CALL(INDIRECT("Lab" + x))

ENDFOR

QUIT

LABEL(Lab1)

...statement block...

RETURN

LABEL(Lab2)

...statement block...

RETURN

LABEL(Lab3)

...statement block...

RETURN

Explanation: Call three Labels with a single CALL statement in a FORNEXT loop.

Syntax

ReturnValue := INDIRECT (VariableName)

Return Value

The contents of VariableName.

Parameters

VariableName: string

Character strings and/or numbers are concatenated to form variable and Label names.  You cannot use INDIRECT to create a subroutine name.

See Also

ASSIGN


INTEGER

Purpose

Returns the integer portion of a real number.

If Value does not contain an integer, 0 is returned.  A negative real number is rounded up to the next integer value, and a positive real number is rounded down.

The following metasymbols specify a key or keystring in COACHFILTERADD and COACHANIMATE.

{VKnnn}	//  nnn = ANSI character number

{Alt}

{Ctrl}

{Control}

{Shift}

{0}...{9}	// Digits

{A}...{Z}	// Alphabet

{F1}...{F16}	// Function keys

{NumLock}

{NumAdd}

{NumSubtract}

{NumMultiply}

{NumDivide}

{NumDecimal}

{NumEnter}

{Num0}...{Num9}	// Numpad numbers

{Left}

{Right}

{Up}

{Dn}

{Down}

{PgDn}

{PageDown}

{PgUp}

{PageUp}

{Bksp}

{Backspace}

{Break}	// Cancel

{CapsLock}

{Clear}

{Del}

{Delete}

{End}

{Enter}

{Esc}

{Escape}

{Help}	// VK Help key

{Home}

{Ins}

{Insert}

{Minus}

{Pause}

{ScrLock}

{ScrollLock}

{PrintScrn}

{PrintScreen}

{Space}

{Tab}

{LeftBrace}	//  "{"

{RightBrace}	//  "}"

{LeftButton}	// Mouse clicks

{MiddleButton}

{RightButton}

Metasymbols are translated into keydown messages (WM_KEYDOWN or WM_SYSKEYDOWN) and keyup messages (WM_KEYUP or WM_SYSKEYUP).

Metasymbols are not case-sensitive.  Spaces, plus (+) and minus (—) symbols are delimiters.  For example, "A B C Enter" in COACHANIMATE sends "ABC[Enter]" to the application.  A filter that specifies this keystring waits for the user to press "ABC[Enter]".

Plus (+) and minus (—) operators combine metasymbols.  The + delays the keyup message of the first keystroke until the second keystroke is processed.  For example, {Shift + Tab} presses and holds Shift while Tab is pressed and released.  The Shift key is then released.

If a metasymbol does not follow +, then keys previously combined with + remain down until released.  For example, {Shift+Control+} leaves Shift and Control down.

The — releases keys.  For example, {—Control—Shift} releases Control, then Shift.

The + and — can be combined.  For example, {Shift+Del—Del+Ins} cuts selected text to the Clipboard (Shift+Del), then pastes it at the insertion point (Shift+Ins).

{Home Shift+End}{Control+B End}{Enter}{Alt+F O} *.doc {Enter}{Escape}{Ctrl+Home}{Shift+}{Ctrl+End Del}{—Shift}

Result:

1	Move to the beginning of the line and select the entire line.

2 	Bold the line and move to the end of the line (cancelling the selection).

3	Create a new line.

4	Call the File Open dialog, list all *.DOC files, and then exit the dialog.

5	Go to the top of the document.

6	Hold down Shift.

7	Go to the end of the text and copy the selection to the Clipboard.

8	Release Shift.

Syntax

ReturnValue := INTEGER (Value)

Return Value

An integer.

vInteger := INTEGER(1.5)

Result: vInteger equals 1

vResult := INTEGER(1.77 * 2)

Result: vResult equals 3

vZero := INTEGER(.7)

Result: vZero equals 0

vNegative := INTEGER(-1.77)

Result: vNegative equals -2

Parameters

Value: numeric

A real number.

See Also

FRACTION


KEYSTRING

Purpose

Specifies one or more keystrokes in COACHANIMATE and COACHFILTERADD.  In COACHANIMATE, a keystring specifies keys to press during animation.  In COACHFILTERADD, a keystring specifies keystrokes to filter.


LABEL

Purpose

Identifies a macro subroutine, which generally includes a statement block followed by RETURN or QUIT.  See Using Subroutines.

You can pass a LABEL to a function or procedure.  LABEL must be preceeded by @.  For example,

CALL Macro(@Test)

PROCEDURE Macro(@x)

CALL(x)

ENDPROC

LABEL(Test)

...statements...

RETURN

LABEL is used by CALL, CASE, CASE CALL, GO, ONCANCEL, ONCANCEL CALL, ONERROR, ONERROR CALL, ONNOTFOUND, ONNOTFOUND CALL, ONDDEADVISE CALL, DDEEXECUTEEXT.

Syntax

LABEL (label)

Parameters

Label: label

The name of a label.  It begins with a letter and consists of one or more letters or numbers.

See Also

CALL

CASE

CASE CALL

DDEEXECUTEEXT

GO

ONCANCEL

ONCANCEL CALL

ONDDEADVISE CALL

ONERROR

ONERROR CALL

ONNOTFOUND

ONNOTFOUND CALL


LOCAL

Purpose

Declares local variables and arrays, and assigns them to the local variable table.

Variables are LOCAL by default.  The Local variable table is removed from memory when the macro ends.

Syntax

LOCAL (VariableName; VariableName; ... VariableName)

Parameters

VariableName: variable

One or more user-defined variables separated by a semicolon.  Variables must begin with a letter and can include any other combination of letters or numbers.  Separate multiple variables with a semicolon.  Parentheses are optional.  For example,

LOCAL VariableName; VariableName

LOCAL(VariableName; VariableName)

are both valid statements.  The next example declares local arrays with 10 elements and 20 elements:

LOCAL FirstArray[10]; NextArray[20]

The last example simultaneously declares a variable and assigns a value:

LOCAL x := 2

or...

LOCAL x

x := 2

If you create two variables with the same name (for example, GLOBAL x and LOCAL x), the following statement

LOCAL x := 5

specifies which variable x is assigned the value 5.

See Also

DECLARE

DISCARD

EXISTS

GLOBAL

PERSIST

PERSISTALL


MENU

Purpose

Displays a menu of user-defined items.

MENU is used with statements such as CASE, CASE CALL, and IF to execute a statement that corresponds to a selected menu item.  To dismiss a menu, press Alt or Esc.

Syntax

MENU (MacroVar; MenuType; HorizPosition; VertiPosition; {MenuText; MenuText; ...})

Parameters

MacroVar: variable

A number is returned in this variable, whether numbers or letters are used to reference menu items (see MenuType parameter).   For numbers, the range is 1 to 9.  For letters, the range is 1 to 26.  A returns 1, B returns 2, and so forth.  0 is returned if Alt or Esc is pressed.

MenuType: enum

Determines whether a letter or number is displayed to the left of a menu item.

Digit!	Numbers (1-9)

Letter!	Alphabetic characters (A-Z)

HorizPosition: numeric (optional)

The number of pixels from the left side of the main window to the left side of the menu.  To center the menu horizontally, leave this parameter blank.

VertiPosition: numeric (optional)

The number of pixels from the top of the main window to the top of the menu.  To center the menu vertically, leave this parameter blank.

MenuText: string

The menu item text.  You may list up to nine menu items referenced by numbers, or up to twenty-six referenced by letters.  Enclose menu items in braces ({}) separated by a semicolon.

MENU(vSelection; Letter!; 50; 50; {"Option 1"; "Option 2"; "Option 3"})

To select an item: click it, select it with Tab and press Enter, or press the corresponding letter or number.

See Also

CASE

CASE CALL

IF


MENULIST

Purpose

Displays a menu of user-defined items.

This command is included for DOS compatibility.  The Windows equivalent is MENU.

MENULIST is used with statements such as CASE, CASE CALL, and IF to execute a statement that corresponds to a selected menu item.  To dismiss a menu, press Alt or Esc.

Syntax

MENULIST (VariableName; {MenuChoice; MenuChoice; ...}; Title; HorizPosition; VertiPosition)

Parameters

VariableName: variable

A number is returned in this variable, whether numbers or letters are used to reference menu items (see MenuChoice parameter).   For numbers, the range is 1 to 9.  For letters, the range is 1 to 26.  A returns 1, B returns 2, and so forth.  0 is returned if Alt or Esc is pressed.

MenuChoice: string

The menu item text, enclosed in braces ({}) and separated by a semicolon.

MENULIST(vSelection; ; ; {"Option 1"; "Option 2"; "Option 3"})

To select an item: click it, select it with Tab and press Enter, or press the corresponding letter or number.  Nine items or less are displayed with a number to the left of the menu item.  More than nine are displayed with a letter.  The range is 1 to 26.

Title: string

The text displayed in the title bar.

See Also

CASE

CASE CALL

IF

MENU


MESSAGEBOX

Purpose

Displays a message box.

Provides a limited set of buttons and icons, and an option to include up to ten different parameter strings in the message.

Syntax

MESSAGEBOX (MacroVar; Title; Message; Style; ParameterData)

Parameters

MacroVar: variable

The control value of the button that dismisses the message box is returned in this variable.  The return button values are:

1	OK

2	Cancel

3	Abort

4	Retry

5	Ignore

6	Yes

7	No

If there is not enough memory to create the message box, 0 is returned.

Title: string

The title bar text.

Message: string

The message box text.  Icons appear to the left of the message.  Control buttons are centered below the message.  If HasParameters! style is used, a caret (^) followed by a number inserts the corresponding ParameterData message in its place (see ParameterData parameter below).  Use two carets (^^) to insert a caret as part of the message string.  Use NTOC(0F90Ah) to insert a hard return code in the message string.  For example,

MESSAGEBOX(vAns; "Title"; "First line" + NTOC(0F90Ah) + "Second line"; IconInformation!)

creates two lines above the control button.  The next example creates three lines, including one blank line:

ASSIGN(HdReturn; NTOC(0F90Ah))

MESSAGEBOX(vAns; "Title"; "First line" + HdReturn + HdReturn + "Second line"; IconInformation!)

Style: enum

Message box styles.  Type | between enumerations to combine styles.  Select only one style from each group.  Button enumerations are:

AbortRetryIgnore!	Abort, Retry, and Ignore

OK!	OK (default if no button is specified)

OKCancel!	OK and Cancel

RetryCancel!	Retry and Cancel

YesNo!	Yes and No

YesNoCancel!	Yes, No, and Cancel

Icon enumerations are:

IconNone!	No icon (default if no icon is specified)

IconExclamation!	Exclamation point in a yellow circle

IconInformation!	Lowercase "i" in a blue circle

IconAsterisk!	Lowercase "i" in a blue circle

IconQuestion!	Question mark in a green circle

IconStop!	Stop sign in a red circle

IconHand!	Stop sign in a red circle

Modality enumerations are:

ApplicationModal!	You can switch to another application, but you must dismiss the message box (click a control button) before the macro resumes.  ApplicationModal! is the default if either SystemModal! or TaskModal! is not specified.

SystemModal!	You must dismiss the message box before the macro resumes, and before you can switch to another application.

TaskModal!	You can switch to another application, but you must dismiss the message box (click a control button) before the macro resumes.

Miscellaneous enumerations are:

Beep!	Beep when the message box is displayed.

HasParameters!	Notifies MessageBox box that a caret (^) followed by a number in the Message parameter is to be replaced by the corresponding character string in the ParameterData parameter.

ParameterData: string

The text for the Message parameter (numbering begins with 0).  Up to ten parameters separated by semicolons are allowed.  For example,

v0 := "Yes to continue, or"

v1 := "No to quit."

MessageBox(x; "Title"; "Select ^0 ^1"; YesNo! | IconStop! | HasParameters!; {v0; v1})

fills the Message parameter with "Select Yes to continue, or No to quit.".  If HasParameters! is not used, Message contains "Select ^0 ^1".

See Also

PROMPT


MMPLAY

Purpose

Plays a sound file.

Plays a wave audio file, an Audio-Visual Interleave (AVI) movie file, or a Musical Instrument Digitial Interface (MIDI) file, or speaks an ASCII text file (see MMSPEAK).  Microsoft Video drivers must be installed to play AVI files.  For WAV files, install Windows Audio drivers.  MIDI files require Windows MIDI drivers.  Speech requires text-to-speech drivers like those shipped with some sound boards.

Syntax

MMPLAY (Filename)

Parameters

Filename: string

The path and name of a sound file.  The appropriate driver for each file type must be installed.

See Also

MMSPEAK

MMSPEAKCLIPBOARD

MMSTOPSPEECH


MMSPEAK

Purpose

Speaks an ASCII file.

Syntax

MMSPEAK (Filename)

Parameters

Filename: string

The path and name of an ASCII file.  A text-to-speech driver must be installed.

See Also

MMPLAY

MMSPEAKCLIPBOARD

MMSTOPSPEECH


MMSPEAKCLIPBOARD

Purpose

Speaks an ASCII file saved to the Clipboard.

A text-to-speech driver must be installed.

Syntax

MMSPEAKCLIPBOARD ()

See Also

MMPLAY

MMSPEAK

MMSTOPSPEECH


MMSTOPSPEECH

Purpose

Stops a speech (text) file started with MMPLAY (ASCII file), MMSPEAK, or MMSPEAKCLIPBOARD.

After a text file begins to speak, control immediately returns to the macro.  Use MMSTOPSPEECH to stop speaking a text file.

Syntax

MMSTOPSPEECH ()

See Also

MMPLAY

MMSPEAK

MMSPEAKCLIPBOARD


MOUSE STRING

Purpose

Represents a mouse event or action.  COACHANIMATE specifies the animated mouse actions. COACHFILTERADD specifies the filtered mouse actions.

Syntax

The syntax for mouse events for COACHANIMATE is:

[Ctrl|Control]  [Shift]  [Alt]

[Left|Middle|Right]

Click|DoubleClick|Press|Release|Move

[To|In|Inside|On NamedRegion]

[At (x,x)|(x,x,x,x)]

"Outside," "OutOf," and "Off" are supported in COACHFILTERADD and "Move" is not supported.

[Ctrl|Control]  [Shift]  [Alt]

[Left|Middle|Right]

Click|DoubleClick|Press|Release

[To|In|Inside|On|Outside|OutOf|Off NamedRegion]

[At (x,x)|(x,x,x,x)]

Arguments are not case-sensitive.  Brackets ([]) enclose optional values.  A vertical bar | separates values when only one can be chosen.  A space separates arguments.

MOUSE STRING Arguments

Keys (optional)  ([Ctrl|Control]  [Shift]  [Alt])

Specifies keys to press with the mouse event, such as holding down Shift and Control when the mouse is clicked.  These values can occur in any order.

Button (optional)  ([Left|Middle|Right])

Indicates whether to use the left, middle, or right button.  Left is the default.

Action (Click|DoubleClick|Press|Release|Move)

Indicates how to click or press the mouse button, or whether to move the mouse pointer.

Argument	Meaning

Click	One click.

DoubleClick	Double-click.

Press	Press and hold button down.

Release	Release button after it is pressed.  Use Press withRelease for drag (use two mouse strings).

Move	Move pointer to specified location.  Valid only in COACHANIMATE.

Relative Location ([To|In|Inside|On|Outside|OutOf|Off])

Specifies a screen position for a mouse event.

Argument	Meaning

To	If the Action argument is Move, To moves the pointer to the named region.  Otherwise, To means In.

In	Mouse action occurs within the specified named region (see Named Region, below).

Inside	Same as In.

On	Same as In.

Outside	Mouse action occurs outside the specified named region.  Supported only in COACHFILTERADD.

OutOf	Same as Outside.  Supported only in COACHFILTERADD.

Off	Same as Outside.  Supported only in COACHFILTERADD.

Named Region ([NamedRegion])

Specifies a window or location where the mouse action occurs.  Required only if a relative location is specified.  For example, you may want to specify a mouse click in the Open button of the Open Dialog.  The named region specifies a name for the Open button.

Named regions are defined by the application.  The region consists of the application name, followed by a period (.), followed by additional words that narrow the named region to the appropriate window.  For example, the named region of the Open button on the Open dialog of WordPerfect is: WordPerfect.FileOpenDlg.Open.

Use the WordPerfect Help system to find a region name.  First edit your BIF file to enable Help Information.  The BIF editor, BIFED20.EXE, should be in the WPC20 directory.

Steps

1	Exit WordPerfect and go to Program Manager.

2	Choose File, Run.

3	In the BIF Edit dialog box, choose File, Open.

4	Select the desired file.

5	Select WP Shared Code.

6	Choose Insert to add a new section.

7	Type Help in the Section Name entry box.

8	Type Help Information in the Item entry box.  The Item Type is Boolean.

9	Select True for the Value.

10	Choose File, then Save.

11	Choose File, then Exit.

12	Start WordPerfect.

Steps

To find a named region:

1	Press Shift+F1.

2	Click the desired menu item or dialog box.

A Help Information screen is displayed.  The Application and Keyword items display the named region.

Help Information for dialog boxes returns application and dialog box names, but not named regions for controls on the dialog.  See the list of dialog box named regions in the Appendix for control named regions.

Buttons are named for the text on them, plus Bttn.  For example, the Help button in the HeadersFooters dialog box is WordPerfect.HeadersFooters.HelpBttn.  Named region names are case-sensitive.

Narrowed Location (optional)  ([At (x,x)|(x,x,x,x)])

Specifies an exact point (x,x), or rectangle (x,x,x,x) where a mouse event occurs.  Point and rectangle positions are relative to the window specified in Named Region.  Pixels are the default unit of measure.  For example, in COACHANIMATE,

Move To WordPerfect.FileOpenDlg.Open At (10,5)

moves the pointer to a point 10 pixels right and 5 pixels down from the upper left corner of the Open button.

You can specify the percentage from the upper left corner of the window by placing a percent sign % after values.  For example,

Move To WordPerfect.FileOpenDlg.Open At (50%, 50%)

moves the pointer to the center of the Open button.

To specify dialog units, place the letter d after values.

Examples

Three mouse string examples follow.  Named regions do not represent actual WordPerfect names.

Shift Right DblClick

Result: Shift is held down while the right mouse button is double-clicked (the mouse pointer may be anywhere on the screen).

Move at (50%, 50%)

Result: This mouse string is invalid in COACHFILTERADD.  When this string is specified in COACHANIMATE, the mouse pointer moves to the center of the display.

Press on WordPerfect.Ruler.Tab1

Release on WordPerfect.EditWindow

Result: These mouse strings must be specified in two consecutive commands.  The first tab setting on the ruler is dragged off the ruler (deleted).


NEST

Purpose

Calls (starts) a nested macro.

This command is included for DOS compatibility.  The Windows equivalent is RUN.

A nested macro starts immediately when called.  When a nested macro ends, the first statement following NEST is executed.  A macro must be compiled before it is called by NEST.

Syntax

NEST (MacroFileName; {Parameter})

Parameters

MacroFileName: string

The path and name of a compiled macro.

Parameter: any (optional)

Enclose multiple parameters in braces ({}), separated by a semicolon.  For example: NEST ("macro"; {"a"; "b"; "c"}).  Parameter values are passed to a special array variable named MacroArgs.

See Also

CHAIN

RUN


NEWDEFAULT

Purpose

Specifies a macro's new default application.

The compiler verifies that each product command is valid for the default application.  Invalid product commands produce a syntax error during compilation.

Product commands to the default application do not require a product prefix.  A product command to a non-default application, without a product prefix, creates a compile-time syntax error.

Syntax

NEWDEFAULT (ProductPrefix)

Parameters

ProductPrefix: string

A unique identifier that matches the ProductPrefix parameter of an APPLICATION statement.

See Also

APPLICATION

ENDAPP


NEXT

Purpose

Advances a loop iteration before the end of the loop.

Use NEXT inside a conditional statement such as IF or SWITCH in a loop to advance a loop iteration when a specified condition is met.  Statements after NEXT are ignored.

Syntax

NEXT

See Also

BREAK

FOR

FOREACH

FORNEXT

REPEAT

WHILE


NOTFOUND

Purpose

Determines how a macro responds to a Not Found condition.

A Not Found condition is generally the result of a failed search.  Create a Not Found condition with ASSERT(NotFoundCondition!).

Syntax

NOTFOUND (State)

Parameters

State: enum

Specifies the Not Found state.  The default is NOTFOUND(On!).

Off!	Overrides a Not Found condition.

On!	Stops a macro unless preceded by ONNOTFOUND, which directs macro execution to a specified LABEL.

See Also

ASSERT

CANCEL

ERROR

LABEL

ONNOTFOUND


NTOC

Purpose

Converts a decimal value to its character equivalent.

Syntax

ReturnValue := NTOC (CharSet; CharValue)

Returns

The character equivalent of a decimal value.

Parameters

CharSet: numeric (optional)

The number of a WordPerfect character set.  If this parameter is not used, the default is 0 (ASCII set).

CharValue: numeric

The number of a character in a WordPerfect character set.

See Also

CTON


NUMSTR

Purpose

Converts a number to a character string of numbers.

Syntax

ReturnValue := NUMSTR (Value; RightDigits; LeftDigits)

Returns

A character string of numbers.

vText := NUMSTR(999; 0) // vText = "999"

vText := NUMSTR(3+7; 0) // vText = "10"

Parameters

Value: numeric

A number or expression that results in a number.

RightDigits: numeric (optional)

The number of digits to the right of the decimal returned as a character string.  The range is 0-16.  The default is 6.  If the value of this parameter is greater than the number of decimal places, NUMSTR rounds up the entire expression.  The decimal point returned by NUMSTR is defined by the sDecimal setting in the [intl] section of the Windows WIN.INI file.

LeftDigits: numeric (optional)

The number of digits to the left of the decimal returned as a character string.  Larger numbers are expressed in exponential notation.

See Also

STRNUM


ONCANCEL

Purpose

Executes a LABEL statement when a Cancel condition occurs.

A macro with more than one ONCANCEL executes the last ONCANCEL before a Cancel condition occurs.  A Cancel condition stops a macro unless preceded by ONCANCEL.

Syntax

ONCANCEL (label)

Parameters

Label: label (optional)

A LABEL to execute when a Cancel condition occurs.  If a label is not specified, the macro halts when a Cancel condition occurs.  For example: ONCANCEL().

See Also

ASSERT

LABEL

INDIRECT

ONCANCEL CALL

ONERROR

ONNOTFOUND


ONCANCEL CALL

Purpose

Calls a LABEL-RETURN statement when a Cancel condition occurs.  RETURN directs macro execution to the first statement after the Cancel condition.

A macro with more than one ONCANCEL CALL executes the last ONCANCEL CALL before a Cancel condition occurs.

     	A Cancel condition stops a macro unless preceded by ONCANCEL CALL.

Syntax

ONCANCEL CALL (label)

Parameters

Label: label

A LABEL to call when a Cancel condition occurs.

See Also

ASSERT

INDIRECT

LABEL

ONCANCEL

ONCANCEL CALL

ONDDEADVISE CALL

ONERROR

ONERROR CALL

ONNOTFOUND

ONNOTFOUND CALL

RETURN


ONDDEADVISE CALL

Purpose

Establishes a link with an application and tests for changes in the value of the DDEREQUEST ItemName parameter.

Syntax

ONDDEADVISE CALL (MacroVar; ConversationID; ItemName; Label)

Parameters

MacroVar: variable

0 is returned in this variable if the ONDDEADVISE CALL link is successfully established, or a number greater than 0 if a link is not established.

ConversationID: numeric

The value of the DDEREQUEST ConversationID parameter.

ItemName: string

The value of the DDEREQUEST ItemName parameter.

Label: label

The LABEL to call when the value of ItemName changes.

See Also

DDEINITIATE

DDEREQUEST

INDIRECT

ONCANCEL CALL

ONERROR CALL

ONNOTFOUND CALL


ONERROR

Purpose

Executes a LABEL statement when an Error condition occurs.

A macro with more than one ONERROR statement executes the last ONERROR before an Error condition occurs.  An Error condition stops a macro unless preceded by ONERROR.

Syntax

ONERROR (label)

Parameters

Label: label (optional)

A LABEL to execute when an Error condition occurs.  If a label is not specified, the macro halts when an Error condition occurs.  For example: ONERROR().

See Also

ASSERT

INDIRECT

LABEL

ONCANCEL

ONERROR CALL

ONNOTFOUND


ONERROR CALL

Purpose

Calls a LABEL-RETURN statement when an Error condition occurs.  RETURN directs macro execution to the first statement after the Error condition.

A macro with more than one ONERROR CALL statement executes the last ONERROR CALL before an Error condition occurs.

     	An Error condition stops a macro unless preceded by ONERROR CALL.

Syntax

ONERROR CALL (label)

Parameters

Label: label

A LABEL to call when an Error condition occurs.

See Also

ASSERT

INDIRECT

LABEL

ONCANCEL

ONCANCEL CALL

ONERROR

ONNOTFOUND

ONNOTFOUND CALL

RETURN


ONNOTFOUND CALL

Purpose

Calls a LABEL-RETURN statement when a Not Found condition occurs.  RETURN directs macro execution to the first statement after the Not Found condition.

A macro with more than one ONNOTFOUND CALL statement executes the last ONNOTFOUND CALL before a Not Found condition occurs.

     	A Not Found condition stops a macro unless preceded by ONNOTFOUND CALL.

Syntax

ONNOTFOUND CALL (label)

Parameters

Label: label

A LABEL to call when a Not Found condition occurs.

See Also

ASSERT

INDIRECT

LABEL

ONCANCEL

ONCANCEL CALL

ONERROR

ONERROR CALL

ONNOTFOUND

RETURN


ONNOTFOUND

Purpose

Executes a LABEL statement when a Not Found condition occurs.

A macro with more than one ONNOTFOUND statement executes the last ONNOTFOUND before a Not Found condition occurs.  A Not Found condition stops a macro unless preceded by ONNOTFOUND.

Syntax

ONNOTFOUND (label)

Parameters

Label: label (optional)

A LABEL to execute when a Not Found condition occurs.  If a label is not specified, the macro halts when a Not Found condition occurs.  For example: ONNOTFOUND().

See Also

ASSERT

INDIRECT

LABEL

ONCANCEL

ONERROR

ONNOTFOUND CALL


OPENFILE

Purpose

Opens a file for reading and writing text data.

     	Close file when no longer needed, or system resources will be lost.  The file is closed automatically when the macro ends.  See CLOSEFILE.

Syntax

numeric OPENFILE (Name: string; AccessMode: enum; ShareMode: enum; DataType: enum)

Return Value

numeric File ID, or a negative number if error occurs.  The following file I/O (input/output) commands require a file ID:

CLOSEFILE

FILEISEOF

FILEPOSITION

FILEREAD

FILETRUNCATE

FILEWRITE

Parameters

Name: string

Include full path.  If path not included, file searched for in the following directories: current, Windows, Windows system, current program directory, DOS path, network (mapped).

AccessMode: enum (optional)

Read!

ReadWrite!

Write!

WriteNew!

Append!

Exists!

Default: Read!.  Write! overrides existing data if position marker not at end of file (see FILEPOSITION).  WriteNew! deletes existing data and creates a new file.  Exists! opens and closes file to test if file exists.  If file does not exist: Read! and ReadWrite! cause macro to fail; Write!, WriteNew!, and Append! create a new file.

ShareMode: enum (optional)

None!

Compatibility!

Exclusive!

DenyNone!

DenyRead!

DenyWrite!

Default: None!.  Compatibility! allows one or more macros to open a file any number of times.  Exclusive! denies read and write access to more than one macro.  DenyNone! does not deny other macros read and write access.  DenyRead! denies other macros read access.  DenyWrite! denies other macros write access.

DataType: enum (optional)

AnsiText!

OEMText!

WPText!

Default: AnsiText!.  WPText! reads or writes WP character strings.  It does not create a WP document.

See Also

FILEERROR


PAUSE

Purpose

Pauses a macro, returning computer control to the user.

To resume macro execution, press Enter, or choose Tools, Macro, Pause.  To stop a macro, choose Tools, Macro, Stop.  When PAUSE follows a PROMPT statement, choose OK to resume macro execution or Cancel to create a Cancel condition.

Syntax

PAUSE

See Also

CANCEL

ONCANCEL

PROMPT


PERSIST

Purpose

Declares Shared Code variables and arrays, and assigns them to the persist variable table.

PERSIST variables are available to any Shared Code application while Shared Code is running.

Syntax

PERSIST (VariableName; VariableName; ... VariableName)

Parameters

VariableName: variable

One or more user-defined variables separated by a semicolon.  Variables must begin with a letter and can include any other combination of letters or numbers.  Separate multiple variables with a semicolon.  Parentheses are optional.  For example,

PERSIST VariableName; VariableName

PERSIST(VariableName; VariableName)

are both valid statements.  The next example declares persist arrays with 5 elements and 15 elements:

PERSIST FirstArray[5]; NextArray[15]

The last example simultaneously declares a variable and assigns a value:

PERSIST x := 2

or...

PERSIST x

x := 2

If you create two variables with the same name (for example, GLOBAL x and PERSIST x), the following statement

PERSIST x := 5

specifies which variable x is assigned the value 5.

See Also

DECLARE

DISCARD

EXISTS

GLOBAL

LOCAL

PERSISTALL


PERSISTALL

Purpose

Assigns a macro's variables and arrays to the Persist variable table.

PERSIST variables are available to any Shared Code application while Shared Code is running.

Only variables assigned values after PERSISTALL are Persist variables.  Variables assigned values before PERSISTALL, and variables declared LOCAL or GLOBAL, are not Persist variables.  For example, only var6 and var7 are Persist variables:

APPLICATION(A1; "WordPerfect"; Default; "US")

LOCAL var1; var2

ASSIGN(var3; 0)

GLOBAL var4

PERSIST var7

ASSIGN(var7; "Persist Variable")

PERSISTALL

LOCAL var5

ASSIGN(var4; 2)

ASSIGN(var6; "Persist Variable")

Syntax

PERSISTALL

See Also

DISCARD

GLOBAL

LOCAL

PERSIST


PROCEDURE

PROCEDURE-ENDPROC

Purpose

Identifies a macro subroutine that can receive one or more values from a calling statement (see Using Calling Statements).

Procedures contain one or more statements that execute when the procedure is called.  Unlike LABEL subroutines, procedures do not execute unless called.  A calling statement consists of the procedure's name, and can have one or more parameters that contain values passed to the procedure.  RETURN, ENDPROC, or ENDPROCEDURE direct macro execution to the statement that follows the procedure's caller.

Address Mode

To change the value of a variable passed to a procedure, precede the calling statement parameter and its corresponding procedure parameter with an ampersand (&).  In the following example, the value of x is 5 after calling Test:

x := 5

Test(x) // calling statement

PROCEDURE Test(z)

    z := z + 5

ENDPROC

In the next example, the value of x is 10 after calling Test:

x := 5

Test(&x) // calling statement

PROCEDURE Test(&z)

    z := z + 5

ENDPROC

The ampersand before variable x means the variable's address (location in memory) is passed to the procedure, not the variable's value.  Changes made at the address of x are made to the contents of x.

Syntax

The general form of a PROCEDURE statement is,

PROCEDURE Name (Parameter; Parameter; ... Parameter)

...statement block...

ENDPROC

The syntax accepts ENDPROC or ENDPROCEDURE.

Parameters

Name: label

The name of the procedure.  It begins with a letter and consists of one or more letters or numbers.

Parameter: variable

Receives a value from a calling statement (see Using Calling Statements).  If an ampersand precedes the calling statement variable, an ampersand must precede the corresponding procedure variable (see Address Mode above).  Multiple variables are separated by a semicolon.

See Also

CALL

FUNCTION

LABEL

PROCEDURE PROTOTYPE

RETURN

USE


PROCEDURE PROTOTYPE

Purpose

Verifies the syntax of a PROCEDURE statement (see PROCEDURE).

If the syntax of a procedure contained in a USE macro file is incorrect and the procedure is called from the main macro, you get a run-time error but not a compile-time error (see Macro Errors).  Using PROCEDURE PROTOTYPE at the start of a main macro ensures that you get a compile-time error.

Syntax

PROCEDURE PROTOTYPE Name (Parameter; Parameter; ... Parameter)

Parameters

Name: label

The name of the procedure.  It begins with a letter and consists of one or more letters or numbers.

Parameter: variable

Receives a value from a calling statement (see Using Calling Statements).  If an ampersand precedes the calling statement variable, an ampersand must precede the corresponding procedure variable (see Address Mode under PROCEDURE).  Multiple variables are separated by a semicolon.


PROMPT

Purpose

Displays a message box with OK and Cancel button controls.

PAUSE following PROMPT displays a PROMPT message box until the user selects OK or Cancel.  OK removes the prompt and resumes macro execution.  Cancel removes the prompt and creates a Cancel condition (see ONCANCEL).

If PROMPT is not followed by PAUSE, the message box is displayed until an ENDPROMPT occurs or the macro ends.

     	You can display only one message box at a time.  Calling a second message box replaces the first.

Syntax

The general form of a PROMPT statement is,

PROMPT (Title; Prompt; Icon; HorizPosition; VertiPosition)

PAUSE

A PROMPT statement can have another form,

PROMPT (Title; Prompt; Icon; HorizPosition; VertiPosition)

    ...other statements...

ENDPROMPT

Parameters

Title: string

The text displayed in the title bar.

Prompt: string (optional)

The text displayed in the prompt box.  If not used, the title is displayed as the prompt and "WordPerfect Macro Facility" as the title.

Icon: numeric (optional)

The number of an icon displayed to the left of Prompt.  The default value is zero.  The values are:

0 (no icon)

1 (stop sign)

2 (question mark)

3 (exclamation point)

4 (information icon)

HorizPosition: numeric (optional)

The number of pixels from the left side of the main window to the left side of the message box.  If you omit this parameter, the prompt is centered horizontally in the main window.

VertiPosition: numeric (optional)

The number of pixels from the top of the main window to the top of the message box.  If you omit this parameter, the prompt is centered vertically in the main window.

See Also

CANCEL

MESSAGEBOX

ONCANCEL

PAUSE


QUIT

Purpose

Ends a macro.

CHAIN does not execute if QUIT occurs before CHAIN.

Syntax

QUIT

See Also

CHAIN


REGIONADDLISTITEM

Purpose

Adds an item to a list box, combination box, or popup button.

Syntax

REGIONADDLISTITEM (NamedRgn: string; Item: string)

Parameters

NamedRgn: string

Dialog box and control IDs.  Enclose IDs in double quotation marks, separated by a period.

Item: string

A list item.

See Also

DIALOGADDCOMBOBOX

DIALOGADDLISTBOX

DIALOGADDLISTITEM

DIALOGADDPOPUPBUTTON

DIALOGDEFINE

DIALOGSHOW

REGIONREMOVELISTITEM

REGIONRESETLIST

REGIONSELECTLISTITEM


REGIONENABLEWINDOW

Purpose

Enables or disables mouse and keyboard input to a dialog box or control.

Syntax

REGIONENABLEWINDOW (NamedRgn: string; State: enum)

Parameters

NamedRgn: string

Dialog box and control IDs.  Enclose IDs in double quotation marks, separated by a period.  If a control ID is not specified, State affects the entire dialog box.

State: enum

Mouse and keyboard input state.

0	Disable!

1	Enable!

See Also

DIALOGDEFINE

DIALOGSHOW

REGIONSHOWWINDOW


REGIONGETCHECK

Purpose

Reports the state of a check box control.

Syntax

REGIONGETCHECK (MacroVar: variable; NamedRgn: string)

Parameters

MacroVar: variable

Output variable is assigned 1 if the check box is selected, and 0 if not.

NamedRgn: string

Dialog box and check box control IDs.  Enclose IDs in double quotation marks, separated by a period.

See Also

DIALOGADDCHECKBOX

DIALOGDEFINE

DIALOGSHOW

REGIONSETCHECK


REGIONGETSELECTEDTEXT

Purpose

Assigns selected text to an output variable.

The selected text is in a control such as a list box, combination box, or counter.

Syntax

REGIONGETSELECTEDTEXT (MacroVar: variable; NamedRgn: string)

Parameters

MacroVar: variable

Output variable contains the selected text.

NamedRgn: string

Dialog box and control IDs.  Enclose IDs in double quotation marks, separated by a period.

See Also

DIALOGADDCOMBOBOX

DIALOGADDCOUNTER

DIALOGADDLISTBOX

DIALOGDEFINE

DIALOGSHOW


REGIONGETWINDOWTEXT

Purpose

Gets caption bar or static text.

Syntax

REGIONGETWINDOWTEXT (MacroVar: variable; NamedRgn: string)

Parameters

MacroVar: variable

Output variable contains the text.

NamedRgn: string

Dialog box and control IDs.  Enclose IDs in double quotation marks, separated by a period.  If a control ID is not specified, the command gets the caption bar text.

See Also

DIALOGDEFINE

DIALOGSHOW

REGIONSETWINDOWTEXT


REGIONISVISIBLE

Purpose

Determines the visibility state of a region or window.

Syntax

REGIONISVISIBLE (MacroVar: variable; NamedRgn: string)

Parameters

MacroVar: variable

The visibility state is returned in this variable: a nonzero number if the window is visible, or 0 if not.  Window's WS_VISIBLE flag determines the return value, which can be nonzero even if the window is only hidden by other windows.  For more information, see IsWindowVisible in Programmer's Reference, Volume 2: Functions (Windows 3.1 documentation), page 558.

NamedRgn: string

Dialog box and control IDs.  Enclose IDs in double quotation marks, separated by a period.

See Also

REGIONSHOWWINDOW


REGIONMOVEWINDOW

Purpose

Moves and/or resizes a dialog box or control.

Syntax

REGIONMOVEWINDOW (NamedRgn: string; Left: numeric; Top: numeric; Width: numeric; Height: numeric)

Parameters

NamedRgn: string

Dialog box and control IDs.  Enclose IDs in double quotation marks, separated by a period.  If a control ID is not specified, the dialog box is moved and/or resized.

Left: numeric

Number of dialog units from the left side of the screen to the left side of the dialog box; or, from the left side of the dialog box to the left side of the control.

Top: numeric

Number of dialog units from the top of the screen to the top of the dialog box; or, from the top of the dialog box to the top of the control.

Width: numeric

Width of the dialog box or control in dialog units.

Height: numeric

Height of the dialog box or control in dialog units.

See Also

DIALOGDEFINE


REGIONREMOVELISTITEM

Purpose

Removes a list item from a list box, combination box, or popup button.

Syntax

REGIONREMOVELISTITEM (NamedRgn: string; Item: string)

Parameters

NamedRgn: string

Dialog box and control IDs.  Enclose IDs in double quotation marks, separated by a period.

Item: string

A list item.

See Also

DIALOGADDCOMBOBOX

DIALOGADDLISTBOX

DIALOGADDLISTITEM

DIALOGADDPOPUPBUTTON

DIALOGDEFINE

DIALOGSHOW

REGIONADDLISTITEM

REGIONRESETLIST

REGIONSELECTLISTITEM


REGIONRESETLIST

Purpose

Clears the contents of a list box, combination box, or popup button.

Syntax

REGIONRESETLIST (NamedRgn: string)

Parameters

NamedRgn: string

Dialog box and control IDs.  Enclose IDs in double quotation marks, separated by a period.

See Also

DIALOGADDCOMBOBOX

DIALOGADDLISTBOX

DIALOGADDLISTITEM

DIALOGADDPOPUPBUTTON

DIALOGDEFINE

DIALOGSHOW

REGIONADDLISTITEM

REGIONREMOVELISTITEM

REGIONSELECTLISTITEM


REGIONSELECTLISTITEM

Purpose

Selects an item in a list box, combination box, or popup button.

Syntax

REGIONSELECTLISTITEM (NamedRgn: string; Item: string)

Parameters

NamedRgn: string

Dialog box and control IDs.  Enclose IDs in double quotation marks, separated by a period.

Item: string

A list item.

See Also

DIALOGADDLISTITEM

DIALOGADDLISTBOX

DIALOGADDCOMBOBOX

DIALOGADDPOPUPBUTTON

DIALOGDEFINE

DIALOGSHOW

REGIONADDLISTITEM

REGIONREMOVELISTITEM

REGIONRESETLIST


REGIONSETCHECK

Purpose

Selects/deselects a check box.

Syntax

REGIONSETCHECK (NamedRgn: string; State: enum)

Parameters

NamedRgn: string

Dialog box and check box control IDs.  Enclose IDs in double quotation marks, separated by a period.

State: enum

Sets the state of a check box control.

0	Unchecked!

1	Check!

See Also

DIALOGADDCHECKBOX

DIALOGDEFINE

DIALOGSHOW

REGIONGETCHECK


REGIONSETFOCUS

Purpose

Gives input focus to a specified control.

Syntax

REGIONSETFOCUS (NamedRgn: string)

Parameters

NamedRgn: string

Dialog box and control IDs.  Enclose IDs in double quotation marks, separated by a period.

See Also

DIALOGSHOW


REGIONSETWINDOWTEXT

Purpose

Replaces caption bar or static text.

Syntax

REGIONSETWINDOWTEXT (NamedRgn: string; Item: string)

Parameters

NamedRgn: string

Dialog box and control IDs.  Enclose IDs in double quotation marks, separated by a period.  If a control ID is not specified, the command replaces the caption bar text.

Item: string

Replacement text.

See Also

DIALOGDEFINE

DIALOGSHOW

REGIONGETWINDOWTEXT


REGIONSHOWWINDOW

Purpose

Shows/hides a dialog box or control.

Syntax

REGIONSHOWWINDOW (NamedRgn: string; State: enum)

Parameters

NamedRgn: string

Dialog box and control IDs.  Enclose IDs in double quotation marks, separated by a period.  If you do not use the control ID, the command hides the dialog box.

State: enum

The display state.

0	Hide!

1	Show!

See Also

DIALOGSHOW


RENAMEDIRECTORY

Purpose

Renames a directory.

Syntax

boolean RENAMEDIRECTORY (OldDirectoryName: string; NewDirectoryName: string; Prompts: enum)

Return Value

boolean True if successful, False if not.

Parameters

OldDirectoryName: string

Include full path.

NewDirectoryName: string

Include full path.

Prompts: enum (optional)

Prompt if directory does not exist.

NoPrompts!

Prompts!

See Also

CREATEDIRECTORY

DELETEDIRECTORY

DOESDIRECTORYEXIST

GETCURRENTDIRECTORY

SETCURRENTDIRECTORY


RENAMEFILE

Purpose

Renames and/or moves a file.

Syntax

boolean RENAMEFILE (OldFilename: string; NewFilename: string; Prompts: enum)

Return Value

boolean True if successful, False if not.

Parameters

OldFilename: string

Include full path.

NewFilename: string

Include full path.

Prompts: enum

Prompts if old file does not exist, or path is incorrect.

NoPrompts!

Prompts!

See Also

COPYFILE

DELETEFILE

DOESFILEEXIST


REPEAT-UNTIL

Purpose

A loop statement that executes until the expression at the bottom of the loop is true (see Using Loop Statements).

The loop executes at least once, because it is not tested until the bottom of the loop.  When Test is true, the first statement after UNTIL is executed.

Syntax

The general form of a REPEAT statement is,

REPEAT

...statement block...

UNTIL (Test)

Parameters

Test: boolean

Evaluates to true or false.

See Also

FOR

FOREACH

FORNEXT

WHILE


RETURN

Purpose

Ends LABEL, FUNCTION, and PROCEDURE subroutines, or a macro (see RUN), and then directs macro execution to the statement that follows the subroutine or macro's caller, or creates a Cancel, Error, or Not Found condition.

RETURN generally ends a LABEL statement called by statements such as CALL or CASE CALL.

CALL(StartMacro)

CALL(QuitMacro)

LABEL(StartMacro)

... statement block...

RETURN // directs macro execution to CALL(QuitMacro)

LABEL(QuitMacro)

QUIT

If there is no caller to return to, and the macro containing RETURN is nested (called by another macro), RETURN directs macro execution to the statement that follows the macro's caller (see RUN).  RETURN ends a macro if there is no caller to return to, and the macro containing the RETURN statement is not nested.

Syntax

RETURN (Condition; Value)

Parameters

Condition: enum (optional)

Creates a Cancel, Error, or Not Found condition (see ASSERT).  Condition stops a macro unless preceded by ONCANCEL, ONERROR, or ONNOTFOUND, which direct macro execution to a specified LABEL.  Condition has no effect when preceded by CANCEL(Off!), ERROR(Off!), or NOTFOUND(Off!)

The enumerations (return types) are:

CancelCondition!	Stops a macro unless preceded by ONCANCEL.

ErrorCondition!	Stops a macro unless preceded by ONERROR.

NotFoundCondition!	Stops a macro unless preceded by ONNOTFOUND.

Value: any (optional)

Returns the result of a function operation (see FUNCTION).

See Also

ASSERT

CALL

CASE CALL

FUNCTION

LABEL

ONCANCEL

ONERROR

ONNOTFOUND

PROCEDURE

RUN


RUN

Purpose

Calls (starts) a nested macro.

A nested macro starts immediately when it is called.  When a nested macro ends, control returns to the calling macro.  If QUIT ends a nested macro, control does not return to the calling macro.  A macro must be compiled before it is called by RUN.

Syntax

RUN (MacroFile; {Parameter})

Parameters

MacroFile: string

The path and name of a compiled macro.

Parameter: any (optional)

Enclose multiple parameters in braces ({}), separated by a semicolon.  For example: RUN ("macro"; {"a"; "b"; "c"})  For example: RUN ("macro"; {"a"; "b"; "c"}).  Parameter values are passed to a special array variable named MacroArgs.

See Also

CHAIN


SENDKEYS WAIT

Purpose

Sends keystrokes to the current application.  WAIT is optional (see Description below)

Keys such as Alt or F1 must be enclosed in braces to specify a single keystroke.  For example,

SENDKEYS("{Alt}LLH")

sends four keystrokes (Alt, L, L, and H) which opens the Line Height dialog box.  The following commands are equivalent to the previous example:

SENDKEYS("{Alt + L + L + H}")

SENDKEYS("{Alt}{L}{L}{H}")

If you combine keystrokes in a single set of braces, you must separate them with a plus operator.  Otherwise, the result is unpredictable.  Enclosing single character keystrokes in braces is optional.

Assign frequently used keystrokes to a variable.  For example,

ASSIGN(KS_MarginsDlg; "{Alt}LM")

SENDKEYS(KS_MarginsDlg)

opens the Margins dialog box, and is equivalent to the programming command FormatMarginsDlg.  Do not use variable names that are identical to a macro command name.

A minus operator releases a keystroke.  For example,

SENDKEYS("{Shift+Del-Del+Ins}")

cuts selected text to the clipboard (Shift+Del), then pastes it at the insertion point (Shift+Ins).

With the WAIT modifier, SENDKEYS is processed before the next macro statement.  Otherwise, SENDKEYS is processed after the next macro statement.  For example,

APPLICATION(A1; "WordPerfect"; Default; "US")

Display(On!)

InhibitInput(Off!)

SENDKEYS("C:\WPWIN60\MACROS\*.WCM {Enter}")

FileOpenDlg

displays the Open File dialog box, enters C:\WPWIN60\MACROS\*.WCM in the Filename edit box, and presses Enter.  The directory changes to C:\WPWIN60\MACROS, and files with a .WCM extension appear in the Filename list box.  The same example with the WAIT modifier enters C:\WPWIN60\MACROS\*.WCM in the document before the Open File dialog box is displayed.

     	Set InhibitInput(Off!) for SENDKEYS to operate correctly.

Syntax

SENDKEYS WAIT (KeyCode; MarkupLanguage)

Parameters

KeyCode: string

Keystrokes to send.

{VKnnn}	nnn = ANSI character number

{Alt}

{Ctrl}

{Control}

{Shift}

{0} - {9}	Digits

{A} - {Z}	Alphabet

{F1} - {F16}	Function keys

{NumLock}

{NumAdd}

{NumSubtract}

{NumMultiply}

{NumDivide}

{NumDecimal}

{Num0} - {Num9}	Numpad numbers

{Left}

{Right}

{Up}

{Dn}

{Down}

{PgDn}

{PageDown}

{PgUp}

{PageUp}

{Bksp}

{Backspace}

{Break}	Cancel

{CapsLock}

{Clear}

{Del}

{Delete}

{End}

{Enter}

{Esc}

{Escape}

{Help}	VK Help key

{Home}

{Ins}

{Insert}

{Minus}

{Pause}

{ScrLock}

{ScrollLock}

{PrintScrn}

{PrintScreen}

{Space}

{Tab}

{LeftBrace}	 {

{RightBrace}	 }

MarkupLanguage: Numeric Expression

Specifies which language interprets the key codes.  The values are,

1	WPWin 6.0 keystring language.


SETCURRENTDIRECTORY

Purpose

Specifies new default directory.

Syntax

boolean SETCURRENTDIRECTORY (DirectoryName: string)

Return Value

boolean True if successful, False if not.

Parameters

DirectoryName: string

Include full path.

See Also

CREATEDIRECTORY

DELETEDIRECTORY

DOESDIRECTORYEXIST

GETCURRENTDIRECTORY

RENAMEDIRECTORY


SETFILEATTRIBUTES

Purpose

Changes file attributes.

Syntax

boolean SETFILEATTRIBUTES (Filename: string; Attributes: enum; Prompts: enum)

Return Value

boolean True if successful, False if not.

Parameters

Filename: string

Attributes: enum (optional)

Archived!

Directory!

Hidden!

Label!

Normal!

ReadOnly!

System!

Prompts: enum (optional)

Prompts if attribute does not exist.

NoPrompts!

Prompts!

See Also

GETFILEATTRIBUTES


SETFILEDATEANDTIME

Purpose

Changes a file's creation date and time.

Syntax

boolean SETFILEDATEANDTIME (Filename: string; DateAndTime: numeric)

Return Value

boolean True if successful, False if not.

Parameters

Filename: string

Include full path.

DateAndTime: numeric

Number of seconds since January 1, 1980.

See Also

GETFILEDATEANDTIME


SPEED

Purpose

Slows macro execution.

Time is measured in tenths of a second.  SPEED(0) runs at maximum speed.  SPEED(5) delays a macro one-half second between statements.  The maximum delay is one minute, or SPEED(600).

SPEED(10) // delay one second between beeps

BEEP

BEEP

BEEP

Syntax

SPEED (TenthsOfSeconds)

Parameters

TenthsOfSeconds: numeric

A number from zero to 600.  Divide the number by 10 to calculate the number of seconds.

See Also

WAIT


STRLEN

Purpose

Determines the number of characters in a string.

The string can be a variable, constant, character string, or result of an expression.

vWord := "WordPerfect"

vNumber := STRLEN(vWord)

Result: vNumber equals 11

vNumber := STRLEN(45899)

Result: vNumber equals 5

vNumber := STRLEN("WordPerfect")

Result: vNumber equals 11

vNumber := STRLEN(9 + 9)

Result: vNumber equals 2

Syntax

ReturnValue := STRLEN (string)

Return Value

The number of characters in a string.

Parameters

String: string

A variable, constant, character string, or result of an expression.

See Also

CHARLEN

NUMSTR

STRNUM

STRPOS

STRUNIT

SUBSTR


STRNUM

Purpose

Converts a character string of numbers to a numeric equivalent.

Syntax

ReturnValue := STRNUM (string)

Return Value

A number.

vNum := STRNUM("123")

Result: vNum = 123

vNum := STRNUM("123.5")

Result: vNum = 123.5

vNum := STRNUM("9 + 9")

Result: vNum = 9

Parameters

String: string

Contains a character string of numbers.  STRNUM recognizes the decimal point defined by the sDecimal setting in the [intl] section of the Windows WIN.INI file.  Alphabetic characters, operators, and punctuation marks, and everything that follows them are ignored.

See Also

NUMSTR

STRLEN

STRPOS

STRUNIT

SUBSTR


STRPOS

Purpose

Determines whether a character string is also a substring.

Syntax

ReturnValue := STRPOS (String; SubString)

Return Value

The beginning position of a substring, or zero if a substring is not found.

vPos := STRPOS("WordPerfect"; "Perfect")

Result: vPos = 5

vPos := STRPOS("WordPerfect"; "Scott")

Result: vPos = 0

Parameters

String: string

A character string to evaluate.

Substring: string

A substring to locate in String parameter.

See Also

NUMSTR

STRLEN

STRNUM

STRUNIT

SUBSTR


STRUNIT

Purpose

Converts a string of numbers to a measurement.

The string may contain a number, an arithmetic expression that results in a number, or a character string of numbers.  If a character string is used, alphabetic characters (except units of measure), operators, and punctuation marks are ignored.  The default unit of measure is WordPerfect units.  You can change the default with DEFAULTUNITS, or by specifying a unit of measure as part of the character string.

DEFAULTUNITS(Centimeters)

vUnit := STRUNIT(9)

Result: vUnit equals 9.C

vUnit :equals STRUNIT(4+3)

Result: vUnit equals 7.C

vUnit :equals STRUNIT("10")

Result: vUnit equals 10.C

vUnit :equals STRUNIT("10abc")

Result: vUnit equals 10.C

vUnit :equals STRUNIT("10i")

Result: vUnit equals 10I

The units of measure are:

"	inches

i	inches

c	centimeters

m	millimeters

p	points (72 per inch)

w	WP units (1200 per inch)

Syntax

ReturnValue := STRUNIT (string)

Return Value

A unit of measure.

Parameters

String: string

A number or character string of numbers.

See Also

NUMSTR

STRLEN

STRNUM

STRPOS

SUBSTR

UNITSTR


SUBCHAR

Purpose

Extracts a substring from a character string.

Use CHARPOS to locate a substring.

Syntax

ReturnValue := SUBCHAR (String; Beginning; NumberOfChars)

Return Value

A character string.

vSub := SUBCHAR("WordPerfect"; 1; 4) // vSub = "Word"

Parameters

String: string

A character string to evaluate.

Beginning: numeric

The starting position of a substring.

NumberOfChars: numeric

The number of characters to extract.

See Also

CHARLEN

CHARPOS

SUBSTR


SUBSTR

Purpose

Extracts a substring from a character string.

Use STRPOS to locate a substring.

Syntax

ReturnValue := SUBSTR (String; Beginning; NumberOfChars)

Return Value

A character string.

vSub := SUBSTR("WordPerfect"; 1; 4) // vSub = "Word"

Parameters

String: string

A character string to evaluate.

Beginning: numeric

The starting position of a substring.

NumberOfChars: numeric

The number of characters to extract.

See Also

NUMSTR

STRLEN

STRNUM

STRPOS

STRUNIT

SUBCHAR


SWITCH-ENDSWITCH

Purpose

A conditional statement that tests for matching expressions.  If a match is found, a statement (or statement block) is executed.  See Using Condtional Statements.

If Test matches Selector, the statement block that follows Selector is executed and no other evaluation is made.  Test and Selector are case sensitive and must match exactly.

If CONTINUE follows an executed statement block, the next statement block is automatically executed.  CONTINUE is optional.

The DEFAULT statement block is executed if no Selector matches Test.  DEFAULT is optional.  If no match is found and DEFAULT is not used, the macro continues to the first statement after ENDSWITCH.

If BREAK occurs in a state block, the macro continues to the first statement after ENDSWITCH.

ENDSWITCH closes a SWITCH statement.

Syntax

The general form of a SWITCH statement is,

SWITCH (Test)

CASEOF Selector1:

...statement block...

CONTINUE

CASEOF Selector2; Selector3:

...statement block...

DEFAULT:

...statement block...

ENDSWITCH

Parameters

Test: any

The control expression.  Variables are assigned values by commands such as GETSTRING, GETNUMBER, or MENU.

Selector: any

An expression (variable, constant, character) with a value that is usually assigned before the macro is compiled.  It is possible to assign the value at run-time. Selector always follows a CASEOF statement.

See Also

BREAK

CASE

CASE CALL

IF


TOLOWER

Purpose

Converts uppercase letters to lowercase.

The value returned by TOLOWER can be assigned to a variable or used directly by a statement such as IF.

vAnswer := "YES"

vAnswer := TOLOWER(vAnswer)

Result: vAnswer equals lowercase yes

Shorthand notation example

IF(TOLOWER(vAnswer) = "yes")

BEEP

ELSE

QUIT

ENDIF

Explanation: Beep if vAnswer equals lowercase yes.

Syntax

ReturnValue := TOLOWER (String)

Return Value

The lowercase equivalent of uppercase letters.

Parameters

String: string

A string to convert.

See Also

TOUPPER


TOUPPER

Purpose

Converts lowercase letters to uppercase.

The value returned by TOUPPER can be assigned to a variable or used directly by a statement such as IF.

vAnswer := "yes"

vAnswer := TOUPPER(vAnswer)

Result: vAnswer equals uppercase YES

Shorthand notation example

IF(TOUPPER(vAnswer) = "YES")

BEEP

ELSE

QUIT

ENDIF

Explanation: Beep if vAnswer equals uppercase YES.

Syntax

ReturnValue := TOUPPER (String)

Return Value

The uppercase equivalent of lowercase letters.

Parameters

String: string

A string to convert.

See Also

TOLOWER


UNITSTR

Purpose

Converts a measurement to a character string.

If a unit of measure is not specified, the default is WordPerfect units.  To change the default use DEFAULTUNITS.  The following example converts WP units to centimeters and returns the result as a string:

vUnits := UNITSTR(1200; Centimeters!)

Result: vUnits equals "2.540000C"

The next example converts centimeters to millimeters and returns the result as a string:

DEFAULTUNITS(Centimeters!)

vUnits := UNITSTR(1.0; Millimeters!)

Result: vUnits equals "10.000000M"

The next example converts inches to centimeters and returns the result as a string:

vUnits := UNITSTR(2.0i; Centimeters!)

Result: vUnits equals "5.080000C"

See STRUNIT to convert a string of numbers to a measurement expression.

Syntax

ReturnValue := UNITSTR (Value; Units)

Return Value

A measurement expressed as a string.

Parameters

Value: numeric

A real number measurement.  Unless you specifiy a unit of measure, the default is WP Units.  To change the default use DEFAULTUNITS.

Units: enum

The unit of measure that Value converts to.

Inches!

Centimeters!

Millimeters!

Points!	(72 per inch)

WPUnits!	(1200 per inch)

WP1200ths!	(1200 per inch)

See Also

GETUNITS

NUMSTR

STRLEN

STRNUM

STRPOS

STRUNIT

SUBSTR


USE

Purpose

Specifies a macro file with functions and/or procedures that can be called from another macro.

USE is a non-executable statement that can occur anywhere in a macro.  A macro with a calling statement to a function or procedure in another macro file must include a USE statement that identifies the file.  A USE macro file that includes only function and/or procedure statements must be compiled like any macro file (see Macro File Libraries).  A USE macro file that does not contain command statements, such as PROCEDURE or FUNCTION, does not need to be compiled.

Macro files identified by multiple USE statements are searched from first to last.  Thus a parent macro always calls the first occurrence of a function or procedure with the same name in different USE files.

Syntax

USE (MacroFile)

Parameters

MacroFile: string

The path and name of a macro file.  You cannot substitute string with a variable.

See Also

FUNCTION

INCLUDE

PROCEDURE


VARERRCHK

Purpose

Determines how a macro responds to unitialized variables (variables not assigned a value).

Syntax

VARERRCHK (State)

Parameters

State: enum

Specifies the state of variable checking.  The default is VARERRCHK(On!).

Off!	Ignore unitialized variables by temporarily assigning a value of 0.

On!	Display a run-time Error message when a macro attempts to use an unitialized variable, and end the macro.

See Also

GLOBAL

LOCAL

PERSIST

PERSISTALL


WAIT

Purpose

Pauses macro execution.

Time is measured in tenths of a second.  The maximum pause is one minute, or WAIT(600).

Syntax

WAIT (TenthsOfSeconds)

Parameters

TenthsOfSeconds: numeric

A number from zero to 600.  Divide the number by 10 to calculate the number of seconds.

See Also

SPEED


WHILE-ENDWHILE

Purpose

A loop statement that executes while the expression at the top of the loop is true (see Using Loop Statements).

The loop does not execute the first time unless Test is true.  When Test is false, the first statement after ENDWHILE is executed.

Syntax

The general form of a WHILE statement is,

WHILE (Test)

...statement block...

ENDWHILE

Parameters

Test: boolean

Evaluates to true or false.

See Also

FOR

FOREACH

FORNEXT

REPEAT


For Example...

APPLICATION (A1; "WPPrWin"; Default; "US")

// Execute Windows Cardfile three times: full screen, normal size, and to an icon

// FORNEXT decrements initial value

// Demonstrate APPEXECUTEEXT command

FORNEXT(vCtrl; 3; 1; -1)

ASSIGN(vReturn; APPEXECUTEEXT("c:\windows\cardfile.exe"; vCtrl))

IF(vReturn < 32)

BEEP

MESSAGEBOX(vStatus; "ERROR"; "Unable to execute Cardfile.exe"; IconExclamation!)

QUIT

ENDIF

 WAIT(3)

ENDFOR


For Example...

APPLICATION(A1; "WPPrWin"; Default; "US")

// Execute Windows Calculator

// Locate and activate 3 times

// Demonstrate APPEXECUTE command

ASSIGN(hWP; APPLOCATE("*"))

APPEXECUTE("c:\windows\calc.exe")

ASSIGN(hCalc; APPLOCATE("Calculator"))

FORNEXT(vCtrl; 1; 2; 1)

WAIT(10)

APPACTIVATE(hWP)

WAIT(10)

APPACTIVATE(hCalc)

ENDFOR


For Example...

APPLICATION(A1; "WPPrWin"; Default; "US")

// Display message box on ASSERT condition

// Demonstrate ASSERT command

ONCANCEL(Condition)

ONERROR(Condition)

ONNOTFOUND(Condition)

LABEL(Start)

MENU(vPick; Digit!; ; ; {"Assert Cancel"; "Assert Error"; "Assert Not Found"; "Quit"})

SWITCH(vPick)

CASEOF 1: ASSERT(CancelCondition!)

CASEOF 2: ASSERT(ErrorCondition!)

CASEOF 3: ASSERT(NotFoundCondition!)

CASEOF 4: QUIT

DEFAULT: GO(Condition)

ENDSWITCH

LABEL(Condition)

SWITCH(ErrorNumber)

CASEOF 1: vMsg := "1 (Cancel condition)"

CASEOF 2: vMsg := "2 (Error condition)"

CASEOF 7: vMsg := "3 (Not Found condition)"

DEFAULT: vMsg := "?"

ENDSWITCH

MESSAGEBOX(vStatus; "ASSERT COMMAND"; "You selected " + vMsg; IconInformation!)

GO(Start)


For Example...

APPLICATION(A1; "WPPrWin"; Default; "US")

// Beep vCount times - BREAK when vCount equals 4

// Remember: functions do not execute unless called

// Demonstrate BEEP command

FUNCTION BeepBeep(vCount)

REPEAT

BEEP

WAIT(3)

vCount := vCount - 1

UNTIL(vCount = 0)

RETURN

ENDFUNC

FOREACH(vCount; {1; 2; 3; 4; 5})

IF(vCount = 4)

BREAK

ENDIF

BeepBeep(vCount)

WAIT(5)

ENDFOR

MESSAGEBOX(x; "BREAK"; "Variable vCount equals 4"; IconInformation!)

QUIT


For Example...

APPLICATION(A1; "WPPrWin"; Default; "US")

// Test user input

// Remember: procedures do not execute unless called

// Demonstrate GETNUMBER, PROCEDURE, and PROCEDURE PROTOTYPE commands

PROCEDURE PROTOTYPE ErrorMsg(x)

REPEAT

GETNUMBER(vNum; "Enter a number from 1 to 5"; "GETNUMBER EXAMPLE")

IF((vNum < 1) OR (vNum > 5))

CALL ErrorMsg(vNum)

ELSE

MESSAGEBOX(vStatus; "YES!"; "You entered " + vNum; IconInformation!)

ENDIF

UNTIL((vNum > 0) AND (vNum < 6))

PROCEDURE ErrorMsg(x)

BEEP BEEP BEEP

IF(x < 1)

vMessage := x + " is less than 1"

ELSE

vMessage := x + " is greater than 5"

ENDIF

MESSAGEBOX(vStatus; "OUT-OF-RANGE ERROR" ; vMessage + " - please try again"; IconExclamation!)

ENDPROC


For Example...

APPLICATION(A1; "WPPrWin"; Default; "US")

// Test user input for Y or N

// For Cancel condition: chose Cancel, click Close, press Alt+F4, or double-click system menu box

// Demonstrate CHARLEN command

CANCEL(On!)

ONCANCEL CALL(CancelMessage)

PROCEDURE Message(vPrompt; vIcon)

IF(vIcon = "!")

BEEP

MESSAGEBOX(y; "Message Box"; vPrompt; IconExclamation!)

ELSE

MESSAGEBOX(y; "Message Box"; vPrompt; IconInformation!)

ENDIF

ENDPROC

vStr := ""

REPEAT

GETSTRING(vStr; "Press one character: ""Y"" for Yes or ""N"" for no"; "GETSTRING EXAMPLE"; 50)

IF(vStr = "")

vStr := "<Enter>"

ENDIF

vTest := TOUPPER(vStr)

IF(CHARLEN(vStr) > 1)

CALL Message("You typed or pressed """ + vStr + """"; "!")

ELSE

IF((vTest = "Y") OR (vTest = "N"))

CALL Message("Well done - You pressed " + vTest; "i")

ELSE

CALL Message("You pressed """ + vStr + """"; "!")

ENDIF

ENDIF

UNTIL(((vTest = "Y") OR (vTest = "N")) AND NOT(CHARLEN(vStr) > 1))

QUIT

LABEL(CancelMessage)

vStr := "a Cancel control"

RETURN


For Example...

APPLICATION(A1; "WPPrWin"; "US")

APPLICATION(A1; "WordPerfect"; Default; "US")

// Specify a unit of measure or accept WP units default

// Plays macro in WordPerfect for Windows 6.1

// Launches WordPerfect if not running

// Demonstrate GETUNITS command

MENU(vChoice; Digit; ; ; {"Advance down"; "Advance up"; "Advance left"; "Advance right"})

SWITCH(vChoice)

CASEOF 1: vPrompt := "Advance down:"

CASEOF 2: vPrompt := "Advance up:"

CASEOF 3: vPrompt := "Advance left:"

CASEOF 4: vPrompt := "Advance right:"

ENDSWITCH

DEFAULTUNITS(Inches!)

GETUNITS(vUnit; vPrompt; "GETUNITS EXAMPLE")

SWITCH(vChoice)

CASEOF 1: ADVANCE(AdvanceDown!; vUnit)

CASEOF 2: ADVANCE(AdvanceUp!; vUnit)

CASEOF 3: ADVANCE(AdvanceLeft!; vUnit)

CASEOF 4: ADVANCE(AdvanceRight!; vUnit)

ENDSWITCH


For Example...

APPLICATION(A1; "WPPrWin"; Default; "US")

// Execute Windows Calculator, Calendar, and Cardfile

// Demonstrate CASE CALL inside a REPEAT-UNTIL loop

ASSIGN(hWP; APPLOCATE("*"))

REPEAT

MENU(vChoice; Digit; ; ; {"Calculator"; "Calendar"; "Card File"; "Quit"})

CASE CALL(vChoice; {1; Program; 2; Program; 3; Program; 4; QuitMacro}; QuitMacro)

UNTIL(vChoice = 4)

LABEL(Program)

SWITCH(vChoice)

CASEOF 1: vProgram := "c:\windows\calc.exe"

CASEOF 2: vProgram := "c:\windows\calendar.exe"

CASEOF 3: vProgram := "c:\windows\cardfile.exe"

ENDSWITCH

APPEXECUTE(vProgram)

RETURN

LABEL(QuitMacro)

MESSAGEBOX(vStatus; "EXIT"; "Are you finished?"; IconQuestion! | YesNo!)

IF(vStatus = 6)

APPACTIVATE(hWP)

QUIT

ELSE

vChoice := ""

RETURN

ENDIF


For Example...

APPLICATION(A1; "WPPrWin"; "US")

APPLICATION(A1; "WordPerfect"; Default; "US")

// Create personal or business letterhead

// Plays macro in WordPerfect for Windows 6.1

// Launches WordPerfect if not running

MENU(vChoice; Digit; ; ; {"Personal letterhead"; "Business letterhead"; "Quit"})

FileNew

CASE(vChoice; {1; Personal; 2; Business; 3; QuitMacro}; QuitMacro)

LABEL(Personal)

Center

AttributeAppearanceOn(Bold!)

FontSize(16.0p)

Type("From Dan's Desk")

AttributeAppearanceOff(Bold!) HardReturn

Center FontSize(12.0p)

DateCode

HardReturn HardReturn HardReturn

Type("Dear ")

QUIT

LABEL(Business)

DateCode HardReturn HardReturn

Type("Mr. John Doe") HardReturn

Type("Executive Vice President") HardReturn

Type("XYZ Company") HardReturn

Type("4399 Oak View Drive") HardReturn

Type("Orem, UT 84057") HardReturn HardReturn

Type("Dear Mr. Doe:")

QUIT

LABEL(QuitMacro)

QUIT


For Example...

// There are four macros in this example

// Compile separately

APPLICATION(A1; "WPPrWin"; Default; "US")

// macro1.wcm

MESSAGEBOX(vStatus; vTitle; "Macro 1 - " + vPrompt; IconInformation!)

APPLICATION(A1; "WPPrWin"; Default; "US")

// macro2.wcm

MESSAGEBOX(vStatus; vTitle; "Macro 2 - " + vPrompt; IconInformation!)

APPLICATION(A1; "WPPrWin"; Default; "US")

// macro3.wcm

MESSAGEBOX(vStatus; vTitle; "Macro 3 - " + vPrompt; IconInformation!)

APPLICATION(A1; "WPPrWin"; Default; "US")

// Calling Macro

// Demonstrate CHAIN command and GLOBAL variables

GLOBAL vTitle; vPrompt

MENU(vChoice; Letter; ; ; {"Macro 1"; "Macro 2"; "Macro 3"})

ASSIGN(vPrompt; "Computer beeps before chain macro called")

ASSIGN(vMacrosPath; EnvPaths(PathType: Macros!))

SWITCH(vChoice)

CASEOF 1:

ASSIGN(vTitle; "MACRO ONE")

CHAIN(vMacrosPath + "macro1.wcm")

CASEOF 2:

ASSIGN(vTitle; "MACRO TWO")

CHAIN(vMacrosPath + "macro2.wcm")

CASEOF 3:

ASSIGN(vTitle; "MACRO THREE")

CHAIN(vMacrosPath + "macro3.wcm")

ENDSWITCH

// beep sounds before chain macro called

BEEP WAIT(5)


For Example...

// There are four macros in this example

// Compile separately

APPLICATION(A1; "WPPrWin"; Default; "US")

// macro1.wcm

MESSAGEBOX(vStatus; vTitle; "Macro 1 - " + vPrompt; IconInformation!)

RETURN

APPLICATION(A1; "WPPrWin"; Default; "US")

// macro2.wcm

MESSAGEBOX(vStatus; vTitle; "Macro 2 - " + vPrompt; IconInformation!)

RETURN

APPLICATION(A1; "WPPrWin"; Default; "US")

// macro3.wcm

MESSAGEBOX(vStatus; vTitle; "Macro 3 - " + vPrompt; IconInformation!)

RETURN

APPLICATION(A1; "WPPrWin"; Default; "US")

// Calling Macro

// Demonstrate RUN command and GLOBAL variables

GLOBAL vTitle; vPrompt

ASSIGN(vPrompt; "RUN macros can return to their caller")

ASSIGN(vMacrosPath; EnvPaths(PathType: Macros!))

REPEAT

MENU(vChoice; Letter; ; ; {"Macro 1"; "Macro 2"; "Macro 3"; "Quit"})

SWITCH(vChoice)

CASEOF 1:

ASSIGN(vTitle; "MACRO ONE")

RUN(vMacrosPath + "macro1.wcm")

CASEOF 2:

ASSIGN(vTitle; "MACRO TWO")

RUN(vMacrosPath + "macro2.wcm")

CASEOF 3:

ASSIGN(vTitle; "MACRO THREE")

RUN(vMacrosPath + "macro3.wcm")

DEFAULT: QuitMacro

ENDSWITCH

UNTIL(vChoice = 4)

LABEL(QuitMacro)

BEEP

MESSAGEBOX(vStatus; "QUIT"; "This example uses global variables"; IconExclamation!)

DISCARD vTitle; vPrompt

QUIT


For Example...

APPLICATION(A1; "WPPrWin"; Default; "US")

// Create a loop with GO command

// Demonstrate CASE, MESSAGEBOX, and system variables

LABEL(Start)

MENU(vChoice; Digit; ; ; {"IconExclamation!"; "IconInformation!"; "IconQuestion"; "IconStop!"; "Quit"})

CASE(vChoice; {1; Exclaim; 2; Info; 3; Question; 4; Stop; 5; QuitMacro}; QuitMacro)

LABEL(Exclaim)

MESSAGEBOX(x; "EXCLAMATION"; "Example of an exclamation icon"; IconExclamation!)

GO(LoopToStart)

LABEL(Info)

ASSIGN(vID; EnvCurrentMode)

IF(vID = 1)

ASSIGN(vMode; "Drawing Mode")

ELSE

ASSIGN(vMode; "Slide Mode")

ENDIF

MESSAGEBOX(x; "INFORMATION"; "Example of an information icon - current mode is " + vMode + "."; IconInformation!)

GO(LoopToStart)

LABEL(Question)

Yes := 6

MESSAGEBOX(vAns; "QUESTION"; "Example of a question icon." + NTOC(0F90Ah) + "Would you like to know the default macro path?"; IconQuestion! | YesNo!)

IF(vAns = Yes)

vPrompt := "The default macro path is " + EnvPaths(PathType: Macros!)

MESSAGEBOX(x; "MACRO PATH"; vPrompt; IconInformation!)

GO(LoopToStart)

ELSE

GO(LoopToStart)

ENDIF

LABEL(Stop)

MESSAGEBOX(z; "STOP"; "Example of a stop icon"; IconStop!)

GO(LoopToStart)

LABEL(LoopToStart)

MESSAGEBOX(vAns; "Message"; "Would you like to continue?"; IconQuestion! | YesNo!)

IF(vAns = 7)

GO(QuitMacro)

ELSE

GO(Start)

ENDIF

LABEL(QuitMacro)

BEEP

QUIT


For Example...

APPLICATION(A1; "WPPrWin"; Default; "US")

// Extract numbers from a character string

// Demonstrate CHARLEN command

vNumbers := ""

vPrompt := "Enter text that includes both letters and numbers:"

LABEL(Start)

GETSTRING(vStr; vPrompt; "EXTRACT NUMBERS")

IF(vStr = "")

BEEP

MESSAGEBOX(x; "ERROR"; "You pressed return without entering any text"; IconStop!)

GO(Start)

ENDIF

vLen := CHARLEN(vStr)

vPos := 1

WHILE(NOT(vPos = vLen + 1))

vTest := SUBCHAR(vStr; vPos; 1)

IF((CTON(vTest) > 47) AND (CTON(vTest) < 58))

vNumbers := vNumbers + vTest

ENDIF

vPos := vPos + 1

ENDWHILE

IF(CHARLEN(vNumbers) > 0)

MESSAGEBOX(x; "NUMBER STRING"; "You entered the following numbers: " + vNumbers; IconInformation!)

ELSE

BEEP

MESSAGEBOX(x; "ERROR"; "You didn't enter any numbers"; IconExclamation!)

ENDIF


For Example...

APPLICATION(A1; "WPPrWin"; Default; "US")

// Extract "Perfect" from WordPerfect

// Test if "program" was entered

// Demonstrate SUBCHAR command

vNumbers := ""

vPrompt := "Enter the following text: ""WordPerfect program"""

LABEL(Start)

GETSTRING(vStr; vPrompt; "USING SUBCHAR")

IF(vStr = "")

BEEP

MESSAGEBOX(x; "ERROR"; "You pressed return without entering any text"; IconStop!)

GO(Start)

ENDIF

vSub := SUBCHAR(vStr; 5; 7)

IF(vSub = "Perfect")

MESSAGEBOX(x; "SUBCHAR EXAMPLE"; "WordPerfect is simply """ + vSub + """"; IconInformation!)

IF(CHARPOS(vStr; "program") = 0)

BEEP

MESSAGEBOX(x; "CHARPOS EXAMPLE"; "You entered ""WordPerfect"" but not ""program"""; IconExclamation!)

ENDIF

ELSE

BEEP

MESSAGEBOX(x; "ERROR"; """WordPerfect"" wasn't the first word"; IconExclamation!)

GO(Start)

ENDIF


For Example...

APPLICATION(A1; "WPPrWin"; Default; "US")

// Start conversation with GroupWise 4.1 from Presentations 3.0

// Execute GroupWise 4.1 command

// Demonstrate DDEEXECUTE and DDEINITIATE commands

ASSIGN(hConv; DDEINITIATE("GROUPWISE"; "COMMAND"))

IF(hConv) // IF hConv not equal to 0

DDEEXECUTE(hConv; "ViewOpenNamed(ViewName:""Mail""; ViewType:Mail!)")

DDETERMINATEALL

ELSE

BEEP

MESSAGEBOX(x; "ERROR"; "Is GroupWise running?  Conversation not started."; IconQuestion!)

ENDIF


For Example...

APPLICATION(A1; "WPPrWin"; Default; "US")

// Start conversation with GroupWise 4.1 from WordPerfect 6.1

// Execute GroupWise 4.1 command

// Demonstrate DDEEXECUTEEXT command

ASSIGN(hConv; DDEINITIATE("GROUPWISE"; "COMMAND"))

IF(hConv) // IF hConv not equal to 0

vReturn := DDEEXECUTEEXT(hConv; "ViewOpenNamed(""Mail""; Mail!)"; 0; Message)

IF(vReturn = 0)

MESSAGEBOX(x; "ERROR"; "Command not received by GroupWise"; IconExclamation!)

ENDIF

ELSE

BEEP

MESSAGEBOX(x; "ERROR"; "Is GroupWise running?  Conversation not started."; IconQuestion!)

ENDIF

DDETERMINATEALL

QUIT

LABEL(Message)

ASSIGN(vMsg; "GroupWise acknowledges receipt of ViewOpenNamed command")

MESSAGEBOX(z; "DDEEXECUTEEXT EXAMPLE"; vMsg; IconInformation!)

RETURN


For Example...

APPLICATION(A1; "WPPrWin"; Default; "US")

// Request GroupWise 4.1 version number from WordPerfect 6.0a

// Demonstrate DDEREQUEST command

// This example is included for backward compatibility

// In GroupWise Macros Help, see Contents page, Using DDE

ASSIGN(hConv; DDEINITIATE("WPOFFICE40"; "GETOFFICEDATA"))

IF(hConv)

ASSIGN(vMajor; DDEREQUEST(hConv; "GetOfficeData(ID; MajorVersion!)"))

ASSIGN(vMinor; DDEREQUEST(hConv; "GetOfficeData(ID; MinorVersion!)"))

MESSAGEBOX(x; "DDEREQUEST EXAMPLE"; "GroupWise version is " + vMajor + "." + vMinor; IconInformation!)

DDETERMINATE(hConv)

ELSE

BEEP

MESSAGEBOX(x; "ERROR"; "Is GroupWise running?  Conversation not started."; IconQuestion!)

ENDIF


For Example...

APPLICATION(A1; "WPPrWin"; Default; "US")

// Assign fax number to ExpressFax+

// Demonstrate DDEPOKE command

ASSIGN(hConv; DDEINITIATE("FAXMNG"; "Transmit"))

IF(hConv)

GETSTRING(vFax; "Enter FAX Number"; "ExpressFax+")

DDEPOKE(hConf;"FAX Number"; vFax)

DDETERMINATE(hConv)

ELSE

BEEP

MESSAGEBOX(x; "ERROR"; "Is ExpressFax+ running?  Conversation not started."; IconQuestion!)

ENDIF


For Example...

APPLICATION(A1; "WPPrWin"; Default; "US")

// Declare an array of months

// Demonstrate DECLARE command, recursive LABEL statement

DECLARE Months[12]

x := 1

FOREACH(vMonth; {"January"; "Februrary"; "March"; "April"; "May"; "June"; "July"; "August"; "September"; "October"; "November"; "December"})

Months[x] := vMonth

x := x + 1

ENDFOR

LABEL(Start)

MENU(vNmbr; Letter; ; ; {"January"; "Februrary"; "March"; "April"; "May"; "June"; "July"; "August"; "September"; "October"; "November"; "December"; "QUIT"})

IF(vNmbr = 13)

BEEP

QUIT

ELSE

MESSAGEBOX(vStatus; "MONTHS OF THE YEAR"; "You selected " + Months[vNmbr]; IconInformation!)

GO(Start)

ENDIF


For Example...

APPLICATION(A1; "WPPrWin"; Default; "US")

// Change current working directory

// Demonstrate DLLLOAD, DLLCALL, and DLLFREE

// Assign hard return code to a variable, insert in prompt string

// For information about WfsSetCurDir and WfsGetCurDir, see WordPerfect 6.1 for Windows Software Developer's Kit

DLLLOAD(hInstance; "shwin20.dll")

DLLCALL(hInstance; "WfsGetCurDir"; vMsgResult: WORD; {ADDRESS (ANSISTRING(CurDir))})

ASSIGN(HdReturn; NTOC(0F90Ah)) // hard return code

LABEL(Start)

GETSTRING(vNewDir; "The current working directory is " + CurDir + HdReturn + HdReturn + "Enter a new working directory:"; "DLL EXAMPLE")

IF(vNewDir = "")

BEEP

MESSAGEBOX(x; "ERROR"; "You pressed return without entering a path"; IconStop!)

GO(Start)

ENDIF

DLLCALL(hInstance; "WfsSetCurDir"; vMsgResult: WORD; {vNewDir})

DLLCALL(hInstance; "WfsGetCurDir"; vMsgResult: WORD; {ADDRESS (ANSISTRING(CurDir))})

MESSAGEBOX(vAns; "DLL EXAMPLE"; "The new working directory is " + CurDir; IconInformation! | RetryCancel!)

IF(vAns = 2)

BEEP

QUIT

ELSE

GO(Start)

ENDIF

DLLFREE(hInstance)

QUIT


For Example...

APPLICATION(A1; "WPPrWin"; Default; "US")

// LABEL(ErrorMsg) executes with ERROR(On!)

// Demonstrate ERROR command

ONERROR(ErrorMsg)

REPEAT

MENU(vChoice; Digit; ; ; {"ERROR(Off!)"; "ERROR(On!)"; "Quit"})

CASE CALL(vChoice; {1; OffMsg; 2; OnMsg; 3; QuitMacro}; QuitMacro)

UNTIL(vChoice = 3)

LABEL(OffMsg)

ERROR(Off!)

ASSERT(ErrorCondition!) // ignore Error condition

MESSAGEBOX(x; "ERROR(Off!)"; "Error condition ignored"; IconInformation!)

RETURN

LABEL(OnMsg)

ERROR(On!)

ASSERT(ErrorCondition!) // LABEL(ErrorMsg) executed

RETURN

LABEL(ErrorMsg)

BEEP

MESSAGEBOX(x; "ERROR CONDITION"; "An error condition causes LABEL(ErrorMsg) to execute"; IconInformation!)

RETURN

LABEL(QuitMacro)

QUIT


For Example...

APPLICATION(A1; "WPPrWin"; Default; "US")

// LABEL(NotFoundMsg) executes with NOTFOUND(On!)

// Demonstrate NOTFOUND command

ONNOTFOUND(NotFoundMsg)

REPEAT

MENU(vChoice; Digit; ; ; {"NOTFOUND(Off!)"; "NOTFOUND(On!)"; "Quit"})

CASE CALL(vChoice; {1; OffMsg; 2; OnMsg; 3; QuitMacro}; QuitMacro)

UNTIL(vChoice = 3)

LABEL(OffMsg)

NOTFOUND(Off!)

ASSERT(NotFoundCondition!) // ignore Not Found condition

MESSAGEBOX(x; "NOTFOUND(Off!)"; "Not Found condition ignored"; IconInformation!)

RETURN

LABEL(OnMsg)

NOTFOUND(On!)

ASSERT(NotFoundCondition!) // LABEL(NotFoundMsg) executed

RETURN

LABEL(NotFoundMsg)

BEEP

MESSAGEBOX(x; "NOTFOUND CONDITION"; "A Not Found condition causes LABEL(NotFoundMsg) to execute"; IconInformation!)

RETURN

LABEL(QuitMacro)

QUIT


For Example...

APPLICATION(A1; "WPPrWin"; Default; "US")

// Declare and test variable types

// Demonstrate BREAK, EXISTS, LOCAL, GLOBAL, and PERSIST commands

DISCARD var5; var1; var7

LOCAL var2; var9; var4

GLOBAL var3; var10; var6

PERSIST var5; var1; var7

ASSIGN(var8; "")

FOR(x; 1; x < 11; x + 1)

ASSIGN(INDIRECT("var" + x); x)

MESSAGEBOX(vStatus; "VAR" + x; "Continue to next variable?"; IconQuestion! | YesNo!)

IF(vStatus = 7)

BREAK

ENDIF

ENDFOR

FOR(z; 1; z < (x + 1); z + 1)

SWITCH(EXISTS(INDIRECT("var" + z)))

CASEOF 1: Msg("Local"; z)

CASEOF 2: Msg("Global"; z)

CASEOF 3: Msg("Persist"; z)

ENDSWITCH

ENDFOR

FUNCTION Msg(w; y)

MESSAGEBOX(z; "VARIABLE TYPES"; "var" + y + " = " + w)

ENDFUNC


For Example...

APPLICATION(A1; "WPPrWin"; Default; "US")

// Calculate fractions and integers

// Demonstrate FRACTION and INTEGER commands

ONCANCEL(QuitMacro)

ASSIGN(HdReturn; NTOC(0F90Ah)) // hard return code

REPEAT

GETNUMBER(vNmbr; "Enter a real number:"; "FRACTION EXAMPLE")

ASSIGN(vInteger; INTEGER(vNmbr))

ASSIGN(vFraction; FRACTION(vNmbr))

vMsg1 := "The integer portion of " + vNmbr + " is " + vInteger

vMsg2 := "The fractional portion of " + vNmbr + " is " + vFraction

MESSAGEBOX(x; "INTEGER - FRACTION"; vMsg1 + HdReturn + HdReturn + vMsg2 + HdReturn; IconInformation! | RetryCancel!)

UNTIL(x = 2)

LABEL(QuitMacro)

QUIT


For Example...

APPLICATION(A1; "WPPrWin"; Default; "US")

// Remember: functions must be called to execute

// Demonstrate FUNCTION and FUNCTION PROTOTYPE commands

FUNCTION PROTOTYPE Check(vBeep; HdReturn)

HdReturn := NTOC(0F90Ah)

x := 4

vBeep := 1

WHILE(x = 4)

BEEP

x := Check(vBeep; HdReturn)

vBeep := vBeep + 1

ENDWHILE

MESSAGEBOX(z; "RETURN"; "The value of variable vStatus (" + x + ") is returned to variable x, which ends the loop."; IconExclamation!)

FUNCTION Check(vBeep; HdReturn)

MESSAGEBOX(vStatus; "FUNCTION EXAMPLE"; "Beeps: " + vBeep + HdReturn + HdReturn + "Choose Retry to beep again." + HdReturn; IconInformation! | RetryCancel!)

RETURN(vStatus)

ENDFUNC


For Example...

APPLICATION(A1; "WPPrWin"; Default; "US")

// Play .wav file

// Assume Windows sound system and that appropriate driver is installed

// Demonstrate MMPLAY and WAIT commands

No := 7

REPEAT

MENU(vWav; Digit; ; ; {"Siren"; "Crickets"; "Snoring"; "Thunder"; "Dog bark"; "Elephant"; "Quit"})

SWITCH(vWav)

CASEOF 1: PlaySound("siren.wav"; 115)

CASEOF 2: PlaySound("crickets.wav"; 50)

CASEOF 3: PlaySound("snoring.wav"; 30)

CASEOF 4: PlaySound("thunder.wav"; 30)

CASEOF 5: PlaySound("dogbark.wav"; 15)

CASEOF 6: PlaySound("elephant.wav"; 15)

CASEOF 7: QUIT

ENDSWITCH

MESSAGEBOX(vStatus; "MMPLAY"; "Would you like to hear another sound?"; IconQuestion! | YesNo!)

UNTIL(vStatus = No)

PROCEDURE PlaySound(vSound; vWait)

MMPLAY("c:\windows\sndsys\sounds\" + vSound)

WAIT(vWait)

ENDPROC


For Example...

APPLICATION(A1; "WPPrWin"; Default; "US")

// Speak an ASCII text file

// A text-to-speech driver must be installed

// Demonstrate MMSPEAK, MMSPEAKCLIPBOARD, MMSTOPSPEECH commands

REPEAT

MENU(vChoice; Digit; ; ; {"File"; "Clipboard"; "Quit"})

SWITCH(vChoice)

CASEOF 1:

GETSTRING(vStr; "Enter the path and name of a file to speak:"; "ASCII TEXT FILE")

IF(vStr = "")

BREAK

ELSE

MMSPEAK(vStr)

CancelMessage()

ENDIF

CASEOF 2:

MMSPEAKCLIPBOARD

CancelMessage()

ENDSWITCH

UNTIL(vChoice = 3)

QUIT

PROCEDURE CancelMessage()

vCancel := 2

MESSAGEBOX(vStatus; "SPEAK FILE"; "Choose Cancel any time to stop speech"; IconStop! | RetryCancel!)

IF(vStatus = vCancel)

MMSTOPSPEECH

ENDIF

ENDPROC


For Example...

APPLICATION(A1; "WPPrWin"; Default; "US")

APPLICATION(A2; "WordPerfect"; "US")

// Presentations is the default application

// AboutDlg does not require a product prefix

AboutDlg()

NEWDEFAULT(A2)

// WordPerfect is not the default application

// AboutDlg requires a product prefix (A2)

A2.AboutDlg()


For Example...

APPLICATION(A1; "WPPrWin"; Default; "US")

// Convert integer to Character equivalent

// NTOC(32) returns "space" character

// Demonstrate NTOC command

AddTextBox (1000w;9000w;12000w;8000w)

FOR(int; 33; int < 127; int + 1)

Type(NTOC(int) + (NTOC(32)))

ENDFOR

// Convert character set value to character equivalent

FOR(int; 0; int < 102; int + 1)

Type(NTOC(4; int) + (NTOC(32)))

ENDFOR

MESSAGEBOX(vAns; "NTOC command"; "Close Text Box?"; YesNo! | IconQuestion!)

IF(vAns = 6)

TextEditExit ()

ENDIF

// The first FOR loop outputs the following characters:

// ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~

// The second FOR loop outputs the following typographic symbols (character set 4):

//           ¶ § ¡ ¿ « » £ ¥     ª º ½ ¼ ¢ ²   ® © ¤ ¾ ³   ’ ‘   ” “ — –                     •                                                               ­ ¹


For Example...

APPLICATION(A1; "WPPrWin"; Default; "US")

// Play this macro from a slide show containing multiple slides

// Most type conversions are handled automatically

// The following type statements output identical character strings

// Demonstrate NUMSTR command

HdReturn := NTOC(0F90Ah)

TotalSlideNumber:= EnvNumberOfSlides

TotalSlideString:= NUMSTR(TotalSlideNumber)

MESSAGEBOX(x; "AUTOMATIC TYPE CONVERSION"; "Variable TotalCharNumber: There are " + TotalSlideNumber + " slides in this slide show." + HdReturn + HdReturn + "Variable TotalSlideString: There are " + TotalSlideString + " slides in this slide show." + HdReturn; IconInformation!)


For Example...

APPLICATION(A1; "WPPrWin"; Default; "US")

// Test Error condition

// Demonstrate ONERROR CALL command

ONERROR CALL(ErrorTest)

No := 7

REPEAT

GETNUMBER(vNmbr; "Enter 3 and press <Enter>:"; "ONERROR CALL EXAMPLE")

IF(vNmbr = 3)

MESSAGEBOX(vStatus; "YES!"; "You entered 3 as requested.  Do you want to try again?"; IconInformation! | YesNo!)

ELSE

ASSERT(ErrorCondition!)

ENDIF

UNTIL(vStatus = No)

QUIT

LABEL(ErrorTest)

BEEP

MESSAGEBOX(vStatus; "ERROR"; "You didn't enter 3 as requested"; IconExclamation!)

RETURN


For Example...

APPLICATION(A1; "WPPrWin"; Default; "US")

// Test Not Found condition

// Open view and retrieve text into the message box

// Demonstrate ONNOTFOUND command

NOTFOUND(On!)

ONNOTFOUND CALL(NotFoundTest)

No := 7

REPEAT

GETSTRING(vStr; "Enter a string to search for and press <Enter>:"; "ONNOTFOUND CALL EXAMPLE")

IF(vStr = "")

NEXT

ENDIF

vError := False

PosTextTop ()

Find(MessageSearchString: vStr; SearchDir: Forward!; MessageMatch: BeginText!)

IF(vError = False)

vMessage := "Success!  Do you want to try again?"

ELSE

vMessage := "Not Found condition.  Do you want to try again?"

ENDIF

MESSAGEBOX(vStatus; "Search"; vMessage; IconInformation! | YesNo!)

UNTIL(vStatus = No)

QUIT

LABEL(NotFoundTest)

BEEP

MESSAGEBOX(vError; "ERROR"; """" + vStr + """ not found"; IconExclamation!)

vError := True

RETURN // return to IF statement following Find command


For Example...

APPLICATION(A1; "WPPrWin"; Default; "US")

// Demonstrate PAUSE command

ONCANCEL(EndLoop)

InhibitInput(Off!)

InformationIcon := 4

x := 1

AddTextBox(1000w;9000w;12000w;8000w;)

REPEAT

Type(x + NTOC(32))

IF(x MOD 10 = 0)

PROMPT("PAUSE EXAMPLE"; "Choose OK to dismiss prompt and continue loop, or Cancel to end loop."; InformationIcon)

PAUSE

ENDIF

x := x + 1

UNTIL(x = 0)

LABEL(EndLoop)

QUIT


For Example...

// There are two macros in this example

// Compile separately

APPLICATION(A1; "WPPrWin"; Default; "US")

// Name of macro: Persist.wcm

// Demonstrate PERSIST command

// vNmbr is a Persist variable

MESSAGEBOX(x; "PERSISTALL EXAMPLE"; "The value of variable vNmbr is " + vNmbr; IconInformation!)

ASSIGN(vNmbr; 999)

RETURN

APPLICATION(A1; "WPPrWin"; Default; "US")

// Run PERSIST.WCM macro

// Demonstrate PERSISTALL command

LOCAL vStatus; vCancel

vStatus := 4

vCancel := 2

PERSISTALL // vNmbr Persist variable

REPEAT

IF(EXISTS(vNmbr))

DISCARD vNmbr

ENDIF

GETNUMBER(vNmbr; "Enter a number:"; "PERSISTALL EXAMPLE")

vMacrosPath := EnvPaths(Macros!)

RUN(vMacrosPath + "persist.wcm")

MESSAGEBOX(vStatus; "PERSISTALL EXAMPLE"; "After running PERSIST.WCM, the value of variable vNmbr is " + vNmbr; IconInformation! | RetryCancel!)

UNTIL(vStatus = vCancel)


For Example...

APPLICATION(A1; "WPPrWin"; Default; "US")

// Saves text to file

// Demonstrate SENDKEYS WAIT command

InhibitInput(Off!)

AddTextBox(1000w;9000w;12000w;8000w;)

Type("Save this message as ""test.doc"" in the default Save Directory (see PrefLocationOfFiles).")

WAIT(10)

SENDKEYS WAIT("{Alt+F}{S}test.doc{Enter}")


For Example...

APPLICATION(A1; "WPPrWin"; Default; "US")

// Demonstrate SPEED command

ONCANCEL(QuitMacro)

AddTextBox(1000w;9000w;12000w;8000w;)

Type("Press Ctrl+Shift+F10 to Cancel")

FOR(x; 1; x < 51; x + 1)

Type(x + NTOC(32))

SPEED(x/10)

IF(((x MOD 10) = 0) AND (x < 50))

Slower

ENDIF

ENDFOR

QuitMacro

LABEL(Slower)

BEEP

Type("Slower ... ")

RETURN

LABEL(QuitMacro)

MESSAGEBOX(x; "SPEED EXAMPLE"; "Counting to 50, SPEED increased the delay between counts."; IconInformation!)

QUIT


For Example...

APPLICATION(A1; "WPPrWin"; Default; "US")

// Test user input for Y or N

// For Cancel condition: chose Cancel, click Close, press Alt+F4, or double-click system menu box

// Demonstrate STRLEN command

CANCEL(On!)

ONCANCEL CALL(CancelMessage)

PROCEDURE Message(vPrompt; vIcon)

IF(vIcon = "!")

BEEP

MESSAGEBOX(y; "Message Box"; vPrompt; IconExclamation!)

ELSE

MESSAGEBOX(y; "Message Box"; vPrompt; IconInformation!)

ENDIF

ENDPROC

vStr := ""

REPEAT

GETSTRING(vStr; "Press one character: ""Y"" for Yes or ""N"" for no"; "GETSTRING - STRLEN EXAMPLE"; 50)

IF(vStr = "")

vStr := "<Enter>"

ENDIF

vTest := TOUPPER(vStr)

IF(STRLEN(vStr) > 1)

CALL Message("You typed or pressed """ + vStr + """"; "!")

ELSE

IF((vTest = "Y") OR (vTest = "N"))

CALL Message("Well done - You pressed " + vTest; "i")

ELSE

CALL Message("You pressed """ + vStr + """"; "!")

ENDIF

ENDIF

UNTIL(((vTest = "Y") OR (vTest = "N")) AND NOT(STRLEN(vStr) > 1))

QUIT

LABEL(CancelMessage)

vStr := "a Cancel control"

RETURN


For Example...

APPLICATION(A1; "WPPrWin"; Default; "US")

// Extract string of numbers and convert to numeric equivalent

// Demonstrate STRNUM command

vNumbers := ""

vPrompt := "Enter text that includes both letters and numbers:"

LABEL(Start)

GETSTRING(vStr; vPrompt; "EXTRACT NUMBERS")

IF(vStr = "")

BEEP

MESSAGEBOX(x; "ERROR"; "You pressed return without entering any text"; IconStop!)

GO(Start)

ENDIF

vLen := STRLEN(vStr)

vPos := 1

REPEAT

vTest := SUBSTR(vStr; vPos; 1)

IF((CTON(vTest) > 47) AND (CTON(vTest) < 58))

vNumbers := vNumbers + vTest

ENDIF

vPos := vPos + 1

UNTIL(vPos = vLen + 1)

IF(STRLEN(vNumbers) > 0)

vConvert := STRNUM(vNumbers)

vConvert := vConvert * 5

MESSAGEBOX(x; "STRNUM COMMAND"; vNumbers + " * 5 equals " + vConvert; IconInformation!)

ELSE

BEEP

MESSAGEBOX(x; "ERROR"; "You didn't enter any numbers"; IconExclamation!)

ENDIF


For Example...

APPLICATION(A1; "WPPrWin"; Default; "US")

// Extract string of numbers and convert to measurement equivalent

// Demonstrate STRUNIT command

Retry := 4

LABEL(Start)

vNumbers := ""

GETSTRING(vStr; "Enter text that includes both letters and numbers:"; "EXTRACT NUMBERS")

IF(vStr = "")

BEEP

MESSAGEBOX(x; "ERROR"; "You pressed return without entering any text"; IconStop!)

GO(Start)

ENDIF

vLen := STRLEN(vStr)

vPos := 1

REPEAT

vTest := SUBSTR(vStr; vPos; 1)

IF((CTON(vTest) > 47) AND (CTON(vTest) < 58))

vNumbers := vNumbers + vTest

ENDIF

vPos := vPos + 1

UNTIL(vPos = vLen + 1)

IF(STRLEN(vNumbers) > 0)

CALL(DefaultUnit)

vConvert := STRUNIT(vNumbers)

vConvert := vConvert * 5

MESSAGEBOX(x; "STRUNIT COMMAND"; vNumbers + " * 5 equals " + vConvert; IconInformation! | RetryCancel!)

IF(x = Retry)

GO(Start)

ENDIF

ELSE

BEEP

MESSAGEBOX(x; "ERROR"; "You didn't enter any numbers"; IconExclamation!)

ENDIF

QUIT

LABEL(DefaultUnit)

MENU(vChoice; Digit; ; ; {"Inches"; "Centimeters"; "Millimeters"; "Points"; "WP Units"})

SWITCH(vChoice)

CASEOF 1: DEFAULTUNITS(Inches!)

CASEOF 2: DEFAULTUNITS(Centimeters!)

CASEOF 3: DEFAULTUNITS(Millimeters!)

CASEOF 4: DEFAULTUNITS(Points!)

CASEOF 5: DEFAULTUNITS(WPUnits!)

ENDSWITCH

RETURN


For Example...

APPLICATION(A1; "WPPrWin"; Default; "US")

// Extract "Perfect" from WordPerfect and test if "program" was typed

// Demonstrate STRPOS and SUBSTR commands

vNumbers := ""

LABEL(Start)

GETSTRING(vStr; "Enter the following text: ""WordPerfect program"""; "SUBSTR AND STRPOS EXAMPLES")

IF(vStr = "")

BEEP

MESSAGEBOX(x; "ERROR"; "You pressed return without entering any text"; IconStop!)

GO(Start)

ENDIF

vSub := SUBSTR(vStr; 5; 7)

IF(vSub = "Perfect")

MESSAGEBOX(x; "SUBSTR EXAMPLE"; "WordPerfect is simply """ + vSub + """"; IconInformation!)

IF(STRPOS(vStr; "program") = 0)

BEEP

MESSAGEBOX(x; "STRPOS EXAMPLE"; "You entered ""WordPerfect"" but not ""program"""; IconExclamation!)

ENDIF

ELSE

BEEP

MESSAGEBOX(x; "ERROR"; """WordPerfect"" wasn't the first word"; IconExclamation!)

GO(Start)

ENDIF


For Example...

APPLICATION(A1; "WPPrWin"; Default; "US")

// Demonstrate TOLOWER and VARERRCHK command

HdReturn := NTOC(0F90Ah)

VARERRCHK(Off!)

FOR(x; 65; x < 91; x + 1)

// convert uppercase character to lowercase

// vLongStr not declared - no value assigned

vLongStr := vLongStr + TOLOWER(NTOC(x)) + NTOC(32)

ENDFOR

MESSAGEBOX(x; "VARERRCHK and TOLOWER"; "With VARERRCHK(On!), you would receive a run-time error message." + HdReturn + HdReturn + "vLongStr: "  + vLongStr + HdReturn; IconInformation!)


For Example...

APPLICATION(A1; "WPPrWin"; Default; "US")

// Demonstrate UNITSTR and DIALOG commands

vNmbr := 1

vStatus := 4

DIALOGDEFINE(1000; 50; 50; 100; 120; Percent! | NoTitle!| NoFrame!; "")

DIALOGADDTEXT(1000; -1; 10; 15; 75; 15; Left!; "Convert " + vNmbr + " inch to:")

DIALOGADDCHECKBOX(1000; 101; 15; 30; 100; 13; "Centimeters"; vCB1)

DIALOGADDCHECKBOX(1000; 102; 15; 45; 100; 13; "Millimeters"; vCB2)

DIALOGADDCHECKBOX(1000; 103; 15; 60; 100; 13; "Points"; vCB3)

DIALOGADDCHECKBOX(1000; 104; 15; 75; 100; 13; "WP Units"; vCB4)

DIALOGADDTEXT(1000; -2; 10; 100; 100; 15; Left!; "(Press Alt+F4 to cancel)")

DIALOGSHOW(1000; -1; Msg)

WHILE(vStatus = 4)

ENDWHILE

DIALOGDESTROY(1000)

LABEL(Msg)

IF(Msg[5] = 274)

BEEP

vStatus := 2

ENDIF

DEFAULTUNITS(Inches!)

SWITCH(Msg[3])

CASEOF 101: vResult := UNITSTR(vNmbr; Centimeters!)

Message

CASEOF 102: vResult := UNITSTR(vNmbr; Millimeters!)

Message

CASEOF 103: vResult := UNITSTR(vNmbr; Points!)

Message

CASEOF 104: vResult := UNITSTR(vNmbr; WPUnits!)

Message

ENDSWITCH

RETURN

LABEL(Message)

DIALOGUNDISPLAY(1000; "CancelBttn")

MESSAGEBOX(vStatus; "UNITSTR COMMAND"; vNmbr + " inch is converted to " + vResult; IconInformation! | RetryCancel!)

IF(vStatus = 4)

DIALOGSHOW(1000; -1; Msg)

ELSE

BEEP

ENDIF

RETURN


For Example...

// There are two macros in this example

// Compile separately: name the first MACROLIB.WCM

// A Warning Error displayed when macros compiled for the first time

//	For each warning, choose Continue Compilation.

// Demonstrate USE command

APPLICATION(A1; "WPPrWin"; Default; "US")

FUNCTION GetMsgBoxResult(x)

VARERRCHK(Off!)

BEEP

SWITCH(x)

CASEOF 1:	MESSAGEBOX(vChoice; "Macro File Library"; "Choose a button to dismiss the message box"; IconStop! | AbortRetryIgnore!)

CASEOF 2:	MESSAGEBOX(vChoice; "Macro File Library"; "Choose a button to dismiss the message box"; IconStop! | Ok!)

CASEOF 3:	MESSAGEBOX(vChoice; "Macro File Library"; "Choose a button to dismiss the message box"; IconStop! | OkCancel!)

CASEOF 4:	MESSAGEBOX(vChoice; "Macro File Library"; "Choose a button to dismiss the message box"; IconStop! | RetryCancel!)

CASEOF 5:	MESSAGEBOX(vChoice; "Macro File Library"; "Choose a button to dismiss the message box"; IconStop! | YesNo!)

CASEOF 6:	MESSAGEBOX(vChoice; "Macro File Library"; "Choose a button to dismiss the message box"; IconStop! | YesNoCancel!)

ENDSWITCH

RETURN(vChoice)

ENDFUNC

PROCEDURE DisplayMsgBoxResult(x)

MESSAGEBOX(x; "Macro File Library"; "You chose the """ + x + """ button"; IconInformation!)

ENDPROC

APPLICATION(A1; "WPPrWin"; Default; "US")

// Demonstrate USE command

VARERRCHK(Off!)

// replace default macros directory if necessary

USE("c:\prwin\macros\macrolib.wcm")

REPEAT

MENU(vResult; Digit; ; ; {"AbortRetryIgnore!"; "OK!"; "OKCancel!"; "RetryCancel!"; "YesNo!"; "YesNoCancel"; "Quit"})

SWITCH(GetMsgBoxResult(vResult))

CASEOF 1: vStatus = "OK"

CASEOF 2: vStatus = "Cancel"

CASEOF 3: vStatus = "Abort"

CASEOF 4: vStatus = "Retry"

CASEOF 5: vStatus = "Ignore"

CASEOF 6: vStatus = "Yes"

CASEOF 7: vStatus = "No"

ENDSWITCH

IF(NOT(vResult = 7))

DisplayMsgBoxResult(vStatus)

ENDIF

UNTIL(vResult = 7)


For Example...

APPLICATION(A1; "WPPrWin"; Default; "US")

// Demonstrate DIALOGADDCHECKBOX, DIALOGADDCOLORWHEEL, DIALOGADDCOMBOBOX, and DIALOGADDCOUNTER

CALL(DlgCreate)

REPEAT

MENU(vResult; Digit; ; ; {"Check box"; "Color wheel"; "Combination box"; "Counter"; "Quit"})

DisplayControls

UNTIL(vResult = 5)

CALL(QuitMacro)

LABEL(DisplayControls)

x := 0

SWITCH(vResult)

CASEOF 1: DIALOGSHOW(1000; 100; Msg)

WHILE(x = 0)

ENDWHILE

CASEOF 2: DIALOGSHOW(1001; 1)

vRed := vCW % 256

vGreen := vCW / 256 % 256

vBlue := vCW / 256 / 256

DisplayColorValues(vRed; vGreen; vBlue)

CASEOF 3: DIALOGSHOW(1002; 100)

CASEOF 4: DIALOGSHOW(1003; 100)

ENDSWITCH

RETURN

LABEL(Msg)

IF(Msg[5] = 274)

DIALOGUNDISPLAY(1000; "CancelBttn")

x := 1

ENDIF

SWITCH(Msg[3])

CASEOF 100:

DIALOGUNDISPLAY(1000; "CancelBttn")

MESSAGEBOX(x; "SEE WHAT YOU CAN DO"; "This check box is used with a callback function.  See DIALOGSHOW for details."; IconInformation!)

ENDSWITCH

RETURN

PROCEDURE DisplayColorValues(r; g; b)

MESSAGEBOX(x; "COLOR VALUES"; "The red component equals " + r + ". The green component equals " + g + ". The blue component equals " + b + "."; IconInformation!)

ENDPROC

LABEL(DlgCreate)

DIALOGDEFINE (1000; 50; 50; 120; 50; Percent! | NoFrame!; "DIALOGADDCHECKBOX")

DIALOGADDCHECKBOX(1000; 100; 10; 10; 100; 15; "Click check box"; vCB)

DIALOGDEFINE (1001; 50; 50; 125; 130; Percent! | NoFrame! | OK!; "DIALOGADDCOLORWHEEL")

DIALOGADDCOLORWHEEL(1001; 101; 10; 10; 105; 80; vCW)

DIALOGDEFINE (1002; 50; 50; 125; 115; Percent! | NoFrame!; "DIALOGADDCOMBOBOX")

DIALOGADDCOMBOBOX(1002; 100; 10; 10; 100; 50; DropDown!; var)

DIALOGADDLISTITEM(1002; 100; "DropDown! combo box")

DIALOGADDCOMBOBOX(1002; 101; 10; 40; 100; 50; Simple!; var)

DIALOGADDLISTITEM(1002; 101; "Simple! combo box")

DIALOGDEFINE (1003; 50; 50; 120; 50; Percent! | NoFrame!; "DIALOGADDCOUNTER")

var := 5

DIALOGADDCOUNTER(1003; 100; 10; 10; 50; 15; 0; var; 1; 10; 1)

RETURN

LABEL(QuitMacro)

FORNEXT(x; 1000; 4; 1)

DIALOGDESTROY(x)

ENDFOR

QUIT


For Example...

APPLICATION(A1; "WPPrWin"; Default; "US")

// Demonstrate DIALOGADDCONTROL and SENDKEYS commands

InhibitInput(Off!)

WM_SYSCOMMAND := 274

z := 0

DIALOGDEFINE (1000; 50; 50; 122; 150; Percent! | NoFrame! | OK!; "DIALOGADDCONTROL")

DIALOGADDCHECKBOX(1000; 100; 10; 10; 75; 15; "Check for demo"; vCB)

DIALOGADDCONTROL(1000; 101; 10; 40; 100; 75; "wpnslb20"; 2; ""; vListItem; 0)

A := "Apple"

B := "Apple pie"

C := "Applesauce"

D := "Banana"

E := "Banana oil"

F := "Banana seat"

G := "Banana split"

FORNEXT(x; 65; 71; 1)

DIALOGADDLISTITEM(1000; 101; INDIRECT(NTOC(x)))

ENDFOR

DIALOGSHOW(1000; 101; Msg)

WHILE(z = 0)

ENDWHILE

DIALOGDESTROY(1000)

LABEL(Msg)

IF(Msg[5] = WM_SYSCOMMAND)

z := 1

ENDIF

SWITCH(Msg[3])

CASEOF 100: Demo

CASEOF "OKBttn": DIALOGUNDISPLAY(1000; 101)

IF(STRLEN(vListItem) > 0)

ASSIGN(vSelect; "You selected """ + vListItem + """ from the list box")

ELSE

ASSIGN(vSelect; "You didn't select an item from the list box")

ENDIF

MESSAGEBOX(x; "LIST ITEM"; vSelect; IconInformation!)

z := 1

ENDSWITCH

RETURN

LABEL(Demo)

SENDKEYS WAIT("{Tab} {Up}")

FOREACH(vLetter; {"A"; "p"; "p"; "l"; "e"; "s"; "a"; "u"; "c"; "e"})

SENDKEYS WAIT(vLetter)

WAIT(3)

ENDFOR

WAIT(12)

FORNEXT(w; 1; 10; 1)

SENDKEYS WAIT("{BackSpace}")

WAIT(1)

ENDFOR

WAIT(10)

FOREACH(vLetter; {"B"; "a"; "n"; "a"; "n"; "a"; " "; "s"; "p"; "l"; "i"; "t"})

SENDKEYS WAIT(vLetter)

WAIT(3)

ENDFOR

WAIT(12)

SENDKEYS WAIT("{Tab}")

MESSAGEBOX(x; "NAME SEARCH LIST BOX"; "Enter a word from the list to experiment with WordPerfect's custom list box")

SENDKEYS WAIT("{Up}")

RETURN


For Example...

APPLICATION(A1; "WPPrWin"; Default; "US")

// Demonstrate DIALOGADDHOTSPOT and DIALOGADDICON

VARERRCHK(Off!)

Yes := 6

WM_SYSCOMMAND := 274

DialogControl := 3

DIALOGDEFINE (1000; 50; 50; 115; 85; Percent! | NoFrame!; "DIALOGADDICON" )

DIALOGADDTEXT(1000; -1; 10; 10; 50; 13; Left!; "Click an icon:")

FORNEXT(z; 1; 3; 1)

DIALOGADDICON (1000; 0; 25; z + 10 + (z * 13); 10; 8; "#" + (z+159); 0)

DIALOGADDHOTSPOT(1000; z; 25; z + 10 + (z * 13); 10; 8; Click!)

ENDFOR

DIALOGSHOW(1000; 0; Msg)

WHILE(NOT(vStatus = Yes))

ENDWHILE

DIALOGDESTROY (1000)

QUIT

LABEL(Msg)

IF(Msg[5] = WM_SYSCOMMAND)

vStatus = Yes

ENDIF

SWITCH(Msg[DialogControl])

CASEOF 1: 	MESSAGEBOX(vStatus; "DIALOGADDHOTSPOT"; "Overlap hot spots and icons to create custom controls."; IconExclamation!)

CASEOF 2:	MESSAGEBOX(vStatus; "DIALOGADDHOTSPOT"; "See WordPerfect 6.1 for Windows Software Developer's Kit for Shared Code information."; IconInformation!)

CASEOF 3:	MESSAGEBOX(vStatus; "DIALOGADDHOTSPOT"; "Are you finished with this example?"; IconQuestion! | YesNo!)

ENDSWITCH

RETURN


For Example...

APPLICATION(A1; "WPPrWin"; Default; "US")

// Demonstrate DIALOGADDFILENAMEBOX, DIALOGADDEDITBOX, and DIALOGADDVIEWER

VARERRCHK(Off!)

ASSIGN(vText; "Note that DIALOGDEFINE uses Enter2HRtn! style with this edit box control.")

DIALOGDEFINE (1000; 50; 50; 195; 225; OK! | Percent! | Enter2HRtn!; "DIALOGADDCONTROL")

DIALOGADDTEXT(1000; -1; 10; 10; 100; 15; Left!; "DIALOGADDFILENAMEBOX")

DIALOGADDFILENAMEBOX(1000; 100; 10; 20; 170; 15; FilesAndDirs!; vDir; "c:\")

DIALOGADDTEXT(1000; -2; 10; 40; 100; 15; Left!; "DIALOGADDEDITBOX")

DIALOGADDEDITBOX(1000; 101; 10; 50; 170; 50; Left! | Multiline! | WordWrap! | VScroll!; vText; 1000)

DIALOGADDTEXT(1000; -3; 10; 105; 100; 15; Left!; "DIALOGADDVIEWER")

DIALOGADDVIEWER(1000; 102; 10; 115; 170; 60; "C:\AUTOEXEC.BAT")

DIALOGSHOW(1000; 100)

DIALOGDESTROY(1000)

IF(STRLEN(vDir) = 0)

Msg("You did not enter a path or filename")

ELSE

MESSAGEBOX(x; "DIALOGADDFILENAMEBOX"; "You entered the following path or path and filename: " + vDir)

ENDIF

IF(STRLEN(vText) = 0)

Msg("You did not enter text in the edit control")

ELSE

MESSAGEBOX(x; "DIALOGADDEDITBOX"; "You entered the following text in the edit control: " + NTOC(0F90Ah) + NTOC(0F90Ah) + vText)

ENDIF

PROCEDURE Msg(x)

BEEP

MESSAGEBOX(x; "Oops!"; x; IconExclamation!)

ENDPROC


For Example...

APPLICATION(A1; "WPPrWin"; Default; "US")

// Use array SortStr to sort up to eight character strings by length

// Calculate width of dialog box from longest string and height from the number of strings

// Demonstrate DIALOGADDFRAME command

CALL(GetNumberAndStrings)

CALL(GetDimensions)

CALL(DisplaySortedStrings)

LABEL(GetNumberAndStrings)

GETNUMBER(vNmbr; "Number of strings to sort (up to eight):"; "FRAME EXAMPLE")

IF(vNmbr > 8)

vNmbr := 8

ENDIF

DECLARE StrSort[vNmbr]

FORNEXT(x; 1; vNmbr; 1)

GETSTRING(StrSort[x]; "String " + x + ":"; "SORT " + vNmbr + " STRINGS"; 50)

ENDFOR

RETURN

LABEL(GetDimensions)

vSorted := 1

WHILE(vSorted = 1)

vSorted := 0

FOR(x; 1; x < vNmbr; x + 1)

IF(STRLEN(StrSort[x]) < STRLEN(StrSort[x + 1]))

vTemp := StrSort[x]

StrSort[x] := StrSort[x + 1]

StrSort[x + 1] := vTemp

vSorted := 1

ENDIF

ENDFOR

ENDWHILE

x := 20

y := 20

w := STRLEN(StrSort[1]) + (STRLEN(StrSort[1]) * 4)

h := 13

RETURN

LABEL(DisplaySortedStrings)

DIALOGDEFINE(1000; 50; 50; w + 45; 40 + 30 * vNmbr; Percent!; "FRAME CONTROL")

FORNEXT(r; 1; vNmbr; 1)

DIALOGADDFRAME(1000; r; x - 5;  y - 5 + (r * 30) - 30; w + 10; h + 7; Frame! | Gray!)

DIALOGADDTEXT(1000; 0; x; y + (r * 30) - 30; w; h; Center!; TOUPPER(StrSort[r]))

ENDFOR

DIALOGSHOW(1000; 1)

DIALOGDESTROY(1000)

QUIT


For Example...

APPLICATION(A1; "WPPrWin"; Default; "US")

// Demonstrate group controls and buttons

VARERRCHK(Off!)

DIALOGDEFINE(1000; 50; 50; 200; 140; Percent!; "GROUP CONTROLS AND BUTTONS")

DIALOGADDGROUPBOX(1000; -1; 10; 10; 75; 55; "Radio Buttons")

DIALOGADDRADIOBUTTON(1000; 100; 25; 25; 50; 15; "Example 1"; vRadio1)

DIALOGADDRADIOBUTTON(1000; 101; 25; 45; 50; 15; "Example 2"; vRadio2)

DIALOGADDVLINE(1000; -2; 125; 15; 55)

DIALOGADDPOPUPBUTTON(1000; 102; 135; 35; 50; 13; vPopup)

DIALOGADDLISTITEM(1000; 102; "Popup 1")

DIALOGADDLISTITEM(1000; 102; "Popup 2")

DIALOGADDLISTITEM(1000; 102; "Popup 3")

DIALOGADDHLINE(1000; -3; 10; 85; 175)

DIALOGADDPUSHBUTTON(1000; 103; 15; 95; 165; 13; DefaultBttn!; "Cancel")

DIALOGSHOW(1000; 103)

IF(vRadio1 <> 0)

vMessage := "You selected radio button 1. "

ELSE

IF(vRadio2 <> 0)

vMessage := "You selected radio button 2. "

ELSE

vMessage := "You didn't select a radio button. "

ENDIF

ENDIF

vMessage := vMessage + "You selected " + vPopup + ". "

IF(MacroDialogResult = 103)

vMessage := vMessage + "You chose Cancel to close the dialog box."

MESSAGEBOX(x; "MESSAGE BOX"; vMessage; IconInformation!)

ELSE

BEEP

MESSAGEBOX(x; "MESSAGE BOX"; "You chose a system command to close the dialog box"; IconExclamation!)

ENDIF

DIALOGDESTROY(1000)


For Example...

APPLICATION(A1; "WPPrWin"; Default; "US")

// Demonstrate DIALOGADDLISTBOX and DIALOGADDLISTITEM

DECLARE Fruit[5]

y := 10

DIALOGDEFINE(1000; 50; 50; 122; 155; OK! | Percent! | NoFrame!; "SORTED LIST BOX")

FOREACH(vList; {"Apples"; "Oranges"; "Bananas"; "Grapes"; "Pears"})

DIALOGADDTEXT(1000; 0; 10; y; 30; 15; Left!; vList)

DIALOGADDHOTSPOT(1000; y; 10; y; 30; 9; Click!)

FRUIT[y/10] := vList

y := y + 10

ENDFOR

DIALOGADDLISTBOX(1000; 103; 50; 10; 60; 50; Sorted!; vChoice)

DIALOGADDTEXT(1000; 0; 10; 75; 102; 35; Left! | RecessBox!; "Click a ""fruit"" to display in the list box.  Click a list box item and choose OK when finished.")

DIALOGSHOW(1000; 102; Msg)

Stop  := 0

WHILE(Stop = 0)

ENDWHILE

DIALOGDESTROY(1000)

IF(vChoice = "")

vMessage := "You didn't select a list box item " + vChoice

ELSE

vMessage := "You selected " + vChoice

ENDIF

MESSAGEBOX(x; "LIST BOX CHOICE"; vMessage; IconInformation!)

QUIT

LABEL(Msg)

IF(Msg[5] = 274)

Stop := 1

ENDIF

SWITCH(Msg[3])

CASEOF 10: DIALOGADDLISTITEM(1000; 103; Fruit[1])

CASEOF 20: DIALOGADDLISTITEM(1000; 103; Fruit[2])

CASEOF 30: DIALOGADDLISTITEM(1000; 103; Fruit[3])

CASEOF 40: DIALOGADDLISTITEM(1000; 103; Fruit[4])

CASEOF 50: DIALOGADDLISTITEM(1000; 103; Fruit[5])

CASEOF "OKBttn":

DIALOGUNDISPLAY(1000; "OKBttn")

Stop := 1

ENDSWITCH

RETURN


For Example...

APPLICATION(A1; "WPPrWin"; Default; "US")

// Demonstrate DIALOGADDSCROLLBAR command with callback function

SB_LINEUP := 0

SB_LINEDOWN := 1

WM_SYSCOMMAND := 274

WM_HSCROLL := 276

DIALOGDEFINE(1000; 50; 50; 125; 70; Percent!; "SCROLL BAR")

DIALOGADDTEXT(1000; -1; 10; 10; 100; 15; Center! | RecessBox!; "Click the left or right arrow")

DIALOGADDSCROLLBAR(1000; "Scroll"; 10; 30; 100; 0; Left! | HScroll!; BarPos; 1; 3)

DIALOGSHOW(1000; "Scroll"; Msg)

Stop := 1

WHILE(Stop = 1)

ENDWHILE

DIALOGDESTROY(1000)

QUIT

LABEL(Msg)

SWITCH(Msg[5])

CASEOF WM_SYSCOMMAND: Stop := 0

CASEOF WM_HSCROLL: CALL(Scroll)

ENDSWITCH

RETURN

LABEL(Scroll)

SWITCH(Msg[6])

CASEOF SB_LINEUP:

MESSAGEBOX(x; "CALLBACK FUNCTION"; "You clicked the left arrow"; IconInformation!)

CASEOF SB_LINEDOWN:

MESSAGEBOX(x; "CALLBACK FUNCTION"; "You clicked the right arrow"; IconInformation!)

ENDSWITCH

RETURN


For Example...

APPLICATION(A1; "WPPrWin"; Default; "US")

// Returns the handle of five push button controls

// Demonstrate DIALOGHANDLE command

VARERRCHK(Off!)

DIALOGDEFINE(1000; 50; 50; 100; 190; Percent!; "DIALOGHANDLE")

FORNEXT(x; 1; 5; 1)

DIALOGADDPUSHBUTTON(1000; x; 10; x + (x * 20) - 10; 75; 15; NonDefaultBttn!; "Button " + x)

ENDFOR

DIALOGADDTEXT(1000; -1; 10; 120; 75; 40; RecessBox! | Left!; "Press Enter, or choose Close from the system menu box.")

DIALOGSHOW(1000; 1)

vResult := ""

FOREACH(vControl; {"1"; "2"; "3"; "4"; "5"})

vResult := vResult + "Button " + vControl + ": "

DIALOGHANDLE(vHandles; 1000; vControl)

vResult := vResult + vHandles + ".  "

ENDFOR

MESSAGEBOX(x; "CONTROL HANDLES"; vResult)

DIALOGDESTROY(1000)


For Example...

APPLICATION(A1; "WPPrWin"; Default; "US")

// Purpose: Use BIFWrite to set the default macros directory

ONCANCEL(CheckDirectoryName)

LABEL(Start)

BIFREAD(vStatus; "WPPrWin"; "Locations of Files"; "Macros"; vMacroDir; AnsiString!)

CALL(CheckStatus)

CALL(WriteToBIF)

CALL(CheckDirectoryName)

LABEL(CheckStatus)

SWITCH(vStatus)

CASEOF(-1): vMessage := "Item types do not match"

CASEOF(-2): vMessage := "Length of Group, Section, or Item exceeds buffer size"

CASEOF(-3): vMessage := "Requested Group, Section, or Item not found"

CASEOF(-4): vMessage := "Unknown error occurred"

DEFAULT: RETURN

ENDSWITCH

BEEP

MESSAGEBOX(x; "ERROR"; vMessage; IconExclamation!)

QUIT

LABEL(WriteToBIF)

GETSTRING(vStr; "Current directory: " + TOUPPER(vMacroDir) + NTOC(0F90Ah) + "Length: " + vStatus + " bytes" + NTOC(0F90Ah)  + NTOC(0F90Ah) + "Type the path and name of a new macros directory:"; "Default Macros Directory")

IF(vStr = "")

ASSERT(CancelCondition!)

ENDIF

BIFWRITE(vStatus; "WPPrWin"; "Location of Files"; "Macros"; vStr; AnsiString!)

RETURN

LABEL(CheckDirectoryName)

BEEP

IF(NOT(vStr = ""))

vDir := vStr

ELSE

vDir := vMacroDir

ENDIF

MESSAGEBOX(x; "Default Macros Directory"; "The default macros directory is " + TOUPPER(vDir); IconStop! | RetryCancel!)

IF(x = 4)

GO(Start)

ELSE

QUIT

ENDIF


For Example...

APPLICATION(A1; "WPPrWin"; Default; "US")

// Create a BIF file with five groups, sections, items, and item values

// Demonstrate BIFWRITE command

VARERRCHK(Off!)

HdRtrn := NTOC(0F90Ah)

vMacroPath := EnvPaths(Macros!)

vFile := vMacroPath + "test.bif"

FORNEXT(x; 1; 5; 1)

BIFWRITE(vStatus; "Group " + x; "Section " + x; "Item " + x; "Value " + x; WPWordString!; 0; vFile)

ENDFOR

ASSIGN(hBIF; APPLOCATE("BIF Edit*"))

IF(hBIF)

APPACTIVATE(hBIF)

ELSE

ASSIGN(vResult; APPEXECUTEEXT("c:\wpc20\bifed20.exe"; 1))

ENDIF

IF(vResult > 31)

// replace default macros directory if necessary

SENDKEYS WAIT("{Alt + F}Oc:\wpcorp\houston\macros\test.bif {Enter}{Enter}{Down}{Enter}{Down}")

MESSAGEBOX(x; "BIFWRITE COMMAND"; "After you close the message box, double-click another" + HdRtrn + "Group, Section, or Item." + HdRtrn + HdRtrn + "Click Help for more information about BIF Edit."; IconInformation!)

ELSE

BEEP

MESSAGEBOX(x; "ERROR"; "Cannot execute BIFED20.EXE.  Check the path and modify if necessary."; IconExclamation!)

QUIT

ENDIF


For Example...

APPLICATION(A1; "WPPrWin"; Default; "US")

// This example uses the BIF created with the BIFWRITE example

// Demonstrate BIFREAD command

ONCANCEL(QuitMacro)

VARERRCHK(Off!)

REPEAT

GETNUMBER(vNmbr; "Type the number (1-5) of a group to read:" "BIFREAD COMMAND")

IF((vNmbr > 5) OR (vNmbr < 1))

BEEP

NEXT

ENDIF

// replace default macros directory if necessary

BIFREAD(vResult; "Group " + vNmbr; "Section " + vNmbr; "Item " + vNmbr; vItemValue; WPWordString!; ; ; "c:\wpoffice40\macros\test.bif")

IF(vResult < 0)

BEEP

MESSAGEBOX(x; "ERROR"; "Unknown error occurred"; IconExclamation!)

QUIT

ELSE

MESSAGEBOX(x; "Item Value"; "The value of Group, Section, and Item " + vNmbr + " is: " + vItemValue; IconInformation! | RetryCancel!)

ENDIF

UNTIL(x = 2)

LABEL(QuitMacro)

QUIT


For Example...

APPLICATION(A1; "WPPrWin"; Default; "US")

// Demonstrate BIFFILEPATH command

HdRtrn := NTOC(0F90Ah)

BIFFILEPATH(vPrivate; Private!)

BIFFILEPATH(vPublic; Public!)

MESSAGEBOX(x; "BIFFILEPATH COMMAND"; "Private BIF path and filename: " + vPrivate + HdRtrn + HdRtrn + "Public BIF path and filename: " + vPublic; IconInformation!)


For Example...

APPLICATION(A1; "WPPrWin"; Default; "US")

// This example uses the BIF created with the BIFWRITE example

// Demonstrate BIFINFO command

VARERRCHK(Off!)

HdRtrn := NTOC(0F90Ah)

BIFINFO(vStatus; "Group 1"; "Section 1"; "Item 1"; vDate; vFlags; vLength; vType; vCount; ; "c:\prwin\macros\test.bif")

MESSAGEBOX(x; "BIFINFO COMMAND - Test.bif file"; "Date/time created: " + vDate + HdRtrn + HdRtrn + "Flags: " + vFlags + HdRtrn + HdRtrn + "Length of item: " + vLength + HdRtrn + HdRtrn + "Item type: " + vType + HdRtrn + HdRtrn + "Count: " + vCount + HdRtrn)


For Example...

// Create a DOS or Windows dialog box

// Demonstrate IFPLATFORM command

// compile on DOS platform

IFPLATFORM(DOS)

DLGCREATE(x; "TITLE"; DLGNoCancel!;;;30;14)

DLGCONTROL(CtrlRadioButton!;a;"Letter";StyInitial!;4;4;;2)

DLGCONTROL(CtrlRadioButton!;b;"Itinerary";;4;6;;2)

DLGCONTROL(CtrlRadioButton!;c;"Memo";;4;8;;2)

DLGCONTROL(CtrlRadioButton!;d;"Fax";;4;10;;2)

DLGEND

SWITCH(1)

CASEOF a: BEEP

CASEOF b: BEEP

CASEOF c: BEEP

CASEOF d: BEEP

ENDSWITCH

ENDIFPLATFORM

// compile on Windows platform

IFPLATFORM(WIN)

APPLICATION(A1; "WPPrWin"; Default; "US")

DIALOGDEFINE(1000; 50; 50; 100; 125; Style:OK!; Caption:"TITLE")

DIALOGADDRADIOBUTTON(1000; 1; 10; 10; 75; 15; ButtonText:"Letter"; a)

DIALOGADDRADIOBUTTON(1000; 2; 10; 25; 75; 15; ButtonText:"Itinerary"; b)

DIALOGADDRADIOBUTTON(1000; 3; 10; 40; 75; 15; ButtonText:"Memo"; c)

DIALOGADDRADIOBUTTON(1000; 4; 10; 55; 75; 15; ButtonText:"Fax"; d)

DIALOGSHOW(1000; 1)

SWITCH(1)

CASEOF a: vMsg := "Letter"

CASEOF b: vMsg := "Itinerary"

CASEOF c: vMsg := "Memo"

CASEOF d: vMsg := "Fax"

ENDSWITCH

MESSAGEBOX(x; "Selection"; vMsg; IconInformation!)

DIALOGDESTROY(1000)

ENDIFPLATFORM


For Example...

APPLICATION(A1; "WPPrWin"; Default; "US")

// Compiling this macro produces a compile-time syntax error

// To compile, make the second AboutDlg a comment (//)

// Demonstrate ENDAPP command

AboutDlg

ENDAPP(A1)

AboutDlg


MENULIST

This command is included for DOS compatibility.  The windows equivalent is MENU.


NEST

This command is included for DOS compatibility.  The windows equivalent is RUN.


For Example...

APPLICATION(WP; "WPPrWin"; Default; "US")

// Demonstrate DIALOGDISPLAY command

HRt = NTOC(0F90Ah)

HSp = "     "

vCombo = "Combo item 1"

vList = "List item 1"

WM_COMMAND = 273

WM_SYSCOMMAND = 274

DIALOGDEFINE(1000; 50; 50; 160; 125; Percent! | NoFrame! | Cancel!; "WM_COMMAND")

DIALOGADDLISTBOX(1000; 100; 10; 10; 60; 30; Sorted!; vList)

DIALOGADDLISTITEM(1000; 100; "List item 1")

DIALOGADDLISTITEM(1000; 100; "List item 2")

DIALOGADDLISTITEM(1000; 100; "List item 3")

DIALOGADDCOMBOBOX(1000; 101; 10; 50; 60; 40; Droplist!; vCombo; 100)

DIALOGADDLISTITEM(1000; 101; "Combo item 1")

DIALOGADDLISTITEM(1000; 101; "Combo item 2")

DIALOGADDLISTITEM(1000; 101; "Combo item 3")

DIALOGADDPOPUPBUTTON(1000; 102; 10; 80; 60; 15; vPopup)

DIALOGADDLISTITEM(1000; 102; "Popup item 1")

DIALOGADDLISTITEM(1000; 102; "Popup item 2")

DIALOGADDLISTITEM(1000; 102; "Popup item 3")

DIALOGADDPUSHBUTTON(1000; 103; 100; 10; 50; 15; NonDefaultBttn!; "Push Button")

DIALOGADDRADIOBUTTON(1000; 104; 100; 35; 50; 15; "Radio"; vRadio)

DIALOGADDCHECKBOX(1000; 105; 100; 60; 50; 15; "Check box"; vCheck)

DIALOGHANDLE(hButton; 1000; 103)

DIALOGHANDLE(hRadio; 1000; 104)

DIALOGHANDLE(hCheck; 1000; 105)

DIALOGDISPLAY(1000; 1; Msg)

x := 0

While(x = 0)

Endwhile

DIALOGDESTROY(1000)

LABEL(MSG)

IF((Msg[5] = WM_SYSCOMMAND) OR (Msg[3] = "CancelBttn"))

BEEP

x = 1

RETURN

ENDIF

IF(Msg[5] = WM_COMMAND)

lParam = Msg[7]

DIALOGUNDISPLAY(1000; 1)

MsgBox

DIALOGDISPLAY(1000; 1; Msg)

ENDIF

RETURN

LABEL(MsgBox)

SWITCH(LOWRD(lParam))

CASEOF hButton: vHandle = hButton

CASEOF hRadio: vHandle = hRadio

CASEOF hCheck: vHandle = hCheck

DEFAULT: vHandle = "N/A"

ENDSWITCH

Lo = "Low-word: " + LOWRD(lParam) + HRt + HRt

Hi = "High-word: " + HIWRD(lParam) + HRt + HRt

Handle = "Control handle: " + vHandle + HRt + HRt

ListItems = "Selected list items:" + HRt + HRt + HSp + vPopup + HRt + HSp + vList + HRt + HSp + vCombo + HRt

MESSAGEBOX(vResult; "WM_COMMAND"; Hi + Lo + Handle + ListItems)

RETURN

FUNCTION LOWRD(lo)

lo = lo & 65535

Return(lo)

ENDFUNC

FUNCTION HIWRD(hi)

hi = hi >> 16

RETURN(hi)

ENDFUNC


For Example...

Example not available at this time.


For Example...

APPLICATION(WP; "WordPerfect"; Default; "US")

// MACWRITE.WCM

// Start up process for writing a Presentations macro in WordPerfect 6.1

ONERROR(Stop)

CALL(Font)

CALL(Margins)

CALL(Setup)

QUIT

LABEL(Font)

Display(On!)

FileNew

Font(Name: "Arial Regular"; Family: FamilyHelvetica!; Attributes: FontMatchNormal!; Weight: 90; Width: WidthUnknown!; Source: DRSFile!; Type: TrueType!; CharacterSet: FontMatchASCII!)

FontSize(11p)

RETURN

LABEL(Margins)

MarginTop(0.5")

MarginBottom(0.5")

MarginLeft(0.5")

MarginRight(0.5")

RETURN

LABEL(Setup)

MacroEditControlBar

ViewDraft

ZoomToMarginWidth

Type("APPLICATION(WP; ""WPPrWin""; Default; ""US"")")

HardReturn

Type("// Purpose: ")

FileSaveAsDlg

RETURN

LABEL(Stop)

BEEP

MESSAGEBOX(x;"WARNING";"Did you save the macro?"; IconExclamation!)

QUIT


For Example...

APPLICATION(WP; "WPPrWin"; Default; "US")

// Demonstrate DIMENSIONS command

HRt = NTOC(0F90Ah)

DECLARE array[4; 2; 5]

v1 = DIMENSIONS(array[])

v2 = DIMENSIONS(array[]; 0)

v3 = DIMENSIONS(array[]; 1)

v4 = DIMENSIONS(array[]; 2)

v5 = DIMENSIONS(array[]; 3)

v6 = DIMENSIONS(array[]; 4)

v7 = DIMENSIONS(c)

v8 = DIMENSIONS(b[])

vMsg = v1 + HRt + v2 + HRt + v3 + HRt + v4 + HRt + v5 + HRt + v6 + HRt + v7 + HRt + v8

MESSAGEBOX(x; "DIMENSIONS"; "Variables v1 - v8 values:" + Hrt + Hrt + vMsg)


For Example...

APPLICATION(WP; "WPPrWin"; Default; "US")

// Demonstrate REGIONADDLISTITEM command

Loop = 1

ListItem = 1

WM_SYSCOMMAND = 274

DIALOGDEFINE(1000; 50; 50; 107; 125; Percent! | NoFrame!; "RegionAddListItem")

DIALOGADDFRAME(1000; 100; 10; 10; 10; 10; Frame! | Filled! | Gray!)

DIALOGADDHOTSPOT(1000; 101; 10; 10; 10; 10; Click!)

DIALOGADDTEXT(1000; 0; 28; 10; 75; 15; Left!; "Click to add list item")

DIALOGADDLISTBOX(1000; 102; 10; 35; 85; 75; Sorted!; var)

DIALOGSHOW(1000; 101; Msg)

WHILE(Loop = 1)

ENDWHILE

DIALOGDESTROY(1000)

QUIT

LABEL(Msg)

IF(Msg[5] = WM_SYSCOMMAND)

Loop = 0

ENDIF

IF(Msg[3] = 101)

AddListBoxItem

ENDIF

RETURN

LABEL(AddListBoxItem)

vItem = "Item " + ListItem

REGIONADDLISTITEM("1000.102"; vItem)

ListItem = ListItem + 1

RETURN


For Example...

APPLICATION(WP; "WPPrWin"; Default; "US")

// Command: REGIONENABLEWINDOW

Loop = 1

WM_SYSCOMMAND = 274

vDisable = 1

DIALOGDEFINE(1000; 50; 50; 155; 75; Percent! | NoFrame!; "RegionEnableWindow")

DIALOGADDFRAME(1000; 100; 10; 10; 10; 10; Frame! | Filled! | Gray!)

DIALOGADDHOTSPOT(1000; 101; 10; 10; 10; 10; Click!)

DIALOGADDTEXT(1000; 0; 28; 10; 125; 15; Left!; "Click to disable/enable check box")

DIALOGADDCHECKBOX(1000; 102; 55; 30; 50; 15; "Check box"; var)

DIALOGSHOW(1000; 101; Msg)

WHILE(Loop = 1)

ENDWHILE

DIALOGDESTROY(1000)

QUIT

LABEL(Msg)

IF(Msg[5] = WM_SYSCOMMAND)

Loop = 0

ENDIF

IF(Msg[3] = 101)

IF(vDisable = 1)

REGIONENABLEWINDOW("1000.102"; Disable!)

vDisable = 0

ELSE

REGIONENABLEWINDOW("1000.102"; Enable!)

vDisable = 1

ENDIF

ENDIF

RETURN


For Example...

APPLICATION(WP; "WPPrWin"; Default; "US")

// Demonstrate REGIONGETCHECK command

Loop = 1

WM_SYSCOMMAND = 274

DIALOGDEFINE(1000; 20; 30; 135; 75; NoFrame!; "RegionGetCheck")

DIALOGADDFRAME(1000; 100; 10; 10; 10; 10; Frame! | Filled! | Gray!)

DIALOGADDHOTSPOT(1000; 101; 10; 10; 10; 10; Click!)

DIALOGADDTEXT(1000; 0; 28; 10; 125; 15; Left!; "Click to get check box state")

DIALOGADDCHECKBOX(1000; 102; 30; 35; 20; 15; "1"; var)

DIALOGADDCHECKBOX(1000; 103; 60; 35; 20; 15; "2"; var)

DIALOGADDCHECKBOX(1000; 104; 90; 35; 20; 15; "3"; var)

DIALOGSHOW(1000; 101; Msg)

WHILE(Loop = 1)

ENDWHILE

DIALOGDESTROY(1000)

QUIT

LABEL(Msg)

IF(Msg[5] = WM_SYSCOMMAND)

Loop = 0

ENDIF

IF(Msg[3] = 101)

REGIONGETCHECK(vChk1; "1000.102")

REGIONGETCHECK(vChk2; "1000.103")

REGIONGETCHECK(vChk3; "1000.104")

FORNEXT(x; 1; 3; 1)

IF(INDIRECT("vChk" + x) = 1)

ASSIGN(INDIRECT("vChk" + x); "selected")

ELSE

ASSIGN(INDIRECT("vChk" + x); "not selected")

ENDIF

ENDFOR

MESSAGEBOX(vYesNo; "Check Box State"; "1: " + vChk1 + NTOC(0F90Ah) + "2: " + vChk2 + NTOC(0F90Ah) + "3: " + vChk3)

ENDIF

RETURN


For Example...

APPLICATION(WP; "WPPrWin"; Default; "US")

// Demonstrate REGIONGETSELECTEDTEXT command

Loop = 1

lParam = 7

WM_SYSCOMMAND = 274

DIALOGDEFINE(1000; 20; 30; 107; 125; NoFrame!; "RegionGetSelectedText")

DIALOGADDTEXT(1000; 0; 0; 15; 107; 15; Center!; "Select a fruit")

DIALOGADDLISTBOX(1000; 102; 10; 35; 85; 75; Sorted!; var)

FOREACH(vList; {"Apples"; "Bananas"; "Oranges"; "Grapes"; "Pears"; "Corn"})

DIALOGADDLISTITEM(1000; 102; vList)

ENDFOR

DIALOGHANDLE(hItem; 1000; 102)

DIALOGSHOW(1000; 102; Msg)

WHILE(Loop = 1)

ENDWHILE

DIALOGDESTROY(1000)

QUIT

LABEL(Msg)

IF(Msg[5] = WM_SYSCOMMAND)

Loop = 0

ENDIF

IF(LWORD(Msg[lParam]) = hItem)

REGIONGETSELECTEDTEXT(vSelectItem; "1000.102")

IF(vSelectItem = "Corn")

BEEP

MESSAGEBOX(z; "Error"; "You didn't select a fruit!"; IconExclamation!)

ELSE

MESSAGEBOX(z; "List Box Item"; "You selected " + vSelectItem)

ENDIF

ENDIF

RETURN

FUNCTION LWORD(vNum)

vNum = vNum & 65535

RETURN(vNum)

ENDFUNC


For Example...

APPLICATION(WP; "WPPrWin"; Default; "US")

// Demonstrate REGIONAGETWINDOWTEXT command

Loop = 1

WM_SYSCOMMAND = 274

DIALOGDEFINE(1000; 50; 50; 158; 50; Percent! | NoFrame!; "RegionGetWindowText")

DIALOGADDFRAME(1000; 100; 10; 10; 10; 10; Frame! | Filled! | Gray!)

DIALOGADDHOTSPOT(1000; 101; 10; 10; 10; 10; Click!)

DIALOGADDTEXT(1000; 0; 28; 10; 125; 15; Left!; "Click to retrieve the caption bar title")

DIALOGSHOW(1000; 101; Msg)

WHILE(Loop = 1)

ENDWHILE

DIALOGDESTROY(1000)

QUIT

LABEL(Msg)

IF(Msg[5] = WM_SYSCOMMAND)

Loop = 0

ENDIF

IF(Msg[3] = 101)

GetTitle

ENDIF

RETURN

LABEL(GetTitle)

REGIONGETWINDOWTEXT(vTitle; "1000")

MESSAGEBOX(x; "Region Commands"; "The caption bar title is " + vTitle; IconInformation!)

Loop = 0

RETURN


For Example...

APPLICATION(WP; "WPPrWin"; Default; "US")

// Demonstrate REGIONMOVEWINDOW command

Loop = 1

WM_SYSCOMMAND = 274

DIALOGDEFINE(1000; 20; 40; 135; 75; NoFrame!; "RegionMoveWindow")

DIALOGADDCHECKBOX(1000; 101; 10; 10; 75; 15; "Click to start demo"; var)

DIALOGSHOW(1000; 101; Msg)

WHILE(Loop = 1)

ENDWHILE

DIALOGDESTROY(1000)

QUIT

LABEL(Msg)

IF(Msg[5] = WM_SYSCOMMAND)

Loop = 0

ENDIF

IF(Msg[3] = 101)

REGIONSHOWWINDOW("1000.101"; Hide!)

FORNEXT(x; 50; 190; 10)

REGIONMOVEWINDOW("1000"; 20; x; 135; 75)

WAIT(.5)

ENDFOR

FORNEXT(x; 50; 190; 10)

REGIONMOVEWINDOW("1000"; x; 190; 135; 75)

WAIT(.5)

ENDFOR

FORNEXT(x; 190; 40; -10)

REGIONMOVEWINDOW("1000"; 200; x; 135; 75)

WAIT(.5)

ENDFOR

FORNEXT(x; 190; 40; -10)

REGIONMOVEWINDOW("1000"; x; 40; 135; 75)

WAIT(.5)

ENDFOR

WAIT(.5)

REGIONMOVEWINDOW("1000"; 20; 40; 300; 225)

DIALOGADDTEXT(1000; 102; 0; 15; 300; 15; Center!; "Finished")

FORNEXT(x; 20; 100; 5)

REGIONMOVEWINDOW("1000.102"; 0; x; 300; 15)

WAIT(.9)

ENDFOR

ENDIF

RETURN


For Example...

APPLICATION(WP; "WPPrWin"; Default; "US")

// Demonstrate REGIONREMOVELISTITEM command

Loop = 1

lParam = 7

WM_SYSCOMMAND = 274

DIALOGDEFINE(1000; 50; 50; 107; 125; Percent! | NoFrame!; "RegionRemoveListItem")

DIALOGADDTEXT(1000; 0; 0; 15; 107; 15; Center!; "Select a fruit to delete")

DIALOGADDLISTBOX(1000; 102; 10; 35; 85; 75; Sorted!; var)

FOREACH(vList; {"Apples"; "Bananas"; "Oranges"; "Grapes"; "Pears"; "Watermelon"; "Grapefruit"; "Peaches"})

DIALOGADDLISTITEM(1000; 102; vList)

ENDFOR

DIALOGHANDLE(hItem; 1000; 102)

DIALOGSHOW(1000; 102; Msg)

WHILE(Loop = 1)

ENDWHILE

DIALOGDESTROY(1000)

QUIT

LABEL(Msg)

IF(Msg[5] = WM_SYSCOMMAND)

Loop = 0

ENDIF

IF(LWORD(Msg[lParam]) = hItem)

REGIONGETSELECTEDTEXT(vSelectItem; "1000.102")

REGIONREMOVELISTITEM("1000.102"; vSelectItem)

ENDIF

RETURN

FUNCTION LWORD(vNum)

vNum = vNum & 65535

RETURN(vNum)

ENDFUNC


For Example...

APPLICATION(WP; "WPPrWin"; Default; "US")

// Demonstrate REGIONRESETLIST command

Loop = 1

Yes = 6

WM_SYSCOMMAND = 274

DIALOGDEFINE(1000; 20; 20; 107; 125; NoFrame!; "RegionResetList")

DIALOGADDFRAME(1000; 100; 10; 10; 10; 10; Frame! | Filled! | Gray!)

DIALOGADDHOTSPOT(1000; 101; 10; 10; 10; 10; Click!)

DIALOGADDTEXT(1000; 0; 28; 10; 75; 15; Left!; "Click to clear list")

DIALOGADDLISTBOX(1000; 102; 10; 35; 85; 75; Sorted!; var)

CALL(AddItems)

DIALOGSHOW(1000; 101; Msg)

WHILE(Loop = 1)

ENDWHILE

DIALOGDESTROY(1000)

QUIT

LABEL(Msg)

IF(Msg[5] = WM_SYSCOMMAND)

Loop = 0

ENDIF

IF(Msg[3] = 101)

REGIONRESETLIST("1000.102")

MESSAGEBOX(vResult; "Macro Example"; "Do you want to start over?"; IconQuestion! | YesNo!)

IF(vResult = Yes)

CALL(AddItems)

ELSE

Loop = 0

ENDIF

ENDIF

RETURN

LABEL(AddItems)

FOREACH(vList; {"Apples"; "Bananas"; "Oranges"; "Grapes"; "Pears"})

DIALOGADDLISTITEM(1000; 102; vList)

ENDFOR

RETURN


For Example...

APPLICATION(WP; "WPPrWin"; Default; "US")

// Demonstrate REGIONSELECTLISTITEM command

Loop = 1

lParam = 7

WM_SYSCOMMAND = 274

DIALOGDEFINE(1000; 50; 50; 205; 125; Percent! | NoFrame!; "RegionSelectListItem")

DIALOGADDTEXT(1000; 0; 0; 15; 107; 15; Center!; "Select a fruit")

DIALOGADDLISTBOX(1000; 100; 11; 35; 85; 75; Sorted!; var)

DIALOGADDLISTBOX(1000; 101; 108; 35; 85; 75; UnSorted!; var)

FOREACH(vList; {"Oranges"; "Grapes"; "Apples"; "Pears"; "Watermelon"; "Grapefruit"; "Peaches"; "Bananas"})

DIALOGADDLISTITEM(1000; 100; vList)

DIALOGADDLISTITEM(1000; 101; vList)

ENDFOR

DIALOGHANDLE(hItem; 1000; 100)

DIALOGSHOW(1000; 100; Msg)

WHILE(Loop = 1)

ENDWHILE

DIALOGDESTROY(1000)

QUIT

LABEL(Msg)

IF(Msg[5] = WM_SYSCOMMAND)

Loop = 0

ENDIF

IF(LWORD(Msg[lParam]) = hItem)

REGIONGETSELECTEDTEXT(vSelectItem; "1000.100")

REGIONSELECTLISTITEM("1000.101"; vSelectItem)

ENDIF

RETURN

FUNCTION LWORD(vNum)

vNum = vNum & 65535

RETURN(vNum)

ENDFUNC


For Example...

APPLICATION(WP; "WPPrWin"; Default; "US")

// Demonstrate REGIONSETCHECK command

Loop = 1

WM_SYSCOMMAND = 274

vCheck = 1

DIALOGDEFINE(1000; 50; 50; 160; 75; Percent! | NoFrame!; "RegionSetCheck")

DIALOGADDFRAME(1000; 100; 10; 10; 10; 10; Frame! | Filled! | Gray!)

DIALOGADDHOTSPOT(1000; 101; 10; 10; 10; 10; Click!)

DIALOGADDTEXT(1000; 0; 28; 10; 125; 15; Left!; "Click to select/deselect check box")

DIALOGADDCHECKBOX(1000; 102; 60; 35; 50; 15; "Check Box"; var)

DIALOGSHOW(1000; 101; Msg)

WHILE(Loop = 1)

ENDWHILE

DIALOGDESTROY(1000)

QUIT

LABEL(Msg)

IF(Msg[5] = WM_SYSCOMMAND)

Loop = 0

ENDIF

IF(Msg[3] = 101)

IF(vCheck = 1)

REGIONSETCHECK("1000.102"; Check!)

vCheck = 0

ELSE

REGIONSETCHECK("1000.102"; UnCheck!)

vCheck = 1

ENDIF

ENDIF

RETURN


For Example...

APPLICATION(WP; "WPPrWin"; Default; "US")

// Demonstrate REGIONSETFOCUS command

Loop = 1

lParam = 7

WM_SYSCOMMAND = 274

DIALOGDEFINE(1000; 20; 30; 107; 110; NoFrame!; "RegionSetFocus")

DIALOGADDTEXT(1000; 0; 0; 15; 107; 15; Center!; "Select a button")

DIALOGADDLISTBOX(1000; 100; 10; 35; 85; 35; Sorted!; var)

FOREACH(vList; {"Radio Button 1"; "Radio Button 2"; "Radio Button 3"})

DIALOGADDLISTITEM(1000; 100; vList)

ENDFOR

DIALOGHANDLE(hItem; 1000; 100)

DIALOGADDRADIOBUTTON(1000; 101; 10; 75; 15; 15; "1"; var)

DIALOGADDRADIOBUTTON(1000; 102; 40; 75; 15; 15; "2"; var)

DIALOGADDRADIOBUTTON(1000; 103; 70; 75; 15; 15; "3"; var)

DIALOGSHOW(1000; 100; Msg)

WHILE(Loop = 1)

ENDWHILE

DIALOGDESTROY(1000)

QUIT

LABEL(Msg)

IF(Msg[5] = WM_SYSCOMMAND)

Loop = 0

ENDIF

IF(LWORD(Msg[lParam]) = hItem)

REGIONGETSELECTEDTEXT(vRB; "1000.100")

SWITCH(vRB)

CASEOF "Radio Button 1": vFocus = "101"

CASEOF "Radio Button 2": vFocus = "102"

CASEOF "Radio Button 3": vFocus = "103"

ENDSWITCH

REGIONSETFOCUS("1000." + vFocus)

ENDIF

RETURN

FUNCTION LWORD(vNum)

vNum = vNum & 65535

RETURN(vNum)

ENDFUNC


For Example...

APPLICATION(WP; "WPPrWin"; Default; "US")

// Demonstrate REGIONASETWINDOWTEXT command

Loop = 1

vNmbr = 2

WM_SYSCOMMAND = 274

DIALOGDEFINE(1000; 50; 50; 150; 50; Percent! | NoFrame!; "RegionSetWindowText")

DIALOGADDFRAME(1000; 100; 10; 10; 10; 10; Frame! | Filled! | Gray!)

DIALOGADDHOTSPOT(1000; 101; 10; 10; 10; 10; Click!)

DIALOGADDTEXT(1000; 102; 28; 10; 125; 15; Left!; "Click to change text")

DIALOGSHOW(1000; 101; Msg)

WHILE(Loop = 1)

ENDWHILE

DIALOGDESTROY(1000)

QUIT

LABEL(Msg)

IF(Msg[5] = WM_SYSCOMMAND)

Loop = 0

ENDIF

IF(Msg[3] = 101)

ChangeTitle

ENDIF

RETURN

LABEL(ChangeTitle)

vChange = "Click " + vNmbr

REGIONSETWINDOWTEXT("1000"; vChange)

REGIONSETWINDOWTEXT("1000.102"; vChange)

ASSIGN(vNmbr; vNmbr + 1)

RETURN


For Example...

APPLICATION(WP; "WPPrWin"; Default; "US")

// Demonstrate REGIONSHOWWINDOW command

Loop = 1

WM_SYSCOMMAND = 274

vDisable = 1

DIALOGDEFINE(1000; 50; 50; 175; 75; Percent! | NoFrame!; "RegionShowWindow")

DIALOGADDFRAME(1000; 100; 10; 10; 10; 10; Frame! | Filled! | Gray!)

DIALOGADDHOTSPOT(1000; 101; 10; 10; 10; 10; Click!)

DIALOGADDTEXT(1000; 0; 28; 10; 125; 15; Left!; "Click to hide/show the following text")

DIALOGADDTEXT(1000; 102; 0; 35; 175; 15; Center!; "Novell GroupWise 4.1")

DIALOGSHOW(1000; 101; Msg)

WHILE(Loop = 1)

ENDWHILE

DIALOGDESTROY(1000)

QUIT

LABEL(Msg)

IF(Msg[5] = WM_SYSCOMMAND)

Loop = 0

ENDIF

IF(Msg[3] = 101)

IF(vDisable = 1)

REGIONSHOWWINDOW("1000.102"; Hide!)

vDisable = 0

ELSE

REGIONSHOWWINDOW("1000.102"; Show!)

vDisable = 1

ENDIF

ENDIF

RETURN


For Example...

APPLICATION(WP; "WPPrWin"; Default; "US")

// Demonstrate COPYFILE, DOESFILEEXIST, GETCURRENTDIRECTORY, and DOESDIRECTORYEXIST commands

VARERRCHK(Off!)

HRt = NTOC(0F90Ah)

CALL(GetFileNames)

CALL(CheckNames)

CALL(CopyFiles)

QUIT

LABEL(GetFileNames)

GETSTRING(vSource; "Current directory: " + GETCURRENTDIRECTORY

+ HRt + HRt + "File to copy:"; "Copy File"; 100)

GETSTRING(vDestination; "File to copy: "

+ vSource + HRt + HRt + "To:"; "Copy File"; 100)

RETURN

LABEL(CheckNames)

IF(NOT(DOESFILEEXIST(vSource) = True))

ErrorMsg(vSource + " does not exist")

ENDIF

vLen = STRLEN(vDestination)

vCnt = vLen

WHILE(NOT(vResult = "\") OR (vStrLen = 0))

vResult = SUBSTR(vDestination; vCnt; 1)

vCnt = vCnt - 1

ENDWHILE

// parsed filename is not used

vFilename = SUBSTR(vDestination; vCnt + 2; vLen - vCnt)

vDirectoryName = SUBSTR(vDestination; 1; vCnt)

IF(DOESDIRECTORYEXIST(vDirectoryName) = True)

RETURN

ELSE

ErrorMsg(vDirectoryName + " does not exist")

ENDIF

LABEL(CopyFiles)

IF(COPYFILE(vSource; vDestination; NoPrompts!) = True)

MESSAGEBOX(x; "COPYFILE"; "File copied successfully";

IconInformation!)

ELSE

ErrorMsg("File not copied")

ENDIF

RETURN

PROCEDURE ErrorMsg(Msg)

BEEP

MESSAGEBOX(x; "Error"; Msg; IconExclamation!)

QUIT

ENDPROC


For Example...

APPLICATION(WP; "WPPrWin"; Default; "US")

// Demonstrate GETCURRENTDIRECTORY and SETCURRENTDIRECTORY command

ONCANCEL(QuitMacro)

HRt = NTOC(0F90Ah)

LABEL(SetCurrentDir)

GETSTRING(vNewDir; "Current directory: " + GETCURRENTDIRECTORY

+ HRt + HRt + "New directory:"; "Directory Commands"; 100)

IF(SETCURRENTDIRECTORY(vNewDir) = False)

BEEP

MESSAGEBOX(x; "Error"; "Invalid directory"; IconExclamation!)

GO(SetCurrentDir)

ELSE

MESSAGEBOX(x; "Current Directory"; vNewDir; IconInformation!)

ENDIF

QUIT

LABEL(QuitMacro)

MESSAGEBOX(x; "End Macro"; "You chose Cancel or pressed Esc"; IconInformation!)

QUIT


For Example...

APPLICATION(WP; "WPPrWin"; Default; "US")

// Demonstrate CREATEDIRECTORY and DELETEDIRECTORY commands

ONCANCEL(QuitMacro)

HRt = NTOC(0F90Ah)

LABEL(CreateDir)

GETSTRING(vCreateDir; "Current directory: " + GETCURRENTDIRECTORY

+ HRt + HRt + "New directory:"; "Create New Directory"; 100)

IF(CREATEDIRECTORY(vCreateDir) = False)

BEEP

MESSAGEBOX(x; "Error"; "Directory not created"; IconExclamation!)

GO(CreateDir)

ELSE

MESSAGEBOX(vYesNo; "New Directory"; vCreateDir + HRt + Hrt + "Delete new directory now?"; IconQuestion! | YesNo!)

IF(vYesNo = 6)

MESSAGEBOX(x; "Delete Directory";

"Directory deleted: " + DELETEDIRECTORY(vCreateDir))

ENDIF

ENDIF

QUIT

LABEL(QuitMacro)

MESSAGEBOX(x; "End Macro"; "You chose Cancel or pressed Esc";

IconInformation!)

QUIT


For Example...

APPLICATION(WP; "WPPrWin"; Default; "US")

// Create a directory named c:\test

// Demonstrate RENAMEDIRECTORY command

ONCANCEL(QuitMacro)

HRt = NTOC(0F90Ah)

CREATEDIRECTORY ("c:\test";Prompts!)

GETSTRING(vNewName; "Type a new name for directory c:\test:"; 	"Rename 	a Directory"; 100)

RENAMEDIRECTORY ("c:\test";vNewName;Prompts!)

MESSAGEBOX(vYesNo; "Renamed Directory"; "Delete " + vNewName + " now?";IconQuestion!|YesNo!)

IF(vYesNo = 6)

DELETEDIRECTORY(vNewName)

MESSAGEBOX(x;"Delete Directory";"Directory " + vNewName + 	" deleted.")

ELSE

MESSAGEBOX(x;"Renamed Directory";"Directory " + vNewName + 	" not deleted.")

ENDIF

QUIT

LABEL(QuitMacro)

MESSAGEBOX(x;"End Macro"; "You chose Cancel or pressed Esc";IconInformation!)

QUIT


For Example...

APPLICATION(WP; "WPPrWin"; Default; "US")

// Demonstrate GETFILEATTRIBUTS command

ONCANCEL(QuitMacro)

HRt = NTOC(0F90Ah)

GETSTRING(vFilename; "File:"; "Get File Attributes"; 100)

IF(NOT(vFilename = ""))

MESSAGEBOX(x; ""; GETFILEATTRIBUTES(vFilename))

ENDIF

QUIT

LABEL(QuitMacro)

MESSAGEBOX(x; "End Macro"; "You chose Cancel or pressed Esc"; IconInformation!)

QUIT


For Example...

APPLICATION(WP; "WPPrWin"; Default; "US")

// Demonstrate SETFILEATTRIBUTES command

ONCANCEL(QuitMacro)

HRt = NTOC(0F90Ah)

GETSTRING(vFilename; "Set read-only attribute." + HRt + Hrt + "File:"; "SETFILEATTRIBUTES"; 100)

IF(NOT(vFilename = ""))

MESSAGEBOX(x; "SETFILEATTRIBUTES"; "Read-only status: " + SETFILEATTRIBUTES(vFilename; ReadOnly!; Prompts!))

ENDIF

QUIT

LABEL(QuitMacro)

MESSAGEBOX(x; "End Macro"; "You chose Cancel or pressed Esc"; IconInformation!)

QUIT


For Example...

APPLICATION(WP; "WPPrWin"; Default; "US")

// Demonstrate GETFILEDATEANDTIME command

ONCANCEL(QuitMacro)

HRt = NTOC(0F90Ah)

GETSTRING(vFilename; "Date and time." + HRt + Hrt + "File:"; "GETFILEDATEANDTIME"; 100)

IF(NOT(vFilename = ""))

MESSAGEBOX(x; "Number of seconds since Jan 1, 1980"; GETFILEDATEANDTIME(vFilename))

ENDIF

QUIT

LABEL(QuitMacro)

MESSAGEBOX(x; "End Macro"; "You chose Cancel or pressed Esc"; IconInformation!)

QUIT


For Example...

APPLICATION(WP; "WPPrWin"; Default; "US")

// Demonstrate SETFILEDATEANDTIME command

ONCANCEL(QuitMacro)

HRt = NTOC(0F90Ah)

GETSTRING(vFilename; "Date and time." + HRt + Hrt + "File:"; "GETFILEDATEANDTIME"; 100)

IF(NOT(vFilename = ""))

MESSAGEBOX(x; "New File Date and Time Stamp"; "Result: " + SETFILEDATEANDTIME(vFilename; 485780000) + " (Jun 30, 1994 / 7:02a)")

ENDIF

QUIT

LABEL(QuitMacro)

MESSAGEBOX(x; "End Macro"; "You chose Cancel or pressed Esc"; IconInformation!)

QUIT


For Example...

APPLICATION(WP; "WPPrWin"; Default; "US")

// Demonstrate DELETEFILE command

ONCANCEL(QuitMacro)

GETSTRING(vFilename; "File:"; "DELETEFILE"; 100)

IF(NOT(vFilename = ""))

IF(NOT(DELETEFILE(vFilename; Prompts!) = True))

Msg = vFilename + " not deleted"

ELSE

Msg = vFilename + " successfully deleted"

ENDIF

MESSAGEBOX(x; "DELETEFILE"; Msg; IconInformation!)

ENDIF

QUIT

LABEL(QuitMacro)

MESSAGEBOX(x; "End Macro"; "You chose Cancel or pressed Esc"; IconInformation!)

QUIT


For Example...

APPLICATION(WP; "WPPrWin"; Default; "US")

// Demonstrate RENAMEFILE command

ONCANCEL(QuitMacro)

HRt = NTOC(0F90Ah)

LABEL(begin)

GETSTRING(vOldName; "Old file name:"; "RENAMEFILE"; 100)

IF(vOldName = "")

GO(begin)

ENDIF

GETSTRING(vNewName; "Old file: " + vOldName + HRt + HRt + "New file name:"; "RENAMEFILE"; 100)

IF(NOT(vNewName = ""))

IF(NOT(RENAMEFILE(vOldName; vNewName; Prompts!) = True))

Msg = vOldName + " not renamed"

ELSE

Msg = "New file name: " + vNewName

ENDIF

MESSAGEBOX(x; "RENAMEFILE"; Msg; IconInformation!)

ENDIF

QUIT

LABEL(QuitMacro)

MESSAGEBOX(x; "End Macro"; "You chose Cancel or pressed Esc"; IconInformation!)

QUIT


For Example...

APPLICATION(WP; "WPPrWin"; Default; "US")

// Before playing this macro, create a file named File_IO, amd sav it in the default macros directory in ANSI (Windows) Text format

// Demonstrate OPENFILE, CLOSEFILE, FILEWRITE, FILEREAD, FILEPOSITION, FILEISEOF, and FILESIZE commands

CALL(OpenInfo)

CALL(WriteToFile)

CALL(ReadFromFile)

CALL(QuitMacro)

LABEL(OpenInfo)

HRt = NTOC(0F90Ah)

ASSIGN(vPath; EnvPaths(Macros!))

hFile = OPENFILE(vPath + "FILE_IO.DOC"; ReadWrite!; DenyNone!; AnsiText!)

IF(hFile < 0)

ErrorMsg("opening"; hFile)

ELSE

vIsEOF = "Postion marker (EOF): " + FILEISEOF(hFile)

vSize = "File size: " + FILESIZE(vPath + "FILE_IO.DOC")

MESSAGEBOX(X;"File Information"; vIsEOF + HRt + HRt + vSize)

ENDIF

RETURN

LABEL(WriteToFile)

FORNEXT(z; 1; 10; 1)

IF(FILEWRITE(hFile; "Presentations is a great product! ";

NoNewLine!) < 0)

ErrorMsg("writing to"; hFile)

ENDIF

ENDFOR

RETURN

LABEL(ReadFromFile)

FILEPOSITION(hFile; 0; FromBeginning!)

IF(FILEREAD(hFile; vText) < 0)

ErrorMsg("reading from"; hFile)

ELSE

MESSAGEBOX(x; "File I/O"; vText)

ENDIF

RETURN

PROCEDURE ErrorMsg(Msg; hFile)

BEEP

MESSAGEBOX(x; "Error"; "Error " + Msg + " file"; IconExclamation!)

ENDPROC

LABEL(QuitMacro)

IF(NOT(CLOSEFILE(hFile)) = True)

BEEP

MESSAGEBOX(x; "Error"; "Error closing file"; IconExclamation!)

ELSE

MESSAGEBOX(x; "File I/O"; "File successfully closed")

ENDIF

QUIT


For Example...

APPLICATION(WP; "WPPrWin"; Default; "US")

// Before playing this macro, create a file named File_IO in the default macros directory, and save the file in ANSI (Windows) Text format

// Demonstrate FILETRUNCATE command

CALL(OpenWriteToReadFromFile)

CALL(QuitMacro)

LABEL(OpenWriteToReadFromFile)

HRt = NTOC(0F90Ah)

ASSIGN(vPath; EnvPaths(Macros!))

hFile = OPENFILE(vPath + "FILE_IO.DOC"; ReadWrite!;

DenyNone!; AnsiText!)

IF(hFile < 0)

MESSAGEBOX(x; "Error"; "Error opening file"; IconExclamation!)

QUIT

ENDIF

Test(FILEWRITE(hFile;

"Presentations is a wonderful product!";

NoNewLine!); "FILEWRITE")

Test(FILEPOSITION(hFile; 0; FromBeginning!); "FILEPOSITION")

Test(FILEREAD(hFile; vText); "FILEREAD")

Test(FILEPOSITION(hFile; 20; FromBeginning!);

"FILEPOSITION")

Test(FILETRUNCATE(hFile); "FILETRUNCATE")

Test(FILEPOSITION(hFile; 0; FromBeginning!);

"FILEPOSITION")

Test(FILEREAD(hFile; vTruncate); "FILEREAD")

MESSAGEBOX(x; "File I/O - Truncate File"; vText+HRt+HRt+vTruncate)

RETURN

PROCEDURE Test(vError; vStr)

// vError = value returned from FILE command

IF(vError < 0)

BEEP

MESSAGEBOX(x; "Error"; vStr; IconExclamation!)

GO(QuitMacro)

ENDIF

ENDPROC

LABEL(QuitMacro)

IF(NOT(CLOSEFILE(hFile)) = True)

BEEP

MESSAGEBOX(x; "Error"; "Error closing file"; IconExclamation!)

ELSE

MESSAGEBOX(x; "File I/O"; "File successfully closed")

ENDIF

QUIT


For Example...

APPLICATION(WP; "WPPrWin"; Default; "US")

// Demonstrate FILEERROR and FINDFILE commands

vPath = EnvPaths(Macros!)

vFilename = FILEFIND(vPath + "*.wcm"; Normal!; 1)

WHILE(vFilename != "")

CALL DisplayName(vFilename)

vFilename = FILEFIND("";;1)

ENDWHILE

PROCEDURE DisplayName(vFilename)

MESSAGEBOX(x; "FILEFIND"; vFilename; IconInformation!)

ENDPROC

MESSAGEBOX(x; "Message"; "Error code = " + FILEERROR)


For Example...

// There are two macros in this example

// The INCLUDE macro is compiled when you play the main macro

// Demonstrate INCLUDE command

// INCLUDE macro: INC.WCM

// Without compiling, save this macro in the macros directory

APPLICATION (A1; "WPPrWin"; Default; "US")

Type("2")

PROCEDURE TestProc(x)

Type(x)

ENDPROC

//Main macro: PARENT.WCM

APPLICATION (A1; "WPPrWin"; Default; "US")

AddTextBox (1600w; 12000w; 9000w; 10000w)

Type("1")

INCLUDE("C:\PRWIN30\MACROS\INC.WCM")

Type("3")

CALL TestProc(4)

QUIT


For Example...

// Place DLLCALL PROTOTYPE statements at start of macro

// Example 1

// Parameter names (buffer and size) are not required

DLLCALL PROTOTYPE GetWindowsDirectory("kernel"; ; word;

{address(ansistring(buffer)); loword(size)})

// Example 2

DLLCALL PROTOTYPE GetSysDir("kernel"; "GetSystemDirectory";

void; {address(ansistring(buffer)); loword(size)})

// Example 3

DLLCALL PROTOTYPE GetSystemDirectory("kernel"; word;

{address(ansistring(buffer)); loword(size)})

// Load DLL library

DLLLOAD(h; "kernel")

// Call DLL function with DLLCALL

DLLCALL(h; "GetWindowsDirectory"; s; word;

{address(ansistring(a)); loword(250)})

MESSAGEBOX(x; "DLLCALL"; " Directory: " + a + " -- Size: " + s)

// Call DLL function with DLLCALL PROTOTYPE

// Value returning function

a := ""

s := 0

s := GetWindowsDirectory(size:250; buffer:a)

MESSAGEBOX(x; "DLLCALL PROTOTYPE (function)";

"Directory: " + a + " -- Size: " + s)

// DLL routine defined as a procedure

// DLL routine cannot be called as function

a := ""

GetWindowsDirectory(a; GetSystemDirectory(buffer:a; 250)+10)

MESSAGEBOX(x; "DLLCALL PROTOTYPE (procedure)"; a)

a := ""

GetSysDir(a; 250)

MESSAGEBOX(x; "DLLCALL PROTOTYPE (procedure)"; a)

// Free DLL library

DLLFree(h)

// The following statements produce errors

//s := GetWindowsDirectory(size:250; buffer:a; size:10; size:1024)

//s := GetWindowsDirectory(size:250; buffer:a; b; c);

//s := GetWindowsDirectory(size:250; size:20)

//s := GetWindowsDirectory(a; b; c)


For Example...

APPLICATION(A1; "WPPrWin"; Default; "US")

// Demonstrate DIALOGSHOW and DIALOGDISMISS commands

HRt = NTOC(0F90Ah)

WM_COMMAND = 273

WM_SYSCOMMAND = 274

vPopup = "Popup item 1"

vList = "List item 1"

DIALOGSHOW("Dialog1"; "WordPerfect"; Msg)

x := 0

While(x = 0)

Endwhile

QUIT

LABEL(MSG)

IF((Msg[5] = WM_SYSCOMMAND) OR (Msg[3] = "CancelBttn"))

BEEP

x = 1

RETURN

ENDIF

IF(Msg[5] = WM_COMMAND)

DIALOGDISMISS("Dialog1"; "OKBttn")

MsgBox

DIALOGSHOW("Dialog1"; "WordPerfect"; Msg)

ENDIF

RETURN

LABEL(MsgBox)

MESSAGEBOX(z; "Selections"; vList + HRt + HRt + vPopup + HRt)

RETURN


For Example...

APPLICATION(A1; "WPPrWin"; Default; "US")

// Demonstrate REGIONISVISIBLE, DIALOGSHOW, and DIALOGDISMISS commands

DialogDefine("Dialog"; 50; 50; 200; 200; Percent!; "REGIONISVISIBLE")

DialogAddPushButton("Dialog"; 1; 85; 10; 25; 13;

NonDefaultBttn!; "OK")

DialogAddPushButton("Dialog"; 2; 85; 30; 25; 13;

DefaultBttn!; "Cancel")

DialogShow("Dialog"; "WordPerfect"; Msg)

x = 0

WHILE(x != 1)

REGIONISVISIBLE (vResult; "Dialog.1")

MESSAGEBOX(z; "OK button"; "Visible: " + CheckResult(vResult))

REGIONSHOWWINDOW ("Dialog.1"; Hide!)

REGIONISVISIBLE (vResult; "Dialog.1")

MESSAGEBOX(z; "OK button"; "Visible: " + CheckResult(vResult))

x = 1

ENDWHILE

DialogDismiss("Dialog"; "CancelBttn")

QUIT

LABEL(Msg)

RETURN

FUNCTION CheckResult(vResult)

IF(vResult = 0)

vResult = "No"

ELSE

vResult = "Yes"

ENDIF

RETURN(vResult)

ENDFUNC