Results 1 to 17 of 17

Thread: Statusbar

  1. #1
    "Certified" Alphaholic
    Real Name
    Ed Barley
    Join Date
    Mar 2002
    Location
    Southern California
    Posts
    1,052

    Default Statusbar

    Hello,

    Can statusbar.robot(), or statusbar.percent()
    be used with the following script?

    a_tbl = table.open( "s:\a5data\sort sheets\import data\data.dbf" , FILE_RW_EXCLUSIVE )
    a_tbl.zap( .T. )
    a_tbl.close()
    Import.Run_silent("DATA IMPORT FILE@s:\a5data\sort sheets\sort sheets")
    Update.Run_silent("Split Bill of Lading@s:\a5data\sort sheets\import data\data.dbf")
    Post.Run_silent("Post Page No@s:\a5data\sort sheets\main table.dbf")


    I have tried a few times, but with no success??

    Thanks Ed Barley

  2. #2
    "Certified" Alphaholic
    Real Name
    Ed Barley
    Join Date
    Mar 2002
    Location
    Southern California
    Posts
    1,052

    Default RE: Statusbar

    This is what I should have posted:



    DIM ax_choice as C
    DIM ax_response as N
    DIM ax_dialog as P


    ON ERROR GOTO ax_error_trap
    DIM ax_error_trap_desc as C
    DIM ax_error_trap_offset as C
    DIM ax_error_trap_msg as C
    DIM ax_error_trap_response as N

    statusbar.robot()

    'AX~Action Command~1~
    'AX~PX9~.T.~
    'AX~PX10~~
    'AX~PX56~0~
    'AX~PX55~0~
    ax_error_trap_desc = "Action Script"
    ax_error_trap_offset = "0"
    'AX~Action Command~4~
    'AX~PX4~sys_shell("c:\FMrename.bat",2)\AN\AK~
    'AX~PX56~0~
    'AX~PX55~~
    ax_error_trap_desc = "Inline Xbasic"
    ax_error_trap_offset = "1"
    sys_shell("c:\rename.bat",2)

    'AX~Action Command~4~
    'AX~PX4~sleep(5)\AN\AKscript_play("Import&Post Page No")\AN\AK~
    'AX~PX56~0~
    'AX~PX55~~
    ax_error_trap_desc = "Inline Xbasic"
    ax_error_trap_offset = "2"
    sleep(5)
    script_play("Import&Post Page No")


    END
    ax_error_trap:
    ax_error_trap_msg = "Trapped error in action command: [" + ax_error_trap_offset + "] " + chr(13) + chr(13) + "Command: " + ax_error_trap_desc + chr(13) + "Error: " + error_text_get()
    ax_error_trap_response = ui_msg_box("Action Program Error", ax_error_trap_msg, 2)
    IF ax_error_trap_response = 4 THEN ''Retry
    RESUME 0
    ELSEIF ax_error_trap_response = 5 THEN ''Ignore
    RESUME NEXT
    ELSE ''Abort
    END
    END IF
    ''****
    ''**** End
    statusbar.clear()

  3. #3
    "Certified" Alphaholic
    Real Name
    Cal Locklin
    Join Date
    Mar 2000
    Location
    S.E. Michigan
    Posts
    5,703

    Default RE: Statusbar

    Well, yes and no.

    You could put either command after every line in the first script to give some indication of where the script is but there is no way to get the statusbar commands to tell you what is happening within the Import, Update, or Post operations. (At least there isn't any that I know of but with everything Selwyn keeps showing us I had to throw this in as a disclaimer.)

  4. #4
    "Certified" Alphaholic
    Real Name
    Ed Barley
    Join Date
    Mar 2002
    Location
    Southern California
    Posts
    1,052

    Default RE: Statusbar

    Thanks for your responce Cal,

    The whole process, can take maybe 1 minute sometimes, and makes the user a little uneasy because they cannot see what is happening. Is there someway, that a pop up message could be put on the screen, when the whole script is over?

    Thanks Ed

  5. #5
    Alpha Software Employee Selwyn Rabins's Avatar
    Real Name
    Selwyn Rabins
    Join Date
    Mar 2000
    Location
    Boston, MA
    Posts
    5,082

    Default RE: Statusbar








    New Page 1




    I am not exactly sure what you want to do. Each of the operations that you
    perform should currently be updating the status bar with progress information
    for the individual operation.
    However, if you want to put up status information of your own that shows the
    progress of the whole script, then you can't do that because your text on the
    status line will get overwritten by the messages that A5 writes to the status
    line.
    There are a number of approaches that you could take to solve this problem.
    I put up a message some time ago showing how to create a custom status bar.
    Another approach is to use a modeless Xdialog box as a "status dialog". Here
    is an example:

    'Define the modeless
    Xdialog status bar...................................
    dim status_string as c
    status_string = ""
    dim flag_close as l
    flag_close = .f.
    ui_modeless_dlg_box("Status",""%dlg%
    {font=arial,10}
    {text=60,2:status_string} {condition=flag_close} "Close!close" {condition=.t.}
    {font=}
    ;
    %dlg%,""%code%
    if a_dlg_button = "close" then
    ui_modeless_dlg_close("status")
    end if
    %code%)



    status_string = "Step 1 of 3. Running Import Operation. Please wait...."
    ui_modeless_dlg_refresh("status")
    Import.Run_silent("DATA IMPORT FILE@s:\a5data\sort sheets\sort sheets")


    status_string = "Step 2 of 3. Running Update Operation. Please wait...."
    ui_modeless_dlg_refresh("status")
    Update.Run_silent("Split Bill of Lading@s:\a5data\sort sheets\import data\data.dbf")



    status_string = "Step 3 of 3. Running Post Operation. Please wait...."
    ui_modeless_dlg_refresh("status")
    Post.Run_silent("Post Page No@s:\a5data\sort sheets\main table.dbf")


    'when you set flag_close to .t. the "close" button on the status dialog becomes
    visible.
    status_string = "Done"
    flag_close = .t.
    ui_modeless_dlg_refresh("status")


    'If you want to
    automatically close the status dialog then include this command here

    ui_modeless_dlg_close("status")






  6. #6
    "Certified" Alphaholic
    Real Name
    Ed Barley
    Join Date
    Mar 2002
    Location
    Southern California
    Posts
    1,052

    Default RE: Statusbar

    Hello Selwyn,

    There are 7 people using computers in the office where I work. Within these 7 people, some are patient, some are mouse clickers, and others hit the keys, if they don't think things are happening. It is amazing. Even after you tell them to watch the lower left corner of their screen, they still get impatient.

    Just wanted to go that one extra step and keep them from doing the above. I had it in my mind to do something like your splash screen, when A5 opens up, that is pretty visible.

    I looked at your Xbasic Reference Manual examples, in regards to the Statusbar,and was not sure what to do from there?? I need to learn Xbasic.

    I will give this a whirl right now.

    Again thanks for your help.

    Have a nice weekend.

    Ed

  7. #7
    "Certified" Alphaholic
    Real Name
    Ed Barley
    Join Date
    Mar 2002
    Location
    Southern California
    Posts
    1,052

    Default RE: Statusbar

    Perfect, couldn't have asked for more.

    Ed

  8. #8
    Member
    Real Name
    Denis Ahmet
    Join Date
    Jul 2005
    Location
    United Kingdom
    Posts
    967

    Default Re: Statusbar

    I need to use Selwyns code, but not sure what i put where. Do i put the whole code in a standard.a5w page. Are there any variables i need to know about?

    500 Internal Server Error
    "Script Error
    Error:line:7 Expected value"

    Can anyone help?

    Thanks,

    Denis

  9. #9
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    21,237

    Default Re: Statusbar

    UI_MODELESS_DLG_BOX() is desktop only. I believe all functions in the ui series are.

  10. #10
    "Certified" Alphaholic Tom Henkel's Avatar
    Real Name
    Tom Henkel
    Join Date
    May 2002
    Location
    New Jersey, USA
    Posts
    1,523

    Default Re: Statusbar

    Ed,
    Years ago I asked the same thing, and I got some code from Jerry Brightbill. It is also in the Code Archive. The following function, "Pleasewait" displays a modeless dialog across the screen, see attached.

    I set it up to display my message before I execute involved routines, or jump to sub applications, then when done, I just shut it off.

    Call:
    Code:
    pleasewait(.T.,"YOUR MESSAGE HERE")
    Close:
    Code:
    pleasewait(.F.)

    Code:
    'Date Created: 07-Apr-2003 01:05:10 PM
    'Last Updated: 27-Sep-2005 02:59:29 PM
    'Created By  : Jerry Brightbill
    'Updated By  : Tom Henkel
    FUNCTION PleaseWait AS C (Show = .F.,what = "" )
    'DESCRIPTION: This function displays a 'Please Wait' dialog for use while processing.	
    'What is an optional parameter that will be displayed along with the words "Please Wait"
    PleaseWait = ""
    
    if show = .F.
    	if ui_modeless_dlg_exist("Processing")
    		ui_modeless_dlg_close("Processing")
    	end if 
    	exit function
    end if
    
    text1 = what+" Please Wait"
    if what = ""
    	len = len(text1)*2.5
      else
      	len = len(text1)*2
    end if
    textbox="{text="+alltrim(str(len))+"text1}"
    
    box_code = <<%dlg%
    	{background=Pale Yellow}
    	{font=arial,12,bi}
    	{include=textbox}     
    %dlg%
    
    box_event = <<%code%
    1=1
    %code%
    
    ui_modeless_dlg_box("Processing",box_code,box_event)
    ui_dlg_move("Processing", 2, 2.5)
    
    ui_modeless_dlg_setfocus("Processing")
    ui_modeless_dlg_refresh("Processing")
    
    END FUNCTION
    Thanks again, Jerry...

    Hope this helps.

    Tom
    Attached Images Attached Images

  11. #11
    Member
    Real Name
    Denis Ahmet
    Join Date
    Jul 2005
    Location
    United Kingdom
    Posts
    967

    Default Re: Statusbar

    Thanks for the response guys.

  12. #12
    Member
    Real Name
    Jon
    Join Date
    Jan 2009
    Posts
    321

    Default Re: Statusbar

    Any chance of adding or replacing the "Please Wait" with a "Wait Dialog" with a progress bar. I have created a script that sends a table without confirmation and the table is quite large and takes 20-30 seconds to send. The function that Tom has shown does display a "Please Wait" but I'm looking to put in a dialog box with a "repeating" or "bouncing" progress indicator that will display when user send table and closes when table has been sent. Similar to what Tom's "Please Wait" does just with a progress indicator. Thank you in advance for your help...

  13. #13
    Member
    Real Name
    Andrew Schone
    Join Date
    Dec 2005
    Location
    Kansas
    Posts
    841

    Default Re: Statusbar

    WaitDialog

    <WaitDiaglog>.create()
    Code:
    Syntax
    
    <WAITDIALOG>.CREATE( Message_Rows as N, Style as C )
    
    Argument
    	
    
    Description
    
    Message_Rows
    	
    
    The number of lines to allow below the progress bar for text messages.
    
    Style
    	
    
        "Percent" - a standard progress bar display that shows the degree of completion
    
        "Repeating" = the progress bar builds from the left, disappears, and then builds again
    
        "Bounce" = the progress bar shuttles left to right, then right to left, and repeats continuously
    Andrew

  14. #14
    Member
    Real Name
    Jon
    Join Date
    Jan 2009
    Posts
    321

    Default Re: Statusbar

    Thanks Andrew, I tried this solution. The problem I was having is that the dialog would appear, then disappear while table was being sent. The only solution that has worked for me was Tom's "please wait" function. I was just looking for an "alternate" dialog and was hoping to be able to have an dialog showing indication of progress while the table was being sent, then closing when complete. Any chance of you helping me modify Tom's function to work with a progress bar. Thanks again for the quick response....

  15. #15
    Member
    Real Name
    Andrew Schone
    Join Date
    Dec 2005
    Location
    Kansas
    Posts
    841

    Default Re: Statusbar

    Sorry, I do not know if that is possible. Maybe someone else can chime in if they know how to do it.
    Andrew

  16. #16
    Member
    Real Name
    Jon
    Join Date
    Jan 2009
    Posts
    321

    Default Re: Statusbar

    Thanks Andrew...

  17. #17
    "Certified" Alphaholic Tom Henkel's Avatar
    Real Name
    Tom Henkel
    Join Date
    May 2002
    Location
    New Jersey, USA
    Posts
    1,523

    Default Re: Statusbar

    I think the big problem here is that the dialog box really has no knowledge of what is going on underneath. I couldn't venture a guess as to how to have the underlying process "tell" the dialog where it is.

    Tom

    From what I see, the {waitdialog} is for ver 6 and above.

Similar Threads

  1. StatusBar Question
    By Tom Patten in forum Alpha Five Version 4
    Replies: 3
    Last Post: 06-17-2002, 10:48 AM
  2. Statusbar for bubble help
    By Nicholas Lawson in forum Alpha Five Version 4
    Replies: 2
    Last Post: 12-01-2001, 02:28 AM
  3. statusbar
    By William Perry in forum Alpha Five Version 4
    Replies: 2
    Last Post: 04-24-2001, 09:52 AM
  4. statusbar.percent()
    By Jeff Moses in forum Alpha Five Version 4
    Replies: 7
    Last Post: 04-04-2001, 09:23 AM
  5. Statusbar won't clear.
    By CALocklin in forum Alpha Five Version 4
    Replies: 1
    Last Post: 01-05-2001, 11:45 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

The Reviews Are In...

It just is revolutionary and reminds me of VB and how it changed the world.
quote Robert Scoble, Scobleizer

...Version 10 is a turning point on how developers will be writing applications for the web
quote Alan Ashendorf, Lets Talk Computers

Alpha Five version 10... this version is really a break-through for web developers.
quote The Wall Street Journal, Digital Network

Our Professional Services Division

Training and Mentoring - Alpha Software's Professional Services division is here to help. We offer mentoring and training services, for those who need guidance or advice building their own applications.

Development Services - Need someone to build your application? We'll get the job done right. We have an in-house team of Alpha Five developers and a network of carefully selected artists, designers and IT professionals ready to handle projects of any size. Read more .

submit a project request

Alpha Five Awards & Press
awards
Products Store Support Services About Cart Site Map Resources Home
© Copyright 2000-2011 Alpha Software, Inc. 70 Blanchard Road Burlington, MA 01803 781.229.4500
more