Store, access & calculate data?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • thetford
    Forum Member
    • Feb 2005
    • 175

    Store, access & calculate data?

    Hi all, I'm trying to figure out how to take input data from the user and perform simple math calculations on the data and then display the results to the user. An option to save the data/results would also be nice. I know this can be scripted in AM5, I just don't know where to start. This is my idea so far.

    Page one has - input1, input2, etc. Calculate button (on page one), when pressed jumps to page two, which has an "on show" action that performs math calculations on the numbers that where entered in the input boxes on page one. Sounds simple right? I just need a starting point. How to I make the action on page two look for input on page one? Can I store input box data somewhere?


    I have the pro version, and I'm a "novice" scripter (at best) so a simple working example would be great! I have learned more from the templates in AM5 than anything else!

    Corey, I finally got around to using the "speady training" cd I purchased with AM5 pro, great job! It has really helped.
    Mike
  • Worm
    Indigo Rose Customer
    • Jul 2002
    • 3971

    #2
    Here ya go
    Attached Files

    Comment

    • Corey
      Indigo Rose Staff Alumni
      • Aug 2002
      • 9745

      #3
      Hi. Glad to hear you're enjoying the CDs. I'm just getting setup with a pro level studio here and then we're going to release some more. Same price, but even higher quality, and jam packed with all sorts of stuff.

      Here's a really simple example of something like you are describing attached. Take a look and let me know if you need help with it. It's pretty simple and I commented all the code. The main actions are on the button on Page 1 and the "OnShow" even for Page 2. Hope that helps.
      Attached Files

      Comment

      • thetford
        Forum Member
        • Feb 2005
        • 175

        #4
        right, that's just what I needed, a starting point! Thanks a bunch!

        Comment

        • thetford
          Forum Member
          • Feb 2005
          • 175

          #5
          I've tried to implement the "examples" but i get the same message each time - nil value.

          Corey, page one has:

          Input1 (input box)
          Input2 (input box)

          Page two is:

          number1 * number2

          how is input1 (input box) related to number 1? What am I missing here?

          Comment

          • Corey
            Indigo Rose Staff Alumni
            • Aug 2002
            • 9745

            #6
            Well I didn't build in an error checking, in reality you would want to check each number for a nil value, i.e. in case they didn't enter a number.

            To see how number1 and input1 relate, just check out the Input.GetText action on the button on Page one.

            Comment

            • Corey
              Indigo Rose Staff Alumni
              • Aug 2002
              • 9745

              #7
              Here's an updated copy of my version with rudimentary error checking built in.
              Attached Files

              Comment

              • thetford
                Forum Member
                • Feb 2005
                • 175

                #8
                thanks for the help, I guess I need to buy a book on scripting, I keep thinking of scripting in terms of a spreadsheet!

                Any suggestions on a good scripting book? (for beginners)

                Comment

                Working...
                X