Announcement

Collapse
No announcement yet.

add line

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

  • add line

    Hi,

    Ii get "parameter number 2 of function addLIneTool is invalid" from the following code. I'm sure the problem is simple to fix.

    PHP Code:
    function doFibTime (fibBars)   {
    var 
    line1   = (fibBars .25).toFixed(0); 
    addLineTool(LineTool.VERTline12Color.cyan"line1");

    Thanks
    Mark

  • #2
    Hi Mark,

    when you used .toFixed(0) you converted the number to a text value. Try multiplying by 1 to convert back to a number. See this section in the Knowledgebase that describes what toFixed does.

    Comment


    • #3
      nope, doesn't help. It seems as soon as I do some form of arithmetic operation on the variable, it hiccups.

      Also, is there a limit to the number of input parameters that can be setup?

      Thanks
      Mark

      Comment


      • #4
        Mark
        As far as I can see Steve's suggestion is working fine.
        In order to understand why it is not working for you please post a complete example of your code that illustrates the problem
        Alex

        Comment


        • #5
          here she be....


          function doFibTime (start)
          {

          var vtemp = aSwingsIndex[1] - aSwingsIndex[2);
          var temp1 = vtemp * start;
          var line2 = vtemp * .382;

          clearLineTool(LineTool.VERT);
          addLineTool(LineTool.VERT, line2, 2, Color.cyan, "line1");

          }


          If I use "start" as the x variable it works fine, but the minute I do something before, (ie. vtemp or temp1 or line2, I get an error on parameter 2.

          Thanks

          Comment


          • #6
            ech, never mind... the problem is in the passing of the aSwingIndex, it must not be an integer elsewhere, cause I setup my own variables to track the peaks/valleys and it works fine.

            Thanks for your efforts.
            Mark

            Comment


            • #7
              Hello Mark,

              On the line where you declare vtemp, you have a syntax error.

              aSwingsIndex[2);

              should be:

              aSwingsIndex[2];


              Does this resolve the problem?
              Jason K.
              Project Manager
              eSignal - an Interactive Data company

              EFS KnowledgeBase
              JavaScript for EFS Video Series
              EFS Beginner Tutorial Series
              EFS Glossary
              Custom EFS Development Policy

              New User Orientation

              Comment


              • #8
                yup, a typo....... I couldn't figure out how to do copy & paste as whole/as compared to a bunch of single lines, so I retyped it.

                Thanks though.

                Comment

                Working...
                X