PerfectScript Journal
 

July 1997 Macro Q&A 

Getting Enumeration Values 
Q. In WPWin 6.1's Command Inserter, as you selected the possible enumerations, a numeric value for each appeared. You could also get these numeric values from the Macros Online help. In WPWin 7 and 8, the enumeration values are no longer listed anywhere. Is there a way to get these values? I need them to pass the desired value in to PROCEDURES, etc. 

A. Yes. You can use the VALUE command to get the value of any desired enumeration. For example, if you want the numeric value of the SingleLine! style of the GraphicsLineStyle command, you can use the following command:  

Type(Value(GraphicsLineStyle.Style.SingleLine!))

In the VALUE command, supply the name of the command, a period (full stop), the name of the parameter, a period (full stop), then the name of the enumeration. When you play the macro, the value of that enumeration will be typed out for you.


Using DialogAddControl custom Date control in WPWin 8 
Q. In WPWin 6.1 and 7, I was able to use the DIalogAddControl command to add a date control to a macro dialog. I am unable to find the correct way to use this command in WPWin 8. Can you help? 

A. Although in WPWin 7 and WPWin 8 there is a built-in command to create a date control (DialogAddDate) you can still use the DialogAddControl command to get the date also. You need to specify the correct name of Date control (in the seventh parameter) to use the command in each version. In WPWin 6.1 the command is:


DialogDefine(100; 50; 50; 123; 70; 1+2+16+512; "Calendar")
DialogAddControl(100; "Date"; 10; 10; 100; 12; "WPDate20";
1342373889; ""; vDate; 0)
DialogShow(100)
         

In WPWin 7 the command is:


DialogDefine(100; 50; 50; 123; 70; 1+2+16+512; "Calendar")
DialogAddControl(100; "Date"; 10; 10; 100; 12; "WPDate70";
1342373889; ""; vDate; 0)
DialogShow(100)
         

In WPWin 8 the command is:


DialogDefine(100; 50; 50; 123; 70; 1+2+16+512; "Calendar")
DialogAddControl(100; "Date"; 10; 10; 100; 12; "WPDate80";
1342373889; ""; vDate; 0)
DialogShow(100)
            

 

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 1997 by J. Jeppson.