No announcement yet.


  • Filter
  • Time
  • Show
Clear All
new posts

  • Calculations

    Hi all;
    I need to gather two numbers from the user and resolve them to a final total. Box #1 must accept numbers up to 99,999,999 and Box #2 must accept numbers up to 9,999. Don't need the commas in the data. I am able to gather the numbers from two "Edit Field Objects" if I fill all the spaces, but cannot figure out how to handle _ _ ,123,456 or _,500.

    Any help would be most appreciated.


    :confused: Jim Smiley

  • #2
    There are a couple of things that you can do:

    The first thing that I figure out that you can do is this.

    using the comand get information of the tools "dialog" you can tell the user to enter both numbers, you can almacenate them into variables an use them as you want but in this way you can not validate the information or condition the number of characters

    other way but longer is:

    when your project starts create two text files in the host computer, one file called a and other called b, place two edit field objects in your computer and use a imput mask, for the numbers of characters that you need on each field, get the text of both and send each one to the text files one on each file.

    after that you can read each of the text files and get the numbers back in the project into two variables that you can use as you want.

    I still do not test this, please tell me if it works.


    • #3
      You are in luck. The AMS community just happens to be fortunate enough to have this incredible contributor named Worm. He has built a number of DLL’s that are absolutely amazing, and the fellow just gives them to all of us for free. A while back he gave us a DLL called TrimSpaces.dll that will do exactly what you want. he even built a sample project to show how to use it. I know he don’t mind me sharing it, so I am including it for you to download and use. Remember, Worm is the guy that gets all the credit and thanks for this. He really is amazing, and generous.
      Attached Files


      • #4
        I might be missing something here but you guys can just use a STRING > REPLACE action to trim spaces, commas, or anything else... Very easy. Just put a space in the string to replace field and leave the other field blank...

        Corey Milner
        Creative Director, Indigo Rose Software


        • #5
          Oh sure Corey, show him the easy way to do it. I guess that’s why you get the big bucks, and I’m still a Junior Member. Mr. Smiley, I would have to agree with Corey, his suggestion is a better way.


          • #6
            Hilarious. FWIW I think it's excellent to see several solutions to each problem, I love that kind of stuff, keep 'em coming. I learn plenty from you guys, several times a week I learn a new way to do something in here... For me learning is everything so I really enjoy these alternative perspectives. I agree with you about Worm too, he's one of the pure.

            Hey JimS, you want a custom title, i.e. "Mr. Smiley" instead? Anytime... Just PM it to me and I'll get it in there for you.

            Corey Milner
            Creative Director, Indigo Rose Software


            • #7
              Thanks Corey, but I like the title Junior Member. That just happens to be what my girl friend calls me too. :confused: Besides, if I had a more prestigious title, people might expect more from me.


              • #8
                Corey, JimS & jm_gallegos;

                Thank you all for your suggestions. Tried Corey's advice and it worked well. It's amazing what AMS is able to do. Thanks for pointing me in the right direction.

                I'm sure I'll be back with more questions.

                Thanks again;

                Jim Smiley


                • #9
                  Another tip that would help with this problem: use the edit field object's "Return raw data" setting. For more info, see the help topic for the edit field object's settings.
                  --[[ Indigo Rose Software Developer ]]