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

Ok in Change mode but not Enter

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

  • Ok in Change mode but not Enter

    Hi

    I don't understand why this paticular script works ok in Change mode but not Enter mode.

    f = parentform.this
    if F.restrict_enter=.F. .or. F.restrict_change=.f. then
    dis = "Y"
    else
    dis = "V"
    end if
    f:Cond10.refresh()

    I have set my form to mimic A4 in terms of change and enter i.e. not modeless. A field has this script attached to the ONARRIVE event. It will turn the conditional object on and off base on the two variables in Change mode but not enter mode.

    What am I missing. I know..something obvious, but what else is new.

    Thank you

    Robert

  • #2
    RE: Ok in Change mode but not Enter

    Why not use mode_get() instead of "F.restrict_enter=.F. .or. F.restrict_change=.f."? In enter mode, parentform.mode_get() = ENTER. In change mode, parentform.mode_get() = CHANGE.

    Jerry

    Comment


    • #3
      RE: Ok in Change mode but not Enter

      Hi Jerry

      Either way the script fragment does not execute in Enter mode. The conditional object does not display properly. I don't know if the variable is not being set or whether the refresh is not executing or both. As I said the change mode is ok but enter is not.

      Do change and enter execute scripts differently.

      Robert

      Comment


      • #4
        RE: Ok in Change mode but not Enter

        Robert,

        maybe you have a flaw in the internal logic of the script?

        the 'if' statement will fire in all cases until both restrict_change and restrict_enter are true... that's the only the time the 'else' statement will be run

        what are you expecting?

        what are the antecedent property values for restrict_change and restrict_enter, when the form is opened?

        under what circumstances do these properties get changed?

        Comment


        • #5
          RE: Ok in Change mode but not Enter

          Robert,
          I did a little experimenting and indeed a conditional object does not work correctly in enter mode. I created a very different code using mode_get() and it worked every time for change mode. In enter mode, the variable value changes and is correct, but the conditional does not work. Do you need a conditional object? If you are using it to show information, you can use a text field and change the text displayed.

          if dis = "Y"
          parentform:text1.text = "Change mode"
          elseif dis = "X"
          parentform:text1.text = "Enter mode"
          else
          parentform:text1.text = ""
          end
          parentform:text1.refresh()

          This seems to work reliably. If you are using the conditional to show or hide other fields, you can use the hide() and show() properties to display the fields you want.

          I normally don't use conditionals since earlier experience with them was frustrating. I have made them work based on the value of a field object, but I find other methods more suited to me.

          Jerry

          Comment


          • #6
            RE: Ok in Change mode but not Enter

            Thank you Tom & Jerry...love your cartoons:)

            I use a conditional object because there are three different items to be displayed depending on the variable value. I will have to rethink this.

            At least now know I had it right in terms of coding and its A5 throughing me a curve. Have you noticed that A5 isn't always consistent in handling events under certain conditions. This can be frustrating and time consuming when you think your the problem and its A5.

            Don't get me wrong I thing A5 is a great product.

            Thanks everyone for your responses. I encourage anyone to contribute to this board. You may feel that you are not knowlegable enough and your suggestions obvious...but something you say or suggest could start us thinking in a new direction about our problems.

            Robert

            Comment


            • #7
              RE: Ok in Change mode but not Enter

              Doing the toons was fun, but the residuals aren't much.

              Actually if you only have three fields to hide or show you shouldn't have any problems. You can even overlay the fields and have some default to hidden on startup. (Makes form design interesting) I have a form with many more fields to hide and show that has a script on the OnFetch event. This has lead to "Maximum Stack Depth" errors when fetching quickly. A workaround was found by myself and others and listed in the readme documentation for the 4.03 update.

              Good luck on the redesign. One of the neat things about Alpha is that there are frequently a number of different ways to get the same result. But like any program, it isn't perfect. At least with the help of this forum, a solution can usually be found.

              Jerry

              Comment


              • #8
                RE: Ok in Change mode but not Enter

                Thanks Jerry

                Robert

                Comment


                • #9
                  RE: Ok in Change mode but not Enter

                  Robert, I've had similar problems and when all else fails I do the following... If the variables are changing correctly, which they appear to be according to Jerry's post of 05-18-2001 08:20. The problem may be that the refresh just isn't working! Maybe it's a memory problem (it doesn't really matter)?

                  To fix this, you might try placing an invisible button on the conditional object (you may have to enlarge the conditional or make a very small button. Place the refresh code in the invisible button; in place of the refresh code at the end of the original script. Place a buttonX.push()where "X" refers to the invisible button object. Work-arounds-are-us.

                  Comment


                  • #10
                    RE: Ok in Change mode but not Enter

                    The next to last sentence of my last post may be a little unclear, what I meant to suggest was that you need to place the buttonX.push() code at the end of the original script in place of the original refresh code. Also, you might try a less object specific refresh, if speed isn't a problem. I hope this helps.

                    Comment


                    • #11
                      RE: Ok in Change mode but not Enter

                      Tom,
                      Unfortunately, in my test I tried a refresh() and that didn't work. Personally, I just don't care for the way conditionals work. But your test idea is one I use frequently. If I am unsure about how an event or code is working, I will put it on a temporary button. Then I can push it manually or with the push() command and see what is happening. I also use trace.writeln() frequently in scripts to sent information to the trace windows. I have found some interesting surprises about how expressions are evaluating or which event fires first.

                      Jerry

                      Comment


                      • #12
                        RE: Ok in Change mode but not Enter

                        Hi Tom

                        I need the event to fire when it enters a field.

                        The conditional object diplays a list of different HOTKEYS available to the user depending on the mode they are in and the active field.

                        Thanks for the tip though. It could be handy.

                        Robert

                        Comment

                        Working...
                        X