Announcement

Collapse
No announcement yet.

Is it possible to define class in EFS?

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

  • Is it possible to define class in EFS?

    Hello,

    Does eSignal EFS support using class? I tried to use class in EFS, but got the error message
    ..... line 23: SyntaxError: missing ; before statement
    class myBar {


    If class is not supported in EFS, what workaround is available?

    - Clearpicks
    Attached Files

  • #2
    Re: Is it possible to define class in EFS?

    Hi clearpicks,

    JavaScript uses functions and prototypes, not classes, but a function constructor can be used to construct objects with methods which are pretty close.

    Here is your rewritten code, should work...
    PHP Code:
    function myBar(ab) {
      
    this.a;
      
    this.b;
    }


    function 
    preMain() {

    }

    function 
    main() {
      if (
    getCurrentBarIndex() == -1) {
        var 
    = new Array();
        var 
    i;
        for (
    010i++) {
          var 
    = new myBar(i"s" i);
          
    A[i] = a;
        }
        for (
    010i++) {
          var 
    A[i];
          
    debugPrintln(a."    " a.s);
        }
      }

    Originally posted by clearpicks
    Hello,

    Does eSignal EFS support using class? I tried to use class in EFS, but got the error message
    ..... line 23: SyntaxError: missing ; before statement
    class myBar {


    If class is not supported in EFS, what workaround is available?

    - Clearpicks

    Comment


    • #3
      Steve,

      Thank you for the reply. The example code I posted was based on some code writen for Unity. I didnot realized Unity "Javascript" is different from Javascript.

      - Clearpicks

      Comment


      • #4
        Hi Clearpicks,

        You are welcome. Interesting, I looked it up and found a link. Based on what I can gather, it seems to be more like C# (compiled) but with some JavaScript functionality, neat.

        Originally posted by clearpicks
        Steve,

        Thank you for the reply. The example code I posted was based on some code writen for Unity. I didnot realized Unity "Javascript" is different from Javascript.

        - Clearpicks

        Comment

        Working...
        X