So, I am familiar with the basics of C# and not at all with VB. I'm trying to figure out the correct header to declare a function inside a C# script. I've tried the method declaration statements common to C#, but can't get HS to recognize them as functions or methods. I'm assuming that a "function" is essentially a programming "method"...something that I can call and pass parms to and from, within a main script, but I could be wrong there. So basically, as the default sub header, it provides the following:

Code:
 
  
 public Object Main(Object[] parm)
 {
 return null;
 }
So, I'd like to present this as an example. I simply want to add the CAPIControlHandler single control statement to a script as a function in place of manually adding this for every control. I can manipulate variables to do what is necessary, I suppose, but this is going to get pretty tedious.

Code:
 
 public Object Main(Object[] parm)
 {
 int device = 270;
 string valueString = "on";
  
 hs.CAPIControlHandler(hs.CAPIGetSingleControl(device,true,valueString,false,true));
  
 return null;}
There are examples for this many times over in VB, but I can't find anything related to c#. Language translators don't work and I can't figure it out.

So how do I declare a sub/function/method "whatever it may be called" from within here and do I just use standard c# programming method call statements to call it?


Furthermore, how can I modify this command statement to send a value rather than a string (i.e. change the cool setpoint on a z-stat)?


Any help is appreciated.

P.S. If the suggestion is to refer to the help files or APK (whatever that is) or other related documentation, save us both the time of the reply. I've tried and if you're an dumbass like me it's like reading f*&^%c# gibberish!

Thanks!