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

Script fires twice

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

    Script fires twice

    I have runtime solution running on a 2003 server with three XP boxes as clients. I have an "on change" event tied to the first field of a data entry form, social security number (SSN). After starting a new record and the SSN is entered an On change event (not ondepart)triggers if a matching SSN is found (in the same table) A dialog box appears asking if they want to still make a new duplicate record or go to the last record (branching action script). If they choose no, I delete the current record and take them to the last matching record where they should be able to edit it. Unfortunately the script fires again. I'm taking them back to the SSN field,yes, but no changes are made. If they choose yes to make a new record, the script duplicates the found record and gives it focus, unfortunately the script again fires.

    My clients have tried taking the database off of the server and placing it on one of the three client boxes and sharing that with the same exact problem. So I feel we could eliminate server issues.


    The sad part is that I am absolutely unable to duplicate this problem on my XP laptop using full version and I can't duplicate it on my 2003 server with an XP desktop using the runtime as the client, although my system is not multiuser. Everything works perfectly as designed. The odd thing is that this has worked properly on their system a few times, 98% of the time it fails, lately 100%.

    My question is, has anyone ever had a script that runs OK on one system and not another? Is there somewhere I should start to look? I have checked the script over and over and sent them new updates without any changes in this odd behavior.

    Thanks in advance
    Bill Belanger

    #2
    RE: Script fires twice

    Bill, try this:
    in autoexec, define a global variable
    busy, logical

    in your script, at the top, put
    if busy
    end
    end if
    busy=.t.
    'your script
    busy=.f.

    some events fire more than once - and that may or may not be the problem
    Cole Custom Programming - Terrell, Texas
    972 524 8714
    [email protected]

    ____________________
    "A young man who is not liberal has no heart, but an old man who is not conservative has no mind." GB Shaw

    Comment


      #3
      RE: Script fires twice

      Thanks for the reply Martin.
      I'm getting an error;

      if busy
      variable "busy" not found

      It's probably a syntax error but I'm new to xbasic
      Here's the whole scrip as adjusted

      'Date Created: 05-Feb-2005 06:10:10 AM
      'Last Updated: 05-Feb-2005 06:10:10 AM
      'Created By : Owner
      'Updated By : Owner

      if busy
      end
      end if
      busy=.t.

      'Get 'Value' property of 'Ssn' in Form 'Application0' .
      DIM GLOBAL vssn AS c
      vssn = topparent:Ssn.value

      'Conditional code follows. Executes only if the condition expression is True.
      IF a5_eval_expression("=exist(Ssn,\"application\",\"Ssn_A\")") THEN
      'Displays a message box (style:'Yes, No Buttons', image: 'Information symbol', id: 'On_file').
      DIM SHARED On_file_result as N
      DIM SHARED On_file_YES_Button as L
      DIM SHARED On_file_NO_Button as L
      On_file_YES_Button = .F.
      On_file_NO_Button = .F.

      title_var = "Social Security Number On File"
      message_text_var = ""%text%
      This social security number is already on file.

      Click Yes to do a re-application

      Click No to go to the last application to edit it.
      %text%
      On_file_result=ui_msg_box(title_var,message_text_var,UI_YES_NO+ UI_FIRST_BUTTON_DEFAULT+ UI_INFORMATION_SYMBOL)
      'Test to see which button on the message box was pressed....
      SELECT
      CASE On_file_result = UI_YES_SELECTED
      On_file_YES_Button= .t.
      script_play_local("Re-App")
      CASE On_file_result = UI_NO_SELECTED
      On_file_NO_Button= .t.
      script_play_local("GoToLastApp")
      END SELECT
      END IF

      busy=.f.



      This comment you made that events fire twice is a little unnerving in that it seems to be system dependent. Should this "busy" script be part of every developer's library? If true, shouldn't this be something Alpha would address?

      Bill Belanger

      Comment


        #4
        RE: Script fires twice

        Bill, had you previously declared busy as a global variable. If you dimmed it in autoexec, you will have to run autoexec for it to exist.

        dim global busy as c

        I know of no reason for the script to not see busy, but if you dim it in your autoexec script (which fires when the app is opened) - but if your are sure it exists, and you still get the error, at the top of your script say:
        dim global busy as L
        if busy=.t.
        end
        end if
        busy=.t.

        and busy=.f. as the last line in the script

        this technique goes back about 5 years, so I don't know if its still relevant - but I would definitely try it!

        Also, what happens when they answer one way or the other - do you take them back to that same field?
        Cole Custom Programming - Terrell, Texas
        972 524 8714
        [email protected]

        ____________________
        "A young man who is not liberal has no heart, but an old man who is not conservative has no mind." GB Shaw

        Comment


          #5
          RE: Script fires twice

          as I think about it, since they've already changed the value, at the top of where your script begins, set focus somewhere else, like
          if busy ...


          button1.activate()
          your script

          busyt=.f.

          sometimes if its still setting there it may cause problems
          Cole Custom Programming - Terrell, Texas
          972 524 8714
          [email protected]

          ____________________
          "A young man who is not liberal has no heart, but an old man who is not conservative has no mind." GB Shaw

          Comment


            #6
            RE: Script fires twice

            I can do that. My real question is why are my clients having so much trouble with a databse that works perfectly for me? Is it possible fields are getting corrupted when I zip them the changes through email?

            Bill Belanger

            Comment

            Working...
            X