|
|
|
|
November 1998: New Commands in
WordPerfect 8 for Windows WordPerfect 8 for Windows brings with it several new macro commands that help make processing data easier than ever before. This month we'll briefly skim over some of those new commands. Date CommandsSeveral new date commands make it easier than ever to calculate dates. For example, the DateAddDays command allows you to add a specified number of days to a date. Similarly, the DateAddWeeks , DateAddMonths , and DateAddYears commands make date calculations a snap. Additional new commands return the number of days in a given month (DateDaysInMonth). This is especially useful in leap years, and for those of us who can't remember that stupid rhyme (30 days has November ...). You can find out if a certain year is a leap year (DateIsLeapYear), the date of a certain day in the year (DateOfNthDay), or even what week of the year (DateWeekOfYear)). You can even get information relating to the current time zone (TimeZoneInfo). Error HandlingWPWin 8 reintroduces some error handling commands that were available in WPWin 5.1/5.2. They don't add any functionality that is not already available: the just add a new way to accomplish the same thing. AssertCancel CancelOff ErrorOff NotFoundOff VarErrChkOff ReturnCancel File Conversion CommandsThese commands are really handy when you are opeing files that may be in a non-WP format. FileType FileTypeExtension FileConvert FileConvertError FileTypeList FileTypeName New Open Dialog CapabilityProbably the most useful new command in WPWin 8 is the FileNameDialog command. With this command you can display a File List dialog that is customized for your needs. You can specify the caption on the title bar, the text on a button, which directory and files will appear in the list, and many other options. User-Defined DialogsThere are several new region command that allow you to manipulate the contents of lists more easily. RegionAddListItemByIndex There are also commands that allow you to more easily get the contents of a dialog control, and to set the dialog variables before the dialog is dismissed. DialogControlQuery Getting Version and System InformationVersionInfo GetWPData MacroInfo Compatibility IssueIf you need your macros to work with both WPWin 7 and WPWin 8, you should not use these new commands in your macros, since the new commands will not be recognized in WPWin 7. Along with the commands I've touched upon above, there are several new commands that
appear in the Command Inserter in WPWin 8. Some of them seem to not be completely
implemented yet. Hopefully, they will be functional in future versions of WPWin. Next month: Repeating a macro multiple times For more information on this topic, and specific usage of the new commands, get a copy of my book. For information on ordering my book see my web page.
Copyright Notice: The information included in the PerfectScript Journal is protected by US Copyright. The author grants you the right to use the routines in your own macros as needed. You may not sell, distribute, or publish them in any form.If you choose to use the information here, you do so entirely at your own risk. No representations are made regarding the fitness of this information for your particular purpose, or for your ability or inability to use the information. You are advised to make backups of all relevant files before implementing any suggestion or technique.© Copyright 1998 by J. Jeppson. |