Open Forex4you Account

Server รัน EA 1000 / ปี

สั่งชื้อคู่มือการโปรแรกม MQL4

Author Topic: คำสั่งขึ้นบรรทัดใหม่ comment  (Read 8761 times)

chartwat

  • Newbie
  • *
  • Posts: 43
คำสั่งขึ้นบรรทัดใหม่ comment
« on: มิถุนายน 26, 2014, 09:41:39 am »
admin ครับ คำสั่งขึ้นบรรทัดใหม่ comment มันพิมพ์แล้ว ตัวหนังสือล้นจอ ขึ้น บรรทัดใหม่ยังไง ครับ ขอบคุณครับ

admin

  • Administrator
  • Hero Member
  • *****
  • Posts: 2386
Re: คำสั่งขึ้นบรรทัดใหม่ comment
« Reply #1 on: มิถุนายน 26, 2014, 11:06:35 am »
\n  ครับ

chartwat

  • Newbie
  • *
  • Posts: 43
Re: คำสั่งขึ้นบรรทัดใหม่ comment
« Reply #2 on: มิถุนายน 26, 2014, 01:45:57 pm »
ขอบคุณมากครับ มีตัวอย่างการใช้งานใหม ครับ ลองแล้ว มัน error ไม่ผ่านครับ
« Last Edit: มิถุนายน 26, 2014, 01:53:08 pm by chartwat »

veronika

  • Newbie
  • *
  • Posts: 44
Re: คำสั่งขึ้นบรรทัดใหม่ comment
« Reply #3 on: มิถุนายน 26, 2014, 04:11:19 pm »
Quote
{
   string sComment   = "";
   string sp         = "-------------------------------------------------------------";
   string sp2        = "-----------------------------------";
   string NL         = "\n"; 
//----   
   sComment = sComment + sp + NL;
   sComment = sComment + "Sorry can not connect server. Please check your Account Number or License Key" + NL; 
   sComment = sComment + sp + NL;
   Comment(sComment);

chartwat

  • Newbie
  • *
  • Posts: 43
Re: คำสั่งขึ้นบรรทัดใหม่ comment
« Reply #4 on: มิถุนายน 26, 2014, 04:18:07 pm »
อันนี้ ที่ผม จะให้แสดงผล จะแทรกยังไงครับ
  Comment("s",space," P",Pipstep,"_",TakeProfit,"X",LotExponent," m",mg,"/",fmg," R",rsi," P",Price," A",Ans," To",total," X",x4,"-",x5,"-",x6," T",Tic," C",c1,"-",c2,"-",c3);     

veronika

  • Newbie
  • *
  • Posts: 44
Re: คำสั่งขึ้นบรรทัดใหม่ comment
« Reply #5 on: มิถุนายน 26, 2014, 04:37:42 pm »
เอาเครื่องหมาย "" สลับก้นครับ
แล้วตัวแปรที่จะเอามาแสดงผลก็ให้เปลี่ยนเป็น String
จะได้ไม่มีปัญหากับคำสั่ง comment

เช่น
Code: [Select]
  string sComment   = "";
   string sp2        = "-----------------------------------";
   string NL         = "\n";  

   string CountBuy = CountBuy();
   string LotsDynamicBuy = LotsDynamicBuy();
   string CalBuy = DoubleToStr(CalculateBuy(),4);

   sComment = sComment + "Count Buy Order = " + CountBuy + NL;
   sComment = sComment + "Next Lots Buy = " + DoubleToStr(LotsDynamicBuy,2) + NL;
   sComment = sComment + "Order Buy Average = " + CalBuy + NL;
   sComment = sComment + PF + " Buy = " + TBuy + NL;
   sComment = sComment + sp2 + NL;