No announcement yet.

C# scripting arguments

  • Filter
  • Time
  • Show
Clear All
new posts

    C# scripting arguments


    I'm struggling with passing arguments to the C# script from the Events web control.

    If I leave the "sub or function" empty and put a string into the "Parameters" text box, how to access the string from within the C# program.

    Thanks in advance.


    Re: C# scripting arguments

    I have not been successful in getting the C# test script to function on my machine for some reason (I'll post that to another thread), but my suggestion would be to look at the C# documentation for an object array.

    I think that parameter object defined in the function header is simply an object array that you can iterate through to look at each argument passed when the function is called. The object should have some basic inherited properties that you can use to determine the number of passed items (it may be called "count") as well as some other properties to determine what has been passed when the function was initially called.


      A sample of iterating through array object

      More specifically, here is an example from the MSDN site on a string array passed as a parameter to a function and how the function iterates through it. I don't have any documentation handy to know what the inherited properties are, so my prior reference to a "count" property was incorrect, but you get the idea.... Hope this helps.

      I attached a screenshot of the sample function.
      Attached Files