Performance Question: instance:createTextOutput()

Moderator: admin

Performance Question: instance:createTextOutput()

Postby imxuf92 » Sat Jan 23, 2016 7:03 pm

When using instance:createTextOutput() and I create a "label" using the instance:set() function, if I want to change the label later for the same period, do I need to clear it first? Or can I just call "set()" again?

So... THIS:

Code: Select all
 
     labelStream:set(period, high , text);  -- Initial set

     ...   -- Other code here

     labelStream:setNoData(period);  -- Clear original label
     labelStream:set(period, high , NEWTEXT);  -- Change the text to new value



Or, THIS:
Code: Select all
 
      labelStream:set(period, high , text);  -- Initial set

     ...   -- Other code here

     labelStream:set(period, high , NEWTEXT);  -- Change the text to new value


Which is the preferred/proper method?
imxuf92
 
Posts: 26
Joined: Sat Jan 23, 2016 6:55 pm

Re: Performance Question: instance:createTextOutput()

Postby Julia CJ » Tue Jan 26, 2016 1:10 am

Hi Imxuf92,

I would recommend you use this method:




Code: Select all
labelStream:set(period, high , text);  -- Initial set

     ...   -- Other code here

  labelStream:set(period, high , NEWTEXT);  -- Change the text to new value
Julia CJ
 


Return to Indicator Development

Who is online

Users browsing this forum: No registered users and 6 guests

cron