Announcement

Collapse
No announcement yet.

Please help, too many things not okay...

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

  • Please help, too many things not okay...

    Sorry for noob questions, eSignal documentation is quite poor...

    1. It doesn't recognize some of its own functions: for instance, and probably worst case, a simple round(). When I type it in the EFS it is recognized, even appears as a tooltip round(nvalue), but at compile time function is not recognized.

    2. Parameter not recognized
    For instance:
    var minscount = new FunctionParameter( "nminutes", FunctionParameter.NUMBER );
    minscount.setname("How many minutes")
    minscount.addoption(5);
    minscount.addoption(10);

    barscount=0

    function main(nminutes)
    {
    barscount=nminutes/5
    ->here nminutes is not recognized, at runtime

    3. Debug data is displayed in reversed order of the parameters passed to debugPrintln function in the formula output window.

    4. This is probably the worst error I ever saw in any programming language. A call to a wrong method causes entire block to being skipped -> the wrong call is not reported on compiler or the runtime formula output
    For instance, you have a
    {
    ...some code here
    hihere=high().value(0) //this is wrong
    ...other code here
    }
    Then other code here is not executed at all, custom function terminated.

    I could stress myself alone with questions 3 and 4, but I'd really need some solutions for 1 and 2.
    Thanks!

  • #2
    Re: Please help, too many things not okay...

    bogiquant

    1. It doesn't recognize some of its own functions: for instance, and probably worst case, a simple round(). When I type it in the EFS it is recognized, even appears as a tooltip round(nvalue), but at compile time function is not recognized.
    round() is not a function but a method of the JavaScript Math Object so the correct syntax would be
    Math.round(nValue)

    2. Parameter not recognized
    For instance:
    var minscount = new FunctionParameter( "nminutes", FunctionParameter.NUMBER );
    minscount.setname("How many minutes")
    minscount.addoption(5);
    minscount.addoption(10);

    barscount=0

    function main(nminutes)
    {
    barscount=nminutes/5
    ->here nminutes is not recognized, at runtime
    Add a default in the FunctionParameter ie
    minscount.setDefault(your value);
    Also .addoption() should be .addOption() and .setname() should be .setName() (as shown in this article in the EFS KnowledgeBase). JavaScript is case sensitive
    Alex


    Originally posted by bogiquant
    Sorry for noob questions, eSignal documentation is quite poor...

    1. It doesn't recognize some of its own functions: for instance, and probably worst case, a simple round(). When I type it in the EFS it is recognized, even appears as a tooltip round(nvalue), but at compile time function is not recognized.

    2. Parameter not recognized
    For instance:
    var minscount = new FunctionParameter( "nminutes", FunctionParameter.NUMBER );
    minscount.setname("How many minutes")
    minscount.addoption(5);
    minscount.addoption(10);

    barscount=0

    function main(nminutes)
    {
    barscount=nminutes/5
    ->here nminutes is not recognized, at runtime

    3. Debug data is displayed in reversed order of the parameters passed to debugPrintln function in the formula output window.

    4. This is probably the worst error I ever saw in any programming language. A call to a wrong method causes entire block to being skipped -> the wrong call is not reported on compiler or the runtime formula output
    For instance, you have a
    {
    ...some code here
    hihere=high().value(0) //this is wrong
    ...other code here
    }
    Then other code here is not executed at all, custom function terminated.

    I could stress myself alone with questions 3 and 4, but I'd really need some solutions for 1 and 2.
    Thanks!

    Comment


    • #3
      bogiquant

      4. This is probably the worst error I ever saw in any programming language. A call to a wrong method causes entire block to being skipped -> the wrong call is not reported on compiler or the runtime formula output
      For instance, you have a
      {
      ...some code here
      hihere=high().value(0) //this is wrong
      ...other code here
      }
      Then other code here is not executed at all, custom function terminated.
      As I understand it high().value(0) is syntactically correct which is why the syntax checker does not report an error.
      The method name may not be a valid EFS extension, however to my knowledge it is legal in JavaScript to add custom methods and functions.
      That type of error would simply be a logic error and the syntax checker cannot check for logic errors.
      Alex

      Comment

      Working...
      X