Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

doing nothing

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

    doing nothing

    Hello-
    I have a condition:
    if (myvar >= 1.00)
    { print dot}
    else {do nothing}

    I get the unassigned variable error if I leave the else out. So I have to assign myvar to something, so I chose 0. But now I get a dot at every bar on the zero line.
    I only want a dot when (myvar >= 1.00) and nothing if it's < 1.00. How is this done?
    Thank you.

    #2
    Hello imalil, thanks for your post.

    You can add a ';' within your ELSE block and that would be an empty NOOP statement. You can also just remove the entire ELSE block to do nothing if the above condition is false.

    Kind regards.

    Comment


      #3
      Thanks for the answer, I'll try the ;. I have to ask because I'm trying to learn: when I remove the else block with my variable assigned, myvar = 0;, it compiles but I get a dot on the zero line at every bar, which I don't want. When I remove the else statement and not assign myvar, I get an unassigned variable error. So in my situation removing the else block doesn't work, unless I'm missing something, which is highly possible and why I'm asking.
      Thanks.

      Comment


        #4
        Hi imalil, thanks for your reply.

        I can't tell why you are getting that unassigned value error from the snippet you posted. If you could post your script here I can take a look. See here for instructions on exporting.

        I look forward to hearing from you.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        598 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        343 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        103 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        556 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        555 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X