Announcement

Collapse
No announcement yet.

Displaying a defined variable in an Alert

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

  • Displaying a defined variable in an Alert

    Hello All

    I have been trying to accomplish the following task with little to no success. After having check forms and trying all combinations I can think of, I hope someone can assist me.

    If I define a simple varible;

    e.g.
    var g=null;
    var h=null;

    Then apply the following logic;

    If vTotal represents the number I would like to display in an alert, how do I represent the vTotal result in the alert window ?

    e.g.
    var vTotal=((g+h)/2)

    if (vTotal < 0.01){
    alert.addToList(getSymbol()+" "+getInterval(),"Comments",Color.black,Color.blue) ;
    }

    There if my if statement condition is met, how do I get the alert statement to display in the alert window the value of vTotal.

    In theory, this seems like a very simple task, yet I have not been able to find any example to provide me with an answer.

    Thank you for any assistance anyone can provide

    Sincerely

    Royce

  • #2
    Re: Displaying a defined variable in an Alert

    Royce
    Just insert the variable name [in this case vTotal] in the description parameter of the Alert.addToList() function eg
    Alert.addToList(getSymbol()+" "+getInterval(),vTotal,Color.black,Color.blue) ;
    See also the example I provided to you in this thread on the same topic
    Alex


    Originally posted by Royce
    Hello All

    I have been trying to accomplish the following task with little to no success. After having check forms and trying all combinations I can think of, I hope someone can assist me.

    If I define a simple varible;

    e.g.
    var g=null;
    var h=null;

    Then apply the following logic;

    If vTotal represents the number I would like to display in an alert, how do I represent the vTotal result in the alert window ?

    e.g.
    var vTotal=((g+h)/2)

    if (vTotal < 0.01){
    alert.addToList(getSymbol()+" "+getInterval(),"Comments",Color.black,Color.blue) ;
    }

    There if my if statement condition is met, how do I get the alert statement to display in the alert window the value of vTotal.

    In theory, this seems like a very simple task, yet I have not been able to find any example to provide me with an answer.

    Thank you for any assistance anyone can provide

    Sincerely

    Royce

    Comment


    • #3
      Thanks Alexis

      I appreciate you help.

      Royce

      Comment


      • #4
        Royce
        You are most welcome
        Alex


        Originally posted by Royce
        Thanks Alexis

        I appreciate you help.

        Royce

        Comment

        Working...
        X