Follow

Enumeration constants (srfGridFmtXYZ) are not working in Scripter. How can I reference the Surfer type library?

When the enumeration constants are not working or causing errors, it is usually because the Surfer type library is not referenced.

 

This reference is needed for a program to recognize the value of the enumeration constants (such as srfGridFmtXYZ) that Surfer uses to reference various settings.  You can either reference the type library, or you can use the actual value of the constants in the commands instead of the enumeration constants (use 4 instead of srfGridFmtXYZ).

 

Method 1: Reference the Type Library

The Surfer Scripter program and the Microsoft VBA that comes with Word and Excel use the Edit | References menu command to add a reference to a program's type library. 

 

Method 2: Use Numeric Value Instead of Enumeration Constant

You can simply use a number value instead of the enumeration constant. This simply requires you to know the value of the constant. There are a few ways to determine the numeric value of an enumeration:

1. You can look in the Help. The enumerations are listed in the same order as their numeric value. If the enumeration you want is the 5th one down, then use 5. In some cases, the values are also listed:

2. You can type the enumeration in the Scripter program that comes with Surfer, right click on it and click Quick Watch.  The immediate window displays the value in the format:

This indicates that the value is
4 and the & indicates the variable
type is a "long" or 32-bit integer value. 

3. You can also use the Debug | Browse menu command in Scripter to display the value and the related enumeration constants.

 Display the value of an enumeration constant with the Debug | Browse menu command in Surfer Scripter.

 

Updated September 27, 2017

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.