在图表上输出多行的Comment(注释)

2019-01-30

externint MaxCommentsToShow=25;
//An array to hold all of the comments
string allcomments[];
 
//+------------------------------------------------------------------+
//| Manage comments - Written by DMS                                           |
//+------------------------------------------------------------------+
void managecomments(string addcomment)
   {
   string tempcomments[];
   int commentscroll;
   string output;
   int CommentCount = ArrayRange(allcomments,0);
   if(CommentCount<MaxCommentsToShow)
      {
      ArrayResize(tempcomments,CommentCount+1);
      ArrayCopy(tempcomments,allcomments,1,0,WHOLE_ARRAY);
      }
   else
      {
      ArrayResize(tempcomments,MaxCommentsToShow);
      ArrayCopy(tempcomments,allcomments,1,0,MaxCommentsToShow-1);
      }   
   tempcomments[0]=addcomment;
   CommentCount = ArrayRange(tempcomments,0);
   ArrayResize(allcomments,CommentCount);
   ArrayCopy(allcomments,tempcomments,0,0,CommentCount);
 
   for(commentscroll=0;commentscroll<CommentCount;commentscroll++)
      {
      output = output + allcomments[commentscroll]+"\n";
      }    
   Comment(output);
   }  

本博客所有文章如无特别注明均为原创。作者:天泓评测
分享到:更多

相关推荐

发表评论

路人甲 表情
Ctrl+Enter快速提交

网友评论(9)

Thanks very interesting blog!
AR 4天前 回复
I know this website provides quality dependent articles and additional data, is there any other website which gives such information in quality?
NR 1个月前 (2020-06-06) 回复
Wonderful article! That is the type of information that are meant to be shared around the net.
Shame on Google for now not positioning this put up higher!

Come on over and talk over with my site . Thank you
=)
ZJ 1个月前 (2020-06-04) 回复
My brother suggested I would possibly like this web site.
He used to be totally right. This publish truly made my day.

You can not believe simply how so much time I had spent for this info!
Thank you!
TU 1个月前 (2020-05-31) 回复
What's up everyone, it's my first pay a visit at this web page, and paragraph
is in fact fruitful in favor of me, keep up posting such content.
HI 2个月前 (2020-05-18) 回复
What's up, everything is going fine here and ofcourse every one is sharing data, that's really fine, keep up
writing.
VR 2个月前 (2020-05-07) 回复
Heya i am for the first time here. I found this board and Ӏ to find It truly useful & it helped me out much.
I am hoping to provide one thing back and help others suϲh as you aided me.
WC 2个月前 (2020-05-04) 回复
Hello colleagues, its fantastic article on the topic of tutoringand entirely defined, keep it up all the
time.
MQ 2个月前 (2020-05-01) 回复
Saved as a favorite, I love your web site!
EB 3个月前 (2020-04-16) 回复