Dyslexicbloke
Member
Hi folks,
I am looking at a project that needs to send alternate, shorter/longer, alarm messages by mail.
I am aware an alarm can send mail.
I know how to send mail AdHock as it were.
I also know that the alarm message can be a reference to a string Tag, dynamically generated or otherwise.
I know that array events can use the 'i' property to pass the element number, ordinal, to the handler and I know that there is an AsText(), function?, that can be used to cast none textural data as text BUT
I dont know, and cant find, what properties are available or for that matter how to access them.
Examples...
Tag1.Name is valid, returning a string,
Tag1.Label & Tag1.Desc also work.
AsText(i) will return the ordinal of an array element, without the preceding qualifier Tag1. In an alarm, this can be used to create a dynamic message, of sorts...
Event Name: =AsText(i) or ="Some Messege" + AsText(i)
Clearly the alarm event knows which tag is in context/scope because if it didnt then 'i' would not mean anything.
However Name,Label and Desc will not work unless preceded by 'TagName.'
So, specific questions...
Does Crimson have a context/scope sensitive qualifier, like VB or C
E.G. Me.Name or Me.Label
What else, tag properties, can be accessed or modified in code/script? Is there a list anywhere?
Assuming I set up alarms, using Flag Tags, in the 'Normal' way can anyone suggest generic code that every alarm can carry to call a custom handler for the 'On Active' event that would pass in a reference to the tag that spawned the alarm.
Obviously I appreciate each alarm could be configured with either a unique call to a common routine, which wouldn't be the end of the world, but I was hoping to have a common call that passed a unique identifier extracted from the Tag Object.
Essentially...
If I have to say MyProg(Tag1.Desc) then I may as well just say MyProg("SomID")
MyProg(Me.Desc) is much cleaner, at laest it would be if it wasnt also wrong!
Thoughts folks?
I am looking at a project that needs to send alternate, shorter/longer, alarm messages by mail.
I am aware an alarm can send mail.
I know how to send mail AdHock as it were.
I also know that the alarm message can be a reference to a string Tag, dynamically generated or otherwise.
I know that array events can use the 'i' property to pass the element number, ordinal, to the handler and I know that there is an AsText(), function?, that can be used to cast none textural data as text BUT
I dont know, and cant find, what properties are available or for that matter how to access them.
Examples...
Tag1.Name is valid, returning a string,
Tag1.Label & Tag1.Desc also work.
AsText(i) will return the ordinal of an array element, without the preceding qualifier Tag1. In an alarm, this can be used to create a dynamic message, of sorts...
Event Name: =AsText(i) or ="Some Messege" + AsText(i)
Clearly the alarm event knows which tag is in context/scope because if it didnt then 'i' would not mean anything.
However Name,Label and Desc will not work unless preceded by 'TagName.'
So, specific questions...
Does Crimson have a context/scope sensitive qualifier, like VB or C
E.G. Me.Name or Me.Label
What else, tag properties, can be accessed or modified in code/script? Is there a list anywhere?
Assuming I set up alarms, using Flag Tags, in the 'Normal' way can anyone suggest generic code that every alarm can carry to call a custom handler for the 'On Active' event that would pass in a reference to the tag that spawned the alarm.
Obviously I appreciate each alarm could be configured with either a unique call to a common routine, which wouldn't be the end of the world, but I was hoping to have a common call that passed a unique identifier extracted from the Tag Object.
Essentially...
If I have to say MyProg(Tag1.Desc) then I may as well just say MyProg("SomID")
MyProg(Me.Desc) is much cleaner, at laest it would be if it wasnt also wrong!
Thoughts folks?