I'm having trouble using the function AlertType. I'm using it in the following context:
CODE:
Please log in to see this code.
I get the error: 'int' does not contain a definition for AlertType. I did a search and couldn't find anybody who has used this function and the Language guide only gives one example. Anybody have any suggestions? Thanks.
Size:
Color:
In
CODE:
Please log in to see this code.
, "a" is undefined:
CODE:
Please log in to see this code.
Size:
Color:
That doesn't work. (Actually, I had already declared a as an int already).
Size:
Color:
Oops, you're right. I overlooked the totally incorrect usage of
AlertType above. It doesn't make sense to compare one type (
TradeType) with a very different (
string). Should be:
CODE:
Please log in to see this code.
Size:
Color:
P.S. Revisit the "AlertType Property" QuickRef entry, you should find a description and the list of possible values returned by this enum.
Size:
Color:
Got the same error message. I have reviewed the references and re-reviewed them, but they don't help me.
Size:
Color:
You're getting the same error message because integer does not contain an AlertType property.
Replace the erroneous "a.AlertType" fragment with Alerts[i].
Size:
Color:
Thanks! The exact syntax is : if(Alerts[a].AlertType == TradeType.Cover)
I must say the documentation on this and other functions is pretty poor and far from intuitive.
I really appreciate your help.
Size:
Color:
What is unclear in the documentation, that Microsoft haven't defined no AlertType property for their C# integer type? :)
Size:
Color:
That's a joke, right? Excuse me if I'm a little concrete and still a relative newbie to C. I was of course referring to WL-5's documentation of functions--WL-4 provides much clearer and more thorough explanations than WL-5. Except as a random monkey I don't think I could have ever derived the code based on the documentation in WL-5. Take a look at it if you haven't recently.
Size:
Color:
Look, for whatever reason you were trying to fill an array. You define an iterator ("a", of integer type), and then you're trying to extract a property from the integer (number) that does not exist there.
Another error was in trying to compare TradeType with a string. Even though it's created by the Wealth-Lab's designer, TradeType is just another data type in C#. So you need to follow the language conventions. The QuickRef helps you with that. For example, the AlertType entry is very much clear in stating that AlertType is a TradeType, is enum, and lists all the 4 possible options.
Finally, take a look in the Alert.BasisPrice code -- an example there shows how to properly make the comparison you were trying to make.
Size:
Color:
Thanks.
Size:
Color: