wwDotNetBridge::GetEnumValue

Retrieves a .NET Enumerated value by passing in a string representation and retrieving the corresponding numeric value.

Note that VFP Intellisense (if available) can also furnish this value to you directly as a numeric value which is more efficient. But this only works if the type is registered for COM Interop (most are not) and when you have it referenced explicitly in your code as the COM type using a LOCAL declaration.


o.GetEnumValue(lcType, lcValue)

Return Value

Numeric value of the enum value

Parameters

lcType
The fully qualified enumerated type. This is the more efficient syntax.
(System.Windows.Forms.MessageBoxIcon)

If lcValue is not passed the type is assumed to be the full Enum type name including the enumeration property name.
(System.Windows.Forms.MessageBoxIcon.Exclamation)

lcValue
The enum value as a string.

Example

? loBridge.GetEnumValue("System.Windows.Forms.MessageBoxDefaultButton.Button2") && 256 *** Slightly more efficient - treated like a pure static loBridge.GetEnumValue("System.Windows.Forms.MessageBoxDefaultButton","Button3") && 512

See also:

Class wwDotNetBridge


  Last Updated: 1/17/2008 | © West Wind Technologies, 2008