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

Action Script/XBasic

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

    Action Script/XBasic

    Sorry, I forgot the paragraph tags in the HTML.

    I created a button on a form to terminate an employee. I followed the steps in the Introduction to Action Scripting manual and everything works as it should.
    When I copy the XBasic copy and paste in into an icon on the custom toolbar that will go with the form. the code doesn't work properly! When I click the icon the three-choice dialog box appears. 'Cancel' works, 'No' works partically (the Note dialog box does not appear), and the Status is not changed, which is correct. The 'Yes' button does not work at all! Here is the code for anyone who want to take a hack at it.
    I've gone over it and over it, and I cannot find what is wrong.

    [code]
    'Displays a message box (style:'Yes, No, Cancel Buttons', image: 'Question symbol', id: 'terminate').
    DIM SHARED terminate_result as N
    DIM SHARED terminate_YES_Button as L
    DIM SHARED terminate_NO_Button as L
    DIM SHARED terminate_CANCEL_Button as L
    terminate_YES_Button = .F.
    terminate_NO_Button = .F.
    terminate_CANCEL_Button = .F.

    title_var = "Terminate employee"
    message_text_var = terminate_NO_Button=.t.") THEN
    'Displays a message box (style:'OK Button', image: 'Information symbol', id: 'notterminated').
    DIM SHARED notterminated_result as N
    DIM SHARED notterminated_OK_Button as L
    notterminated_OK_Button = .F.

    title_var = "Note"
    message_text_var = I'm just starting to get into the new Action Scripting, and I would really like to know what I did wrong.

    Thanks


    Dave
    Dave Jampole
    www.customalpha.com

    Women and cats will do whatever they want. The sooner men and dogs realize that, the happier they will be.


    #2
    RE: Action Script/XBasic

    Hi Dave

    Back in the Beta days I wanted to press a button which opened a dialog box with 2 radio buttons for the use to choose New or Old, New would open a blank form. Old would open another dialog box that has 3 criteria boxes so that the user could find the old record by name or number etc. Selwyn the Great helped me with all this. What I learnt was that you had to give consideration to what you dont want to happen first.

    Here is the the script that opens the first New or Old dialog the script_play_local("xdialog1") is the second dialog for the user to enter what is required. I hope this helps you as it did me.

    Keith Hubert
    London.

    NEW_OR_OLD = ui_get_radio("New or Old Record","New","New","Old")

    if new_or_old = "new" then
    p = form.view("header")
    p.New_Record()
    topparent.close()
    else 'user chose 'old'
    'xdialog1 is an action script that prompts for three variables: job_ref, postal_code, and surveyor_name.
    'you can change the title and prompts on the dialog by editing the xdialog1 script.
    dialog:
    script_play_local("xdialog1")
    'varc_result is the name of the variable that is created when the "xdialog1" script plays. it contains "OK" or "cancel"
    'depending on which button the user pressed to close the dialog
    if varc_Result = "Cancel" then
    end
    end if
    if varc_Result = "OK" then
    if (vc_job_ref "" ) .and. (vc_postal_code = "" .and. vc_surveyor_name = "") then
    filter_string = "job_ref = " + quote(vc_job_ref)
    else if (vc_postal_code "" ) .and. (vc_job_ref = "" .and. vc_surveyor_name = "") then
    filter_string = "post_code = " + quote(vc_postal_code)
    else if (vc_surveyor_name "" ) .and. (vc_job_ref = "" .and. vc_postal_code = "") then
    filter_string = quote(vc_Surveyor_Name) + " $ surveyor_name1)"
    else
    ui_msg_box("Error","You must specify just one search value.",UI_STOP_SYMBOL)
    filter_string = ""
    if filter_string = ""
    vc_job_ref = ""
    vc_postal_code = ""
    vc_surveyor_name = ""
    goto dialog
    end if
    end if
    if filter_string "" then
    p = form.ViewQueried("quote",filter_string)
    'topparent.Hide()
    end if
    else
    'user pressed cancel. so do nothing. just end the script.
    end
    end if
    end if
    Regards
    Keith Hubert
    Alpha Guild Member
    London.
    KHDB Management Systems
    Skype = keith.hubert


    For your day-to-day Needs, you Need an Alpha Database!

    Comment


      #3
      RE: Action Script/XBasic

      Just so you can see how greate the dialog box scipt works, and is so simple to create here it is.
      All thanks to Selwyn.

      Keith Hubert
      London.

      'Create an XDialog dialog box to prompt for parameters.
      DIM SHARED vc_job_ref as C
      DIM SHARED vc_postal_code as C
      DIM SHARED vc_surveyor_name as C
      DIM SHARED varC_result as C
      vc_job_ref=""
      vc_surveyor_name=""
      varC_result=""
      heading_string = "Type in details in one box and press OK or Cancel to stop."
      ok_button_label = "&OK"
      cancel_button_label = "&Cancel"
      varC_result = ui_dlg_box("Quote Search",
      {endregion};
      %dlg%)
      Regards
      Keith Hubert
      Alpha Guild Member
      London.
      KHDB Management Systems
      Skype = keith.hubert


      For your day-to-day Needs, you Need an Alpha Database!

      Comment


        #4
        RE: Action Script/XBasic

        Keith,

        Thanks for your input. I'll keep the code and learn from it. Action Scripting looks to be just my thing, if I get a good handle on it.

        Dave
        Dave Jampole
        www.customalpha.com

        Women and cats will do whatever they want. The sooner men and dogs realize that, the happier they will be.

        Comment


          #5
          RE: Action Script/XBasic

          Dave, I'm certainly no authority here but as I recall the "parentform" (and presumably "topparent") doesn't work as expected when the button is on the toolbar because the "focus" is different. If memory serves me correctly, I believe someone said you should substitute "this" instead.

          Comment


            #6
            RE: Action Script/XBasic

            Cal,

            You are correct. If memory serves me, this was in the 4.5 documentation (and earlier). Toolbars "inherit" the forms alias.

            Peter
            Peter
            AlphaBase Solutions, LLC

            [email protected]
            https://www.alphabasesolutions.com


            Comment


              #7
              RE: Action Script/XBasic

              Thanks. I forgot that.

              Dave
              Dave Jampole
              www.customalpha.com

              Women and cats will do whatever they want. The sooner men and dogs realize that, the happier they will be.

              Comment

              Working...
              X