Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

quick help with a calculation

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

    #16
    Re: quick help with a calculation

    Originally posted by hov333 View Post
    thats what I got from Tom, thanks for your help though. I will try these other options and see what happens.
    There is a considerable difference between

    my calc-> (Var->IGNORE1)-(var->scan_serial)-(Var->IGNORE2)

    and

    calcfield=strtran(scan_serial,ignore,"")
    Al Buchholz
    Bookwood Systems, LTD
    Weekly QReportBuilder Webinars Thursday 1 pm CST

    Occam's Razor - KISS
    Normalize till it hurts - De-normalize till it works.
    Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
    When we triage a problem it is much easier to read sample systems than to read a mind.
    "Make it as simple as possible, but not simpler."
    Albert Einstein

    http://www.iadn.com/images/media/iadn_member.png

    Comment


      #17
      Re: quick help with a calculation

      Originally posted by Al Buchholz View Post
      context is very important.

      I'd suggest that you post an example form/browse of what you really want to do.
      I have a total of 3 variables and 1 calculated result:
      scan_serial
      ignore1
      ignore2

      ignore1-scan_serial-ignore2=result

      I don't know how else I can provide an example. The order is important thats why I have put ignore2 to remove the trailing string from scan_serial
      Last edited by Al Buchholz; 08-23-2011, 12:35 PM. Reason: highlight what is needed....

      Comment


        #18
        Re: quick help with a calculation

        my calc-> (Var->IGNORE1)-(var->scan_serial)-(Var->IGNORE2)

        I'm sorry for the confusion, by this I was trying to show (logically) how I want the function to work.
        by no means is this what I'm entering as the calculation

        Comment


          #19
          Re: quick help with a calculation

          Code:
          scan_serial = "SXXD"
          ignore1 = "S"
          ignore2 = "D"
          
          out = if(left(scan_serial,1) = ignore1,"",left(scan_serial,1)) + substr(scan_serial,2,len(scan_serial)-2)+if(right(scan_serial,1) = ignore2,"",right(scan_serial,1))
          ? out
          = "XX"
          
          scan_serial = "SSSXXDSD"
          out = if(left(scan_serial,1) = ignore1,"",left(scan_serial,1)) + substr(scan_serial,2,len(scan_serial)-2)+if(right(scan_serial,1) = ignore2,"",right(scan_serial,1))
          ? out
          = "SSXXDS"
          There can be only one.

          Comment


            #20
            Re: quick help with a calculation

            Originally posted by hov333 View Post
            thanks for the reply stan, but this may as well be Swahili for me.......When a number is entered -> SXXDSSD
            The result has to be = XXDSS (not XX)
            Now you're speaking clear Swahili - got it - what you want is maybe
            Code:
            b="D87C88D"
            ?substr(b,2,5)
            = "87C88"
            Maybe if you want the first and last chr removed then include len()
            subs(b,2,len(b)-2) and if thats not it - give us another clue.
            Ha

            Comment


              #21
              Re: quick help with a calculation

              How about something like this

              Code:
              DIM IGNORE1 AS C
              DIM IGNORE2 AS C
              DIM SCAN_SERIAL AS C
              DIM CALC_FIELD AS C
              
              IGNORE1="S"
              IGNORE2="D"
              SCAN_SERIAL="SXXDSSD"
              
              CALC_FIELD=strtran(SCAN_SERIAL,ignore1,"",1,1)
              
              msgbox("SXXDSSD",CALC_FIELD)
              
              CALC_FIELD=strtran(*reverse(CALC_FIELD),ignore2,"",1,1)
              
              CALC_FIELD=*REVERSE(CALC_FIELD)
              msgbox("SXXDSSD", CALC_FIELD)

              Tom
              Last edited by Tbaker; 08-23-2011, 01:13 PM. Reason: changed code

              Comment


                #22
                Re: quick help with a calculation

                Not that it matters in any way other than that it's a waste of cyber space but evidently you did not read my first post..
                Translating your question from Swahilli to English:
                I want ignore1 to remove the first occurrance of ignore1
                And I want ignore2 to remove the last occurrance of ignore2
                Assuming my Swahilli is still fresh, here is one way:
                Code:
                dim userNo as c="SXXDSSD"
                dim ignore1 as c= "S"
                dim ignore2 as c= "D"
                
                ?stuff(stuff(userNo,1,1,""),at(ignore2,userNo,occurs(ignore2,userNo)),1,"")
                = "XXDSSD"
                Of course, there are many other ways to do this..just want to make sure my Swahilli interpretation is good before getting too deep in the weeds.

                Comment


                  #23
                  Re: quick help with a calculation

                  haha thanks for all the input guys. By swahilli I meant trying to make sense of all this coding.

                  I don't need the full code that everyone is providing, I already have my dialog boxes set up and variables set up via the codeless action scripts. I just need help with the calculated field.

                  First off, I don't want to be just removing the first or last characters, but instead the EXACT string that is the ignore1 & ignore2 fields. Lol this is getting ridiculously complicated, either my examples are horrible or theres a good reason why programmers get paid good $.

                  At least logically this seemed like a pretty simple task...

                  Looks like there are a lot of ways to achieve the same result. I wish I knew an easy way to just upload only the form, anyway here is the code I'm using that works perfectly except that it removes the characters without attention to order.

                  scan_seriall = stritran_multi(Var->scan_serial,Var->ignore1+crlf()+Var->ignore2,"")

                  Sorry Gabriel I didn't ignore your post, I just didn't know what to think of it since it was all code...I actually still don't know what context to even use that in.

                  Comment


                    #24
                    Re: quick help with a calculation

                    DIM IGNORE1 AS C = "S"
                    DIM IGNORE2 AS C = "D"
                    DIM SCAN_SERIAL AS C = "SXXDSSD"

                    DIM CALC_FIELD AS C = chrtran(left(scan_serial, 1), ignore1, "") + mid(scan_serial, 2, len(scan_serial) - 2) + chrtran(right(scan_serial, 1), ignore2, "")
                    ?calc_field
                    = "XXDSS"

                    Note: this only works for single character ignore? values, and only works for single occurences of the ignore? values.

                    Comment


                      #25
                      Re: quick help with a calculation

                      Originally posted by hov333 View Post
                      First off, I don't want to be just removing the first or last characters, but instead the EXACT string that is the ignore1 & ignore2 fields. Lol this is getting ridiculously complicated, either my examples are horrible or there's a good reason why programmers get paid good $. (yup)

                      At least logically this seemed like a pretty simple task...
                      Application development is a details oriented world. Not much room for assumptions.

                      To upload a form, you'll need to send a table/set(and it's tables) so we can see directly what you are doing.

                      Short of that we are shooting in the dark...
                      Al Buchholz
                      Bookwood Systems, LTD
                      Weekly QReportBuilder Webinars Thursday 1 pm CST

                      Occam's Razor - KISS
                      Normalize till it hurts - De-normalize till it works.
                      Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
                      When we triage a problem it is much easier to read sample systems than to read a mind.
                      "Make it as simple as possible, but not simpler."
                      Albert Einstein

                      http://www.iadn.com/images/media/iadn_member.png

                      Comment


                        #26
                        Re: quick help with a calculation

                        Originally posted by hov333 View Post
                        First off, I don't want to be just removing the first or last characters, but instead the EXACT string that is the ignore1 & ignore2 fields.
                        Now you went way deep in the forest where they speak a completely different dialect of Swahilli.
                        What exactly do you mean?
                        In your example:
                        Code:
                        ignore1= S
                        ignore2= D
                        
                        When a number is entered -> SXXDSSD
                        
                        The result has to be = XXDSS (not XX)
                        Clearly there is more than one S & more than one D. Which S and which D do you want to remove?

                        Comment


                          #27
                          Re: quick help with a calculation

                          tony, would I be able to copy paste this somewhere?

                          Right now I'm working between the Form->"variables" & Form->"calculated fields" drop-downs from my form window.

                          Comment


                            #28
                            Re: quick help with a calculation

                            Originally posted by G Gabriel View Post
                            ..just want to make sure my Swahilli interpretation is good before getting too deep in the weeds.
                            two comments, I still have a bit of cyberspace;-
                            1. Gabe - you know, they actually speak Swahili about 3hrs flight north of here, and I could stop off in Malawi on the way, they have great weeds
                            2. HOV333 "this seemed like a pretty simple task.." when someone tells me their requirement is simple I feel the same as when someone starts their sentence with "trust me.."

                            Comment


                              #29
                              Re: quick help with a calculation

                              so ignore1 is looking before scan_serial and ignore2 is after scan_serial.

                              That's why I had written:
                              my calc-> (Var->IGNORE1)-(var->scan_serial)-(Var->IGNORE2)

                              to show as an example, not an actual function but it probably caused more confusion than it was worth.

                              lol Ray i guess you're right. I've learned that almost nothing is as simple as it seems in my experiences with A5. I've gotten spoiled by being in the Google generation i guess :(

                              Comment


                                #30
                                Re: quick help with a calculation

                                If you provide a input/result table that shows what result you want for various input values, it would be easier to understand what you are looking for.

                                e.g. the 12:41 post will provide these results:
                                SXXDSSD -> XXDSS
                                SSXXDSSDD -> SXXDSSD
                                SXXDSS -> XXDSS
                                XXDSSD -> XXDSS
                                etc.

                                Comment

                                Working...
                                X