1 Reply Latest reply on Oct 5, 2007 8:12 AM by Newsgroup_User

    Adding and multiplying numeric fields


      I have 3 fields that hold pricing information. For each of these fields is a field that represents quantity. I also have a "blank total " field. Example: "Field1", "Qty1", "Field2", "Qty2", "Field3", "Qty3" and "blank total".

      I want to put Lingo in the last frame of the script after "go the frame" and I want to be able to Multiply/Add
      "Field1" * "Qty1" + "Field2" * "Qty2" + "Field3" * "Qty3" and put the value into the "blank total" field. The text fields are not in the "Internal Cast". They are in another cast Library. I cannot get this to work.

      I have tried something like: put the text of field "Field1" * the text of field "Qy1" + "Field1" * the text of field "Qy1" into field "blank total". Can anyone give me direction on this? I would appreciate it.

      Also can I populate a blank text field with the current date? Thanks again

        • 1. Re: Adding and multiplying numeric fields
          Level 7
          If you are actually using #field members as opposed to #text members,
          then you can do something like this:

          put field("field1") * field("Qty1") + field("field2") * field("Qty2") +
          field("field3") * field("Qty3") into field("blank_total")

          (that should be one long line but the forum will probably split it...)

          If you are using #text members, then you would use something like this:

          member("blank_total").text=string(integer(member("Field1")) *
          integer(member("Qty1"))+ integer(member("Field2")) *
          integer(member("Qty2"))+ integer(member("Field3")) *
          integer(member("Qty3")) )

          (again- that should be one long line)