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

Re: Can someone verify a possible new problem in NTL V7pr3

Expand Messages
  • flo.gehrke
    ... Joy, I don t think this is new. When testing with NT Pro 6.2... ^!Info ^$Calc(^?{Number of shares}+0;2)$ NT returns error in expression too. However,
    Message 1 of 4 , Apr 10 12:06 PM
    View Source
    • 0 Attachment
      --- In ntb-clips@yahoogroups.com, "joy8388608" <mycroftj@...> wrote:
      >
      > I'm sure this worked before V7pr3 (Win 7 64 bit)
      >
      > It asked for a value, rounded (formatted) it to two decimal places and assigned it to the new variable. (I don't recall if adding zero in CALC was necessary.)
      >
      > ^!Set %NewNumShares%=^$Calc(^?{Number of shares} + 0;2)$
      > ^!Prompt NewNumShares is ^%NewNumShares%
      >
      > When I run it now, the prompt gives NewNumShares is [error in expression]


      Joy,

      I don't think this is new. When testing with NT Pro 6.2...

      ^!Info ^$Calc(^?{Number of shares}+0;2)$

      NT returns 'error in expression' too.

      However, when using square brackets it works:

      ^!Info ^$Calc(^?[Number of shares]+0;2)$

      I think the difference is that, with curly braces, NT tries to execute the calculation BEFORE the value is entered into the wizard. With square brackets, the wizard is displayed first, accepts the value, and passes it over to the calculation.

      Regards,
      Flo
    • joy8388608
      ... Hi Flo, Thanks for checking. You appear to be correct. Sorry about that. This was from a clip I use every couple of months in my permanent (not test)
      Message 2 of 4 , Apr 10 6:19 PM
      View Source
      • 0 Attachment
        --- In ntb-clips@yahoogroups.com, "flo.gehrke" <flo.gehrke@...> wrote:
        >
        > --- In ntb-clips@yahoogroups.com, "joy8388608" <mycroftj@> wrote:
        > >
        > > I'm sure this worked before V7pr3 (Win 7 64 bit)
        > >
        > > It asked for a value, rounded (formatted) it to two decimal places and assigned it to the new variable. (I don't recall if adding zero in CALC was necessary.)
        > >
        > > ^!Set %NewNumShares%=^$Calc(^?{Number of shares} + 0;2)$
        > > ^!Prompt NewNumShares is ^%NewNumShares%
        > >
        > > When I run it now, the prompt gives NewNumShares is [error in expression]
        >
        >
        > Joy,
        >
        > I don't think this is new. When testing with NT Pro 6.2...
        >
        > ^!Info ^$Calc(^?{Number of shares}+0;2)$
        >
        > NT returns 'error in expression' too.
        >
        > However, when using square brackets it works:
        >
        > ^!Info ^$Calc(^?[Number of shares]+0;2)$
        >
        > I think the difference is that, with curly braces, NT tries to execute the calculation BEFORE the value is entered into the wizard. With square brackets, the wizard is displayed first, accepts the value, and passes it over to the calculation.
        >
        > Regards,
        > Flo
        >

        Hi Flo,
        Thanks for checking. You appear to be correct. Sorry about that.

        This was from a clip I use every couple of months in my permanent (not test) library and there were several lines like that. I did change that clip a few weeks ago but can't imagine how I could have left it not working like that.

        I know false alarms are annoying, but assume Eric would much rather have them than put out a release with a real bug.

        Joy
      • hsavage
        ... and assigned it to the new variable. (I don t recall if adding zero in CALC was necessary.) ... expression] ... Joy, This may be the problem. ^$Calc(;0)$
        Message 3 of 4 , Apr 23 10:19 PM
        View Source
        • 0 Attachment
          On 4/10/2012 12:40 PM, joy8388608 wrote:
          > I'm sure this worked before V7pr3 (Win 7 64 bit)
          >
          > It asked for a value, rounded (formatted) it to two decimal places
          and assigned it to the new variable. (I don't recall if adding zero
          in CALC was necessary.)
          >
          > ^!Set %NewNumShares%=^$Calc(^?{Number of shares} + 0;2)$
          > ^!Prompt NewNumShares is ^%NewNumShares%
          >
          > When I run it now, the prompt gives NewNumShares is [error in
          expression]
          >
          > Joy

          Joy,

          This may be the problem. ^$Calc(;0)$ doesn't like superfluous spaces
          or dashes(minuses) in the calculation, either eliminate them or
          replace with underscores.

          ----------------
          H="test calc"
          ;—•····
          ^!SetDebug 1
          ;—•----
          ;—• ^$Calc(;0)$ doesn't like superfluous spaces
          ;—• or dashes(minuses) in the calculation
          ;—•
          ^!Set %Numberofshares%=11
          ^!Set %Number_of_shares%=11
          ;—• cal
          ;—•^!Set %NewNumShares%=^$Calc(11+0;3)$
          ^!Set %NewNumShares%=^$Calc(^%Numberofshares%+0;3)$
          ^!Set %NewNumShares%=^$Calc(^%Number_of_shares%+0;3)$
          ^!Prompt NewNumShares is ^%NewNumShares%
          ----------------

          ···············································
          ¤• JD#...115 - ¤• SL...913 - 12.04.24~00.13.39

          • Mothers With Teenagers
          • Know Why Animals Eat Their Young.

          € hrs € hsavage € pobox € com
        Your message has been successfully submitted and would be delivered to recipients shortly.