Announcement

Collapse
No announcement yet.

sign invert

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    sign invert



    Hello all

    I have a little trouble.. I need sign invert, but not work.. :(

    I do :

    <MvASSIGN NAME =3D "l.neg" VALUE =3D "{ -10}">=20
    <MvASSIGN NAME =3D "l.pos" VALUE =3D "{ 10}">=20
    <MvASSIGN NAME =3D "l.var" VALUE =3D "{ neg * -1}">=20

    &[var]

    10 - OK =20

    now I need save diference

    <MvASSIGN NAME=3D "alias.d.FIELD" VALUE=3D"{ var - pos}">

    In a database save -0=20

    ???

    What I do wrong?






    Roberto Buccino
    IT Developer
    ______________________________
    Alfa Centauro Custom System
    Copahue 3480 Melipal
    (02944) 44 11 88 / 15 60 3287
    ______________________________
    San Carlos de Bariloche - Rio Negro
    Patagonia - Argentina=20
    <A HREF ="http://www.paralelo42.com">http://www.paralelo42.com</A>



    #2
    sign invert



    Use -1*neg or neg*(-1)

    Ivo
    http://mivo.truxoft.com


    -----Original Message-----
    From: Roberto Buccino


    Hello all

    I have a little trouble.. I need sign invert, but not work.. :(

    I do :

    <MvASSIGN NAME = "l.neg" VALUE = "{ -10}">
    <MvASSIGN NAME = "l.pos" VALUE = "{ 10}">
    <MvASSIGN NAME = "l.var" VALUE = "{ neg * -1}">

    &[var]

    10 - OK

    now I need save diference

    <MvASSIGN NAME= "alias.d.FIELD" VALUE="{ var - pos}">

    In a database save -0

    ???

    What I do wrong?






    Roberto Buccino
    IT Developer
    ______________________________
    Alfa Centauro Custom System
    Copahue 3480 Melipal
    (02944) 44 11 88 / 15 60 3287
    ______________________________
    San Carlos de Bariloche - Rio Negro
    Patagonia - Argentina
    <A HREF ="http://www.paralelo42.com">http://www.paralelo42.com</A>


    Comment


      #3
      sign invert



      Other than the fact you switch variable names (scoped vs.
      non-scoped) I'm not sure what you think is wrong.

      l.neg = -10
      l.pos = 10

      l.var = l.neg * -1 = -10 * -1 = 10

      alias.d.field = l.var - l.pos = 10 - 10 = 0

      Therefore alias.d.field stores zero, which is correct.

      /Scott Mc

      --- Roberto Buccino <[email protected]> wrote:
      > Hello all
      >
      > I have a little trouble.. I need sign invert, but not
      > work.. :(
      >
      > I do :
      >
      > <MvASSIGN NAME = "l.neg" VALUE = "{ -10}">
      > <MvASSIGN NAME = "l.pos" VALUE = "{ 10}">
      > <MvASSIGN NAME = "l.var" VALUE = "{ neg * -1}">
      >
      > &[var]
      >
      > 10 - OK
      >
      > now I need save diference
      >
      > <MvASSIGN NAME= "alias.d.FIELD" VALUE="{ var - pos}">
      >
      > In a database save -0
      >
      > ???
      >
      > What I do wrong?
      >
      >
      >
      >
      >
      >
      > Roberto Buccino
      > IT Developer
      > ______________________________
      > Alfa Centauro Custom System
      > Copahue 3480 Melipal
      > (02944) 44 11 88 / 15 60 3287
      > ______________________________
      > San Carlos de Bariloche - Rio Negro
      > Patagonia - Argentina
      > <A HREF ="http://www.paralelo42.com">http://www.paralelo42.com</A>
      >
      >

      Comment


        #4
        sign invert



        Roberto,
        I've ran into -0 also, and I think it might be a flaw in empressa in how =
        it
        handles such situations. I had to check the variable for the existence =
        of -0
        and change it to just 0 manually.

        Bill M.

        > -----Original Message-----
        > From: [email protected]=20
        > [mailto:[email protected]] On Behalf Of Roberto Buccino
        > Sent: Friday, March 04, 2005 9:34 PM
        > To: [email protected]
        > Subject: [meu] sign invert
        >=20
        >=20
        > Hello all
        >=20
        > I have a little trouble.. I need sign invert, but not work.. :(
        >=20
        > I do :
        >=20
        > <MvASSIGN NAME =3D "l.neg" VALUE =3D "{ -10}">=20
        > <MvASSIGN NAME =3D "l.pos" VALUE =3D "{ 10}">=20
        > <MvASSIGN NAME =3D "l.var" VALUE =3D "{ neg * -1}">=20
        >=20
        > &[var]
        >=20
        > 10 - OK =20
        >=20
        > now I need save diference
        >=20
        > <MvASSIGN NAME=3D "alias.d.FIELD" VALUE=3D"{ var - pos}">
        >=20
        > In a database save -0=20
        >=20
        > ???
        >=20
        > What I do wrong?
        >=20
        >=20
        >=20
        >=20
        >=20
        >=20
        > Roberto Buccino
        > IT Developer
        > ______________________________
        > Alfa Centauro Custom System
        > Copahue 3480 Melipal
        > (02944) 44 11 88 / 15 60 3287
        > ______________________________
        > San Carlos de Bariloche - Rio Negro
        > Patagonia - Argentina=20
        > <A HREF ="http://www.paralelo42.com">http://www.paralelo42.com</A>
        >=20
        >=20

        Comment


          #5
          sign invert




          Ivo

          (I use miva empresa)

          I try it before and do the same "-0"

          The procedure is one balance account


          old balance, debit, credit and new balance

          I think the trouble will be a var declaration but
          when the balance is positive save good...
          but if the balance is 0 save -0

          If I var declare different when the balance is positive save negative, bu=
          t
          when the balance is 0 save 0..

          :oS

          El S=E1bado 05 Marzo 2005 00:01, Ivo Truxa escribi=F3:
          > Use -1*neg or neg*(-1)
          >
          > Ivo
          > http://mivo.truxoft.com
          >
          >
          > -----Original Message-----
          > From: Roberto Buccino
          >
          >
          > Hello all
          >
          > I have a little trouble.. I need sign invert, but not work.. :(
          >
          > I do :
          >
          > <MvASSIGN NAME =3D "l.neg" VALUE =3D "{ -10}">
          > <MvASSIGN NAME =3D "l.pos" VALUE =3D "{ 10}">
          > <MvASSIGN NAME =3D "l.var" VALUE =3D "{ neg * -1}">
          >
          > &[var]
          >
          > 10 - OK
          >
          > now I need save diference
          >
          > <MvASSIGN NAME=3D "alias.d.FIELD" VALUE=3D"{ var - pos}">
          >
          > In a database save -0
          >
          > ???
          >
          > What I do wrong?
          >
          >
          >
          >
          >
          >
          > Roberto Buccino
          > IT Developer
          > ______________________________
          > Alfa Centauro Custom System
          > Copahue 3480 Melipal
          > (02944) 44 11 88 / 15 60 3287
          > ______________________________
          > San Carlos de Bariloche - Rio Negro
          > Patagonia - Argentina
          > <A HREF ="http://www.paralelo42.com">http://www.paralelo42.com</A>
          >
          >


          Comment


            #6
            sign invert



            There are rounding bugs in diverse Empresa engines - surprisingly there =
            are
            often small rest numbers even after simplest integer operations, and
            although mostly not displayed, they can completely break the result. =
            Check
            the list archive for [mvm:bug] or "bug" in subject. You can get rid of =
            it
            either by rounding, or sometimes by multiplying. For example

            (-1*neg) ROUND 0
            int(-1*neg)
            floor(-1*neg)
            1*(-1*neg)

            You have to see what will work the best in your situation. Upgrading =
            your
            Empresa or Mia would be a good precaution.

            Ivo
            http://mivo.truxoft.com=20




            -----Original Message-----
            From: Roberto Buccino


            Ivo

            (I use miva empresa)

            I try it before and do the same "-0"

            The procedure is one balance account


            old balance, debit, credit and new balance

            I think the trouble will be a var declaration but
            when the balance is positive save good...
            but if the balance is 0 save -0

            If I var declare different when the balance is positive save negative, =
            but
            when the balance is 0 save 0..

            :oS

            El S=E1bado 05 Marzo 2005 00:01, Ivo Truxa escribi=F3:
            > Use -1*neg or neg*(-1)
            >
            > Ivo
            > http://mivo.truxoft.com
            >
            >
            > -----Original Message-----
            > From: Roberto Buccino
            >
            >
            > Hello all
            >
            > I have a little trouble.. I need sign invert, but not work.. :(
            >
            > I do :
            >
            > <MvASSIGN NAME =3D "l.neg" VALUE =3D "{ -10}">
            > <MvASSIGN NAME =3D "l.pos" VALUE =3D "{ 10}">
            > <MvASSIGN NAME =3D "l.var" VALUE =3D "{ neg * -1}">
            >
            > &[var]
            >
            > 10 - OK
            >
            > now I need save diference
            >
            > <MvASSIGN NAME=3D "alias.d.FIELD" VALUE=3D"{ var - pos}">
            >
            > In a database save -0
            >
            > ???
            >
            > What I do wrong?
            >
            >
            >
            >
            >
            >
            > Roberto Buccino
            > IT Developer
            > ______________________________
            > Alfa Centauro Custom System
            > Copahue 3480 Melipal
            > (02944) 44 11 88 / 15 60 3287
            > ______________________________
            > San Carlos de Bariloche - Rio Negro
            > Patagonia - Argentina
            > <A HREF ="http://www.paralelo42.com">http://www.paralelo42.com</A>
            >
            >


            Comment


              #7
              sign invert




              IVO:

              I try all posibility.. finaly If the balance is zero (save -0) with floor=
              fix
              it, but is not zero, with (-1*neg) then I put IF-ELSE..

              ;o)

              Now work well. I have a linux miva empresa 3.9408

              SCOTT:

              I try yours scope system...


              Thank's for your help


              Roberto



              often small rest numbers even after simplest integer operations, and
              although mostly not displayed, they can completely break the result. Chec=
              k
              the list archive for [mvm:bug] or "bug" in subject. You can get rid of it
              either by rounding, or sometimes by multiplying. For example

              (-1*neg) ROUND 0
              int(-1*neg)
              floor(-1*neg)
              1*(-1*neg)

              You have to see what will work the best in your situation. Upgrading your
              Empresa or Mia would be a good precaution.

              Ivo
              http://mivo.truxoft.com




              -----Original Message-----
              From: Roberto Buccino


              Ivo

              (I use miva empresa)

              I try it before and do the same "-0"

              The procedure is one balance account


              old balance, debit, credit and new balance

              I think the trouble will be a var declaration but
              when the balance is positive save good...
              but if the balance is 0 save -0

              If I var declare different when the balance is positive save negative, bu=
              t
              when the balance is 0 save 0..

              :oS

              El S=E1bado 05 Marzo 2005 00:01, Ivo Truxa escribi=F3:
              > Use -1*neg or neg*(-1)
              >
              > Ivo
              > http://mivo.truxoft.com

              -------------------------------------------------------

              --=20


              Roberto Buccino
              IT Developer
              ______________________________
              Alfa Centauro Custom System
              Copahue 3480 Melipal
              (02944) 44 11 88 / 15 60 3287
              ______________________________
              San Carlos de Bariloche - Rio Negro
              Patagonia - Argentina=20
              <A HREF ="http://www.paralelo42.com">http://www.paralelo42.com</A>


              Comment

              Working...
              X