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

A Superior Progress Bar Function?

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

    A Superior Progress Bar Function?

    Are you looking for a superior progress bar function suitable for use in your Alpha Five applications?

    'ProgBar2' is a percent-style progress bar function that utilises the Alpha Five WaitDialog class. It has the following features:

    1. displays the percent completed of a task in a standard Windows progress bar dialog box,
    2. you, the programmer, get to chose the two progress measure variables on which the progress bar is based,
    3. optionally includes a 'Cancel' button so your users can cancel the running task (you decide what then to do),
    4. you choose the progress bar refresh rate,
    5. show your own title and narration on the progress bar,
    6. continually updates the progress bar even if the user shifts focus or resizes your application window,
    7. comprehensively tested,
    8. easy to implement in your A5 applications,
    9. full documentation included.

    'ProgBar2' is included here as an A5 Xbasic global script. Just open the code tab on the A5 control panel, select the import option and navigate to its folder, (just download the attached file and un-zip it there first).

    There is a sample Xbasic script included too named 'ProgBar2Example' which shows how to include 'ProgBar2' in your applications.

    The advantage of ProgBar2's use of the WaitDialog class will be readily apparent to anyone who has previously used other methods to try and achieve a professional looking progress bar in their applications.

    ProgBar2 works with Alpha Five version 6 or later.

    [PS: there's one minor annoyance. At the start, ProgBar2 momentarily displays a default progress bar. It's not normally noticeable unless pointed out to anyone. The problem has been reported to the good folk at Alpha Software and an update will be posted as soon as a fix is available. This fault does not impact on ProgBar2's use and performance.]

    #2
    ProgBar2 version 2 posted

    I have updated 'ProgBar2' to version 2. There is now a countdown timer on the progress bar (optional) that shows on the remaining time in hours/minutes/seconds. See the attached jpeg screen shot for an example.

    I have added a 7th optional parameter to the 'ProgBar2' function parameter list - it defaults to on (.T.) but you can omit the timer display by setting this parameter to .F. instead.

    Documentation is included in the 'ProgBar2' Xbasic script attached here in zip format. It is supplied as a global script and you can import it into your A5 applications using the same process as described above.

    'ProgBar2' works with A5 version 7 and above (build 3906-3009 or later recommended). It also works with A5 version 6 but not version 5. With version 6 the message bar title and cancel button features are not enabled, but it appears to work well otherwise.

    Comment


      #3
      Hi Brett, thanks for this function. Can you help me understand how to use it? I would like to use it to show progress in several import and export functions; but it seems that the way this is structured, it should go either before or after the import operations, but that does not make sense. Is there a way that I should structure it to imbed the import/export operations within this progress bar? I've tried it several ways and either the progress bar runs completely (then the import or export functions) or vice versa. Neither makes sense. Thoughts?
      thanks for any help you can provide,
      Brian

      Comment


        #4
        Originally posted by BKelley
        Hi Brett, thanks for this function. Can you help me understand how to use it? I would like to use it to show progress in several import and export functions; but it seems that the way this is structured, it should go either before or after the import operations, but that does not make sense. Is there a way that I should structure it to imbed the import/export operations within this progress bar? I've tried it several ways and either the progress bar runs completely (then the import or export functions) or vice versa. Neither makes sense. Thoughts?
        thanks for any help you can provide,
        Brian
        By using the A5 export and import operations you loose some flexibility to be able to do things yourself, such as the ability to select fields to import/export and display a progress bar. I almost always write my own import and export processes in Xbasic. Then I can get the total number of records I am working with and use this as the measure to display and update the progress bar.

        Comment


          #5
          Another question and answer concerning the use of ProgressBar2 is posted on the A5 forum here.

          Comment


            #6
            Re: A Superior Progress Bar Function?

            I know this is an old thread, but I'm trying to use Progbar2. I am running a query that I know will go thru all records to test. When I run it, The Progbar2 UI box comes up but nothing happens. Instead, the standard progress bar at the bottom left appears and goes thru the records and then disappears when finished along with the Progbar box. Below is the simple code I am using. I must be missing something somewhere but not sure where. Please advise as I would prefer to use Progbar2 over the standard progress bar. Please let me know if I need to post this under A5v11 forum.

            Dim Tbl as P
            Dim nIMax as N
            Dim ni as N

            tbl = table.open("ameregl3")

            query.description = ""
            query.order = ""
            query.filter = "AMEREGL3->BTC >={02/19/2015}"
            query.options = "I"

            ProgBar2("start", "My progress bar", 1000, 100000, "Testing", .T. )

            tbl.query_create()

            ProgBar2("update", "My progress bar", ni, niMax, "Testing", .T. )

            ProgBar2("stop", "My progress bar", 100000, 100000, "Testing", .T. )


            END

            Thanks......
            Scott

            Comment


              #7
              Re: A Superior Progress Bar Function?

              Originally posted by draxx2755 View Post
              I know this is an old thread, but I'm trying to use Progbar2. I am running a query that I know will go thru all records to test. When I run it, The Progbar2 UI box comes up but nothing happens. Instead, the standard progress bar at the bottom left appears and goes thru the records and then disappears when finished along with the Progbar box. Below is the simple code I am using. I must be missing something somewhere but not sure where. Please advise as I would prefer to use Progbar2 over the standard progress bar. Please let me know if I need to post this under A5v11 forum.

              Dim Tbl as P
              Dim nIMax as N
              Dim ni as N

              tbl = table.open("ameregl3")

              query.description = ""
              query.order = ""
              query.filter = "AMEREGL3->BTC >={02/19/2015}"
              query.options = "I"

              ProgBar2("start", "My progress bar", 1000, 100000, "Testing", .T. )

              tbl.query_create()

              ProgBar2("update", "My progress bar", ni, niMax, "Testing", .T. )

              ProgBar2("stop", "My progress bar", 100000, 100000, "Testing", .T. )


              END

              Thanks......
              Scott
              Hi Scott,
              Good question. Unfortunately ProgBar2 will not display anything worthwhile the situation you describe. The reason is that <tble>query_create() is a Alpha5 METHOD that processes all your records internally to Alpha5. ProgBar2 is instead designed for the situation where I have my own Xbasic code processing each record in turn. I can then design my code so that, for example, if the table I am processing contains 100 thousand records I can create a progress bar using ProgBar2 and update the progress bar every 1 thousand records processed. So my XBasic code would look something like this.


              Code:
              Dim nTotalRecords as N = 0
              Dim nRecCount as N = 0
              Dim pInTable as P
              Dim indx as P
              '
              pInTable = table.open("MyTable")
              indx = pInTable.index_primary_get()
              nTotalRecords = indx.records_get()
              pInTable.fetch_first()
              ProgBar2("start", "My progress bar", 1, nTotalRecords, "Testing", .T. )
              while pInTable.fetch_EOF() = .F.
              	nRecCount = nRecCount + 1
              	'
              	' Your 1 record at a time processing code would go here.
              	'
              	if mod(nRecCount, 1000) = 0 then			' Update progress bar every 1000th record only.	
              		ProgBar2("update", "My progress bar", nRecCount, nTotalRecords, "Testing", .T. )
              	end if
              	pInTable.fetch_next()
              wend
              '
              pInTable.close()
              if mod(nRecCount, 1000) <> 0 then
              	ProgBar2("stop", "My progress bar", nRecCount, nTotalRecords, "Testing", .T. ) 
              end
              And I recall from memory that if I issue a ProgBar2 "update" at the end of the file when there are exactly a multiple of 1000 records (the update interval chosen), then the progress bar will close anyway, so closing it via a "stop" will result in an error. My example code avoids this error.

              Hope this helps.

              Comment


                #8
                Re: A Superior Progress Bar Function?

                Thanks for the reply Brett. It definitely helps to clarify things a bit. "Your 1 record at a time processing code would go here." is where I would put the code for looping thru the records then. And obviously, any methods that A5 processes internally would not work with this function, unless coded to do so by looping thru the records as the internal method would. Am I understanding this correctly? Leaving for the day but will check for your reply and will be back Monday or Tuesday. Thanks again for the clarification.
                Scott

                Comment


                  #9
                  Re: A Superior Progress Bar Function?

                  Scott, yes that is correct.

                  Comment

                  Working...
                  X