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

Dropdown box not triggering the OnChange Event

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

    #16
    Re: Dropdown box not triggering the OnChange Event

    Jeff:
    Some clarification as to how arrays work is in order:
    1-You need array.dump() to show the elements of the array.
    2-You do not need the "r" flag in this case.
    3-Dynamically populated means you do not tell alpha what are the elements of the array but rather alpha goes and collect those elements from a table or something else
    4-In your case, you did tell alpha what the elements are since you specified the colors in the function. Every time you run this functions, it will show the SAME colors you specified, hence the array that appears in the first dropdown is populated statically not dynamically, populated by you not by alpha.
    5-array.delte() or ARRAY.CLEAR() is a whole lot faster than iterating over each element of the array
    Last edited by G Gabriel; 01-19-2007, 02:50 PM.

    Comment


      #17
      Re: Dropdown box not triggering the OnChange Event

      Originally posted by G Gabriel View Post
      Jeff:
      Some clarification as to how arrays work is in order:
      1-You need array.dump() to show the elements of the array. Which is what I used.
      2-You do not need the "r" flag in this case. You do in fact... See the addition in red to the post above...
      3-Dynamically populated means you do not tell alpha what are the elements of the array but rather alpha goes and collect those elements from a table or something else. I think some would agree with me that what I'm doing with my array is technically "dynamic population"
      4-In your case, you did tell alpha what the elements are since you specified the colors in the function. Every time you run this functions, it will show the SAME colors you specified, hence the array that appears in the first dropdown is populated statically not dynamically.
      5-array.delte() is a whole lot faster than iterating over each element of the array. Again, See the addition in red to the post above... .delete works great if you know the position of the value you would like to remove from the array...

      Gabe, you're right... the array is STATIC, but the values in the array are NEVER static. There is no FIRST dropdown. The user can select a color from any one of the five dropdowns first. Therefore, it is impossible to determine what the values of the list for any of the dropdowns is going to be. I have attached my database in a previous post...if you would like to see it in action.

      Comment


        #18
        Re: Dropdown box not triggering the OnChange Event

        I am glad we are making some progress..
        The first array, it does not matter where you invoke it from, it comes from your function and in THAT FUNCTION there is a pre-determined list of colors that YOU specified, hence that first list of elements is pre-determined, i.e., it's static.

        The second array will be the first array less the chosen color.

        Yes you can determine the position of any element in an array: use array.find() and thus you can delete that element with array.clear(), or word_substract().

        Comment


          #19
          Re: Dropdown box not triggering the OnChange Event

          Originally posted by G Gabriel View Post
          I am glad we are making some progress..
          The first array, it does not matter where you invoke it from, it comes from your function and in THAT FUNCTION there is a pre-determined list of colors that YOU specified, hence that first list of elements is pre-determined, i.e., it's static.

          The second array will be the first array less the chosen color.

          Yes you can determine the position of any element in an array: use array.find() and thus you can delete that element with array.clear(), or word_substract().
          Are you saying it's faster to call 2 methods to remove one item in an array than it is to use two for loops?!? I wonder how array.find() locates the item in the list anyway? A loop perhaps? It probably is faster than my code... I'll test it.

          I don't know if you call this progress... :D j/k
          There's only ONE array. If you go look at my code (posted in the initial post) you'll see this:

          ' Loop through the array containing all of the colors.
          ' Compare the each color with the five color fields on the form.
          ' IF we find a match... set that color = "".
          FOR j = 1 TO 19 STEP +1
          FOR i = 1 TO 5 STEP +1
          IF (color[j] = eval(arrayFld+alltrim(str(i))+".value"))
          color[j] = ""
          END IF
          NEXT
          NEXT

          Comment


            #20
            Re: Dropdown box not triggering the OnChange Event

            arrays function more like a table with an index. with array.find(), you should be able to locate the chosen element and with array.clear() alpha goes straight to that element and remove it from the array.

            Of course it's faster, even if we assume that alpha iterates over the array to find that element, it will stop once it finds it and won't have to iterate over the entire list.

            In fact, since you specify the original colors, You know where is that particular element is and you could send alpha straight to that element and avoid the iteration .

            Yes, I know there is one array. You indicated that you want to present the user with a list of colors, when the user chooses one color, and when you move to the second dropdown, you want the original array that have all the colors to show all the colors except the color the user chose so you do not have the same color for the front and the back.

            That "second" array is the "first" one less the chosen color. It is not the same array, the elements are different now.

            Comment


              #21
              Re: Dropdown box not triggering the OnChange Event

              Originally posted by G Gabriel View Post
              arrays function more like a table with an index. with array.find(), you should be able to locate the chosen element and with array.clear() alpha goes straight to that element and remove it from the array.

              Of course it's faster, even if we assume that alpha iterates over the array to find that element, it will stop once it finds it and won't have to iterate over the entire list.

              In fact, since you specify the original colors, You know where is that particular element is and you could send alpha straight to that element and avoid the iteration .

              Yes, I know there is one array. You indicated that you want to present the user with a list of colors, when the user chooses one color, and when you move to the second dropdown, you want the original array that have all the colors to show all the colors except the color the user chose so you do not have the same color for the front and the back.

              That "second" array is the "first" one less the chosen color.
              Although this discussion has gotten seriously off track, you make a fine point! I do appreciate your ideas and our discussions. :) I think that main thing we can take from this is that there are many ways of acomplishing the same thing.

              Code:
              FOR j = 1 TO 19 STEP +1
              FOR i = 1 TO 5 STEP +1
                   IF (color[j] = eval(arrayFld+alltrim(str(i))+".value"))
                        color[j] = ""
                        [COLOR=red]exit for[/COLOR]
                   END IF 
              NEXT
              NEXT
              Adding the exit for to my function should speed things up!
              Last edited by Jeff@Listbrokers; 01-19-2007, 03:50 PM.

              Comment


                #22
                Re: Dropdown box not triggering the OnChange Event

                if you wish to keep the same function you have and speed things up, put an escape script for the inner FOR loop once there is a color match so you do not have to check all five fields:

                FOR j = 1 TO 19 STEP +1
                FOR i = 1 TO 5 STEP +1
                IF (color[j] = eval(arrayFld+alltrim(str(i))+".value"))
                color[j] = ""
                go to match:
                END IF
                NEXT
                Match:
                NEXT

                Comment


                  #23
                  Re: Dropdown box not triggering the OnChange Event

                  That's kinda the same as doing the exit for. Just for kicks... I'm trying to get this to work:

                  Code:
                  FOR i = 1 TO 5 STEP +1
                        color.delete(color.find(eval(arrayFld+alltrim(str(i))+".value")),1)
                  NEXT
                  For some reason it's not removing any colors. do you see why? I got it... the eval(arrayFld+alltrim(str(i))+".value") is returning a CR-LF at the end.
                  Last edited by Jeff@Listbrokers; 01-19-2007, 04:32 PM.

                  Comment


                    #24
                    Re: Dropdown box not triggering the OnChange Event

                    This works...
                    Code:
                    FOR i = 1 TO 5 STEP +1
                      field = strip_trailing_char(eval(arrayFld+alltrim(str(i))+".value"),crlf())
                      num = color.find(field)
                      color.delete(num,1)
                     NEXT
                    There are tons of function calls in this. I'm going to do some testing on the two versions to see which one works faster.

                    After all of this.... my original problem is still unsolved....

                    or even more consice:

                    Code:
                    FOR i = 1 TO 5 STEP +1
                    color.delete(color.find(strip_trailing_char(eval(arrayFld+alltrim(str(i))+".value"),crlf())),1)
                    NEXT

                    Comment


                      #25
                      Re: Dropdown box not triggering the OnChange Event

                      Jeff:
                      from what Selwyn says, it worked fine for him. I didn't open your zip file. No point if Selwyn already checked it.

                      Comment


                        #26
                        Re: Dropdown box not triggering the OnChange Event

                        Where did he say that?

                        Comment


                          #27
                          Re: Dropdown box not triggering the OnChange Event

                          Originally posted by Selwyn Rabins View Post
                          I created a test database to duplicate the problem, but in my test database, it works ok. I don't believe that there is a generic bug here.

                          There may be something specific to your database, but since you did not post an example that shows how to duplicate the problem, we can't be sure.

                          Comment


                            #28
                            Re: Dropdown box not triggering the OnChange Event

                            He, didn't actually open my database. He just created a simple form with a couple of fields and a dropdown box and dynamically populated it.

                            Would you mind looking at my program? See if you have the same problem?

                            Comment


                              #29
                              Re: Dropdown box not triggering the OnChange Event

                              After following Gabe's suggestion of using the .find and .delete functions I was able to derive a significant increase in speed from my original function.

                              Speed comparison for the two versions of my function:

                              My original function had a consistent runtime of .063 secs

                              Code:
                              FOR j = 1 TO 19 STEP +1
                                  FOR i = 1 TO 5 STEP +1
                                        IF (color[j] = eval(arrayFld+alltrim(str(i))+".value"))
                                             color[j] = ""
                                        END IF     
                                     NEXT
                                  NEXT
                              The second version had a consistent runtime of .016 secs

                              Code:
                              FOR i = 1 TO 5 STEP +1
                              color.delete(color.find(strip_trailing_char(eval(arrayFld+alltrim(str(i))+".value"),crlf())),1)
                              NEXT
                              Thanks again, Gabe!

                              Comment


                                #30
                                Re: Dropdown box not triggering the OnChange Event

                                Jeff,
                                I am a little confused. Clear one thing up for me please. Do you or do you not want two of the Font color fields to have the same value? It seems that if you are trying to eliminate the color just chosen from the array to populate the next choice list, then the answer I imagine is NO, you want the Font fields to be singular. Correct?

                                I, like Gabriel thought there was and order to the entries and there was an orderly sequence, and the process was to reduce the list so not to have duplicate colors.
                                Mike W
                                __________________________
                                "I rebel in at least small things to express to the world that I have not completely surrendered"

                                Comment

                                Working...
                                X