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

Button and action scripting

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

  • Button and action scripting

    Hello,

    I am trying to create a button on a form that will sequentially run a set of saved operations. I have very limited Xbasic knowledge and am using the action scripting tool in alpha 5 Version 9.

    All the operations run perfectly when launched through the control panel however when I fuse them into a button the results are not the same.

    The first action of the “button” is to locate events happening on a specific “date.” The user is prompted to enter the date through a calendar drop down button in a date field so there is no chance that the date can be entered incorrectly. (btw This works properly in the form button I am trying to create and the correct records appear in a browser)

    The Second action is to mark all the selected dates. This is another saved operation that is supposed to mark the records that the used prompted for. The action scripting marks all the records in the table

    Third action is to print a report based only on the selected marked records. This report is based on marked records and all the records are included in the report instead of the records selected by the date prompt

    Forth action is to unmark the records… The system unmarks all the records in the table

    There is only one table being access for this report… no sets… This should be a cake walk.

    When I run these steps through the control panel the report is flawless… When I use the button, the action scripting marks all the records in the table and gives me a report of every record which is useless.

    If I choose the “Currently selected records” option in the script gene: Run Saved Operation I get an error message

    Script: TEMPLATE line 22
    Rec_count=a5_get_records_in_query(“mastours”,current_fillter,-1,.f.+”.and.(.
    Variable is of different type

    Any thoughts on how I can combine these functions into on button on a form would be greatly appreciated..

    All my Best

    Hunter
    Last edited by hunter; 10-04-2008, 08:49 PM.

  • #2
    Re: Button and action scripting

    Originally posted by hunter View Post
    Hello,

    I am trying to create a button on a form that will sequentially run a set of saved operations. I have very limited Xbasic knowledge and am using the action scripting tool in alpha 5 Version 9.

    All the operations run perfectly when launched through the control panel however when I fuse them into a button the results are not the same.

    The first action of the “button” is to locate events happening on a specific “date.” The user is prompted to enter the date through a calendar drop down button in a date field so there is no chance that the date can be entered incorrectly. (btw This works properly in the form button I am trying to create and the correct records appear in a browser)

    The Second action is to mark all the selected dates. This is another saved operation that is supposed to mark the records that the used prompted for. The action scripting marks all the records in the table

    Third action is to print a report based only on the selected marked records. This report is based on marked records and all the records are included in the report instead of the records selected by the date prompt

    Forth action is to unmark the records… The system unmarks all the records in the table

    There is only one table being access for this report… no sets… This should be a cake walk.

    When I run these steps through the control panel the report is flawless… When I use the button, the action scripting marks all the records in the table and gives me a report of every record which is useless.

    If I choose the “Currently selected records” option in the script gene: Run Saved Operation I get an error message

    Script: TEMPLATE line 22
    Rec_count=a5_get_records_in_query(“mastours”,current_fillter,-1,.f.+”.and.(.
    Variable is of different type

    Any thoughts on how I can combine these functions into on button on a form would be greatly appreciated..

    All my Best

    Hunter

    Comment


    • #3
      Re: Button and action scripting

      Hi Hunter,

      What you are doing seems to be a long winded way of printing a report filtered on a date. This is very easy to do in a number of ways, the simplest is to have a look at Alphasports, go to the reports menu and choose invoices, you can see that different dates and date ranges can be input with no need for marking/un-marking. To see how this works look at the code on the preview/print button on the Invoicereport menu form. If you struggle with this come back with a zip of your database and I am sure someone will sort it for you.

      Comment


      • #4
        Re: Button and action scripting

        Hunter

        I agree with Lance that it seems you are taking the long way around to print a report.

        In line with that, I have attached a zip file. that has one table (balboa - my testing table), one form and one report.

        There is a button on the report that will prompt you for a date (as the form reads there are only two dates in the table 08/05/08 and 09/20/08. If you enter either one of those dates, a report will be printed. If you enter a date other than those two dates, a message will be given telling you that there are no records that match that date.

        This was all done in action scripting which is the code in the button's onPush event.

        As Lance stated this will produce the same report that you are trying to produce using the varied operations just boiled down to a report with the proper query filter and order.

        Just as a side note, when you combine several operations into one script you could wind up with a timing issue where the first script which is performing a query does not finish before the next portion of the script is excecuted.

        unzip the zip file and look at the action scripting behind the button (onpush event)

        Hope this is what you want to accomplish, if not as Lance has already said, post a sample of you app and let us look at what you have.

        FWIW

        Tom Baker

        Comment


        • #5
          Re: Button and action scripting

          Hunter, Windows multi-tasks disk and printer activity. For your script to run successfully each saved operation must wait for the precedeing operation to finish. However, if your script consists of a series of "run saved operation" actions, Windows multi-tasks them. In other words, later actions are being run before earlier actions are finished. Instead of running the operations one at a time, to completion, Windows does not wait for the first to end before beginning the second, does not wait for the second to end before beginning the third, and so on.

          Others have pointed you towards the conventional solution. You need not use saved operations in the first place. However, in the event you find yourself needing to do it the way you originally wanted, (using saved operations), you can do it in Alpha Five by wrapping each action in a user defined function. This involves a bit of xbasic programming. While you may not be interested in learning about it now, I mention it for others, and in case you might want to tackle it later on.

          -- tom

          Comment


          • #6
            Re: Button and action scripting

            Thanks so much for your help... and for explaining why the system was acting so strangely... I now have a starting point... All my Best Hunter

            Comment

            Working...
            X