Alpha Video Training
Results 1 to 4 of 4

Thread: Progress Report

  1. #1
    "Certified" Alphaholic
    Real Name
    Richard Coleman
    Join Date
    Oct 2000
    Location
    Franklin, TN
    Posts
    1,206

    Default Progress Report

    This is primarily for J. Brightbill and Tom Cone....

    'Date Created: 05-Apr-2004 06:22:20 PM
    'Last Updated: 01-Aug-2004 12:20:07 AM
    'Created By : Jerry Brightbill
    'Updated By : Dick Coleman
    'Create an XDialog dialog box to prompt for parameters.

    DIM v_itemname as C
    DIM v_category as C
    DIM v_media as C
    DIM v_bookname as C
    DIM v_booknumber as C
    DIM v_pagenumber as N
    DIM v_disknumber as N
    dim v_type as C
    DIM v_location as C
    dim v_value as N
    dim v_createdate as D

    DIM varC_result as C

    heading_string = "Enter Item Information"
    ok_button_label = "&Save"
    cancel_button_label = "&Cancel"

    '----------------- Error message Code -----------------
    DIM v_msg as C

    error_ok_button_label = "&OK"

    error_dlg_code = ""%dlg%
    {region}
    {font=arial,10,b}
    {image=$sys_warning}{sp} |{text=30,3:v_msg};
    {endregion};
    {line=1,0};
    {region}
    {justify=center}{font=arial,9}"*15=error_ok_button_label!OK"
    {endregion};
    %dlg%
    '------------------------------------------------------

    dlg_code = ""%dlg%
    {on_key=enter}
    {on_key=esc}
    {can_exit=CANCEL}
    {position=remember="Enter Item"}
    {background=Blue White}
    {xmargin=2,2}
    {frame=1,1}
    {region}
    {font=arial,10,b}
    {sp=38}{text=60,1.5:heading_string};
    {endregion};
    {font=arial,9}
    {frame=1,1 Use the TAB key or your MOUSE to move between fields. DO NOT use Enter or Esc! }
    {region}
    {region_xmargin=1}
    Item Name:|[60.80v_itemname] ;;
    Value:|[9.80v_value];;
    Category:|[30.80v_category];;
    Location:|[25.80v_location];;
    Media Type:|[25.80v_media];;
    Item Type:|[15.80v_type];;
    Media Name:|[60.80v_bookname];;
    Media Number:|[6.80v_booknumber];;
    Page Number:|[3.80v_pagenumber];;
    Disk Number:|[2.80v_disknumber];;
    {endregion};;;;;
    {region}
    {justify=center}
    {frame=1,1 Use MOUSE to select buttons }
    {region_xmargin=0}
    "15=ok_button_label!OK" "15=cancel_button_label!CANCEL";;
    {endregion};;;
    %dlg%

    dlg_event = ""%code%
    tbl = table.open("b_items")

    if recno("b_items")"15
    ui_msg_box("Demo Overload","You have exceeded the limits of this demo application. No additional items can be accepted!!",ui_ok)
    tbl.close()
    end
    end if

    select
    case a_dlg_button = "enter" .OR. a_dlg_button = "esc"
    if (.not. ("OK"$ui_dlg_ctl_current("Enter Item") .or. "Cancel"$ui_dlg_ctl_current("Enter Item")))
    a_dlg_button = ""
    end if

    case a_dlg_button = "OK"
    select
    case v_itemname = ""
    v_msg = "The Item Name is a required field"
    ui_beep(UI_EXCLAMATION_BEEP)
    ui_dlg_box("Error",error_dlg_code)
    a_dlg_button = ""
    ui_dlg_ctl_goto("Enter Item","[60.80v_itemname]")
    end
    case v_category = ""
    v_msg = "The Category is a required field"
    ui_beep(UI_EXCLAMATION_BEEP)
    ui_dlg_box("Error",error_dlg_code)
    a_dlg_button = ""
    ui_dlg_ctl_goto("Enter Item","[30.80v_category]")
    end
    case v_media = ""
    v_msg = "The Media Name is a required field"
    ui_beep(UI_EXCLAMATION_BEEP)
    ui_dlg_box("Error",error_dlg_code)
    a_dlg_button = ""
    ui_dlg_ctl_goto("Enter Item","[25.80v_media]")
    end
    case v_location = ""
    v_msg = "The Location is a required field"
    ui_beep(UI_EXCLAMATION_BEEP)
    ui_dlg_box("Error",error_dlg_code)
    a_dlg_button = ""
    ui_dlg_ctl_goto("Enter Item","[25.80v_location]")
    end
    end select

    tbl.enter_begin()
    tbl.Create_date=date()
    tbl.Modify_date=date()
    tbl.Modify_time=time("0h0m")
    tbl.Item_name=v_itemname
    tbl.Item_category=v_category
    tbl.Item_value=v_value
    tbl.Item_media=v_media
    tbl.Item_type=v_type
    tbl.Item_location=v_location
    tbl.Book_name=v_bookname
    tbl.Book_number=v_booknumber
    tbl.Page_number=v_pagenumber
    tbl.Disk_number=v_disknumber
    tbl.enter_end()
    tbl.close()
    case a_dlg_button = "CANCEL"
    if alltrim(v_itemname - v_category - v_media - v_type - v_location - v_bookname - v_booknumber) "" ""
    chk = ui_msg_box("Cancel","Do you want to cancel entry? ",UI_QUESTION_SYMBOL+UI_YES_NO)
    if chk "" UI_YES_SELECTED
    a_dlg_button = ""
    else
    if is_open("b_items")
    tbl.close()
    end if
    end if
    end if
    end select
    %code%

    varC_result = ui_dlg_box("Enter Item",dlg_code,dlg_event)

    Do I pass????????

    D

  2. #2
    Former Alpha Employee JerryBrightbill's Avatar
    Real Name
    Jerry Brightbill
    Join Date
    Apr 2000
    Posts
    5,171

    Default RE: Progress Report

    Gee, that looks familiar. I am glad you could adapt it for your needs. The only change I would make is to move the "demo check" to the code under the ok event. Then the table won't be opened and closed for every change, but only when they try to commit a record. You could run that check before the xdialog even opens and just set a logical variable. Then replace the table code with a check for the value of the variable.

    Jerry

  3. #3
    "Certified" Alphaholic
    Real Name
    Richard Coleman
    Join Date
    Oct 2000
    Location
    Franklin, TN
    Posts
    1,206

    Default RE: Progress Report

    I like the idea of a check on the way 'in'...
    There's more on that page than you can see....
    the things I have learned just trying to understand all the 'procedures' that you outlined in the presentation... and all the 'cross-referencing' that had to be done to make other scripts work...
    I really thank you for the 'insight'
    D

  4. #4
    "Certified" Alphaholic
    Real Name
    Richard Coleman
    Join Date
    Oct 2000
    Location
    Franklin, TN
    Posts
    1,206

    Default RE: Progress Report

    I am really going to look into checking for 'recno()' on the way in to the item input...
    The reason I put it where it is, was because it fires at the end of the first field input, which just cuts down on the 'inputter' typing b4 they get the error msg...
    D

Similar Threads

  1. Here is a friendly Progress Bar for you to use
    By Mike Thomson in forum Alpha Five Version 6
    Replies: 9
    Last Post: 09-08-2015, 08:41 AM
  2. Progress Bar
    By Mike Thomson in forum Code Archive
    Replies: 0
    Last Post: 08-26-2005, 02:51 PM
  3. {progress}
    By Bill Parker in forum Alpha Five Version 5
    Replies: 3
    Last Post: 08-30-2004, 05:16 AM
  4. Progress Bar
    By alexmuir in forum Alpha Five Version 5
    Replies: 3
    Last Post: 02-06-2004, 04:46 AM
  5. Progress bar
    By brett s in forum Alpha Five Version 5
    Replies: 2
    Last Post: 10-04-2002, 03:43 PM

Bookmarks

Posting Permissions

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