2 Replies Latest reply: Feb 25, 2015 4:06 AM by Friedrich Hofmann RSS

    TRACE - directly enter an expression

    Friedrich Hofmann


      Hi,

       

      is there any way I can make the TRACE command put in the log the result of an expression without first putting this into a variable?

      I have tried with like

      >> $(=Weekday(Today(0))) <<

      the way you do in set_expressions, but that didn't work.

      I also tried with quotes around the whole, but that didn't work either - then it read like

      >> TRACE ' '; <<

      in the log, which isn't quite what I want ...

      That didn't work, however. I then created a variable first and then put this into the TRACE command, like

      >>  LET v_message = Weekday(Today(0)); <<

      >> TRACE $(v_message); <<

      >> LET v_message = NULL(); <<

       

      That works. That is okay, but it should be possible to use this expression directly, no?

       

      Thanks a lot!

      Best regards,

       

      DataNibbler

        • Re: TRACE - directly enter an expression
          Marcus Sommer

          Hi DataNibbler,

           

          I think it would only directly work if there are a possibilty to create an adhoc-variable within the script, like:

           

          trace $(=function());

           

          Therefore a workaround would be needed, maybe with a subroutine like this which could be outsourced in an include-variable for a global using:

           

          sub ShowTraceStament(typ, statement)

           

          if '$(typ)' = 'string' then

              let vTrace = '$(statement)';

          else

              let vTrace = $(statement);

          end if

           

          trace $(vTrace);

           

          end sub

           

          call ShowTraceStament('string', 'hallo welt')

          call ShowTraceStament('numeric', 'weekday(today())')

           

          - Marcus

            • Re: TRACE - directly enter an expression
              Friedrich Hofmann

              Ah.

               

              And those ad-hoc-variables don't work in the script, do they? For that's what I tried ...

              Thanks for helping! A subroutine seems to be a little much ado for that, though - and it wouldn't really make things easier for that's pretty much what I have now.

              I will try putting some more code in that INCLUDE, that should do the job well enough.

              Thanks a lot!

              Best regards,

               

              DataNibbler