[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Examining Variables in EasyLanguage



PureBytes Links

Trading Reference Links

At 6:13 PM -0500 1/16/01, Mike wrote:

>How do you examine variables in EL? I want to write a signal and see
>"Print" all my variables to a window somewhere everytime it executes
>to debug the script. It has a lot of variables.

You can use the "Expert Commentary" capability to display the values
of variables. It is messy since you need to construct the text string
with functions but it does work.

To use it, you just click on a bar with the expert commentary active
and it displays the values.

Not what you might call a modern debugging capability...

Example of code to do this is illustrated below.

Bob Fulks

------

{Commentary to show debug data}

Vars:  SCo1(""),       {String for Condition1 value}
       SCo2(""),       {String for Condition2 value}
       SCo3(""),       {String for Condition3 value}
       String1("");    {Output string}

#BeginCmtryOrAlert
if AtCommentaryBar then begin

   if Condition1 then SCo1 = "TRUE" else SCo1 = "FALSE";
   if Condition2 then SCo2 = "TRUE" else SCo2 = "FALSE";
   if Condition3 then SCo3 = "TRUE" else SCo3 = "FALSE";

   String1 = "Values: " +
      newline + "  Date     = " + NumToStr(Date, 0) +
      newline + "  Time     = " + NumToStr(Time, 0) +
      newline + "  State    = " + NumToStr(State, 0) +
      newline + "  MP       = " + NumToStr(MP, 0) +
      newline + "  High     = " + NumToStr(High, 2) +
      newline + "  Low      = " + NumToStr(Low, 2) +
      newline + "  Low[1]   = " + NumToStr(Low[1], 2) +
      newline + "  Close    = " + NumToStr(Close, 2) +
      newline + "  SlowK    = " + NumToStr(SK, 0) +
      newline + "  Slope    = " + NumToStr(Slope, 2) +
      newline + "  Top      = " + NumToStr(Top, 2) +
      newline + "  Bot      = " + NumToStr(Bot, 2) +
      newline + "  SellPt   = " + NumToStr(SellPt, 2) +
      newline + "  TopPri   = " + NumToStr(TopPri, 2) +
      newline + "  BotPri   = " + NumToStr(BotPri, 2) +
      newline + "  SpanPri  = " + NumToStr(SpanPri, 2) +
      newline + "  UpBand   = " + NumToStr(UpBand, 2) +
      newline + "  DnBand   = " + NumToStr(DnBand, 2) +
      newline + "  SpanBand = " + NumToStr(SpanBand, 2) +
      newline + "  Cond1    = " + Sco1 +
      newline + "  Cond2    = " + Sco2 +
      newline + "  Cond3    = " + Sco3;
     
  
   Commentary(String1);
end;
#end;