HomeGenie Forum
Automation Program Plugins and Wizard Scripting => Help => Topic started by: kevin1 on April 09, 2015, 08:05:13 PM
-
When I try to add a simple enum like this, it causes errors on lines near enum definition:
public enum ArduinoData{
AD_TEMP,
AD_HUMID,
AD_LUMEN,
AD_SUMP;
}
...
string[] data = message.Split(',');
Program.RaiseEvent(module1, "Sensor.Humidity", data[AD_HUMID], "Sensor 1");
Is there another way?
-
Happy to be proved wrong, but not as far as I know in a c# script.
-
Hi,
the AD_SUMP; seems higly suspicious.
It should not end with a semi colon (;)
It should either not be terminated at all, or a comma...
Best regards,
Wibo.
-
Darn semi colons! Unfortunately, after correcting that, it still doesn't work for me.
-
Enums cannot be used in a C# automation program. You have to use constants:
const uint AD_TEMP = 0, AD_HUMID = 1, AD_LUMEN = 2, AD_SUMP = 3;
g.