Announcement

Collapse
No announcement yet.

Script.Call is broken for any variable string

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    Script.Call is broken for any variable string

    Something is broken with Script.Call when using any variable type for the string argument. (i.e. const, local or memeber variables).

    Works:
    Script.Call("Demo.Test.T");
    Broken:
    string name = "Demo.Test.T";
    Script.Call(name);
    Here is the deck showing the issue.
    https://deck.net/cec7aef6468ebbe9720a52af61c01b24


    - selinc

    #2
    The Script.Call and Script.Write methods require a string literal, not a reference, so the second scenario is not supported.

    The value passed is written directly into the generated JavaScript.

    Comment


      #3
      Script.Eval does work with a string. So, here is a work around that I believe will meet the need:

      string name = "Demo.Test.T";
      Script.Eval(name + "()");
      Last edited by ejhewy; 2018-04-23 @ 10:24 PM. Reason: Added CODE tag.

      Comment

      Working...
      X