Loading ...
Sorry, an error occurred while loading the content.

21561Re: [Clip] Re: Why does a neg value cause a syntax error in calc?

Expand Messages
  • loro
    Mar 1, 2011
    • 0 Attachment
      joy8388608 wrote:
      >; Syntax error when first var is not initialized and second is negative
      >^!Set %JobAmt%=-10
      >^!Set %Temp4%=^$Calc(^%Cash16P% + ^%JobAmt%)$

      Joy, I know this is old, but I was skimming through old post and
      started to play with this again and I discovered something useful.
      It's only when the negative number is the first to be added to the
      not initiated variable the problem occurs.

      Try this.

      ^!Info ^$Calc(^%blah%+0+-5)$
      ===> -5

      So if you always add zero first, I think it should work.

      :-)
      Lotta
    • Show all 17 messages in this topic