Alpha Video Training
Results 1 to 2 of 2

Thread: What do I have wrong in my dialog box script?

  1. #1
    Member
    Real Name
    JoAnn Ristau
    Join Date
    Jul 2001
    Location
    Texas
    Posts
    188

    Default What do I have wrong in my dialog box script?

    I have a menu form in our helpdesk application that I want to display a message stating the last time the application checked for messages.

    There is a table called getmsgtime that has 1 record with two fields, last_update_date and last_update_time. This record gets updated by another script that runs when messages are checked. That part works fine.

    I created a script named show_something, and added a button on the menu form to call this script. The script works fine every time if you just run it from the code page, but when I run it from the button on the menu, I get an error message that it can't find the table. I've tried all sorts of things but can't get it to work from the menu button. Thanks for looking at this!!


    Here's the script code:


    tbl = table.open("getmsgtime")
    query.filter = ""
    query.order = ""

    DIM form_name as C
    if is_object(topparent.this) then
    form_name = topparent.name()+".this"
    else
    form_name = ""
    end if
    DIM vTestDialog as C
    DIM SHARED varC_result as C

    'tbl = table.open("getmsgtime")
    'query.filter = ""
    'query.order = ""

    DELETE expression_result
    expression_result = eval("\"DATE \"+tbl.last_update_date+\" TIME \"+tbl.last_update_time"" ",form_name)


    vText1 = " MESSAGE CHECK"
    vText2 = "Incoming Messages Last Checked : "
    vText3 = expression_result

    dlg_code = <<%dlg%
    {can_exit=close}
    {background=Black}

    {'%O={F=Arial,10,B}{C=Pale Blue}{I:'$sys_information'} Text1%};
    {line=0}

    {'%O={F=Arial,10,B}{C=Light Green} Text2% };
    {'%O={F=Arial,10,B}{C=Light Green} Text3% };

    %dlg%

    dlg_event = <<%Code%
    if a_dlg_button = "close"
    ui_modeless_dlg_close("Notice")
    end if
    %code%

    dlg_code = stritran(dlg_code,"Text1",vText1)
    dlg_code = stritran(dlg_code,"Text2",vText2)
    dlg_code = stritran(dlg_code,"Text3",vText3)
    ui_modeless_dlg_box("Notice",dlg_code,dlg_event)
    Land of the Free, Because of the Brave
    Support our US Military

  2. #2
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    25,119

    Default Re: What do I have wrong in my dialog box script?

    Not sure what your menu button is but for a menu on a toolbar

    topparent.this

    is probably different from a button on a form.
    There can be only one.

Similar Threads

  1. Wrong icon in dialog (modal) form
    By Bonbon in forum Alpha Five Version 9 - Desktop Applications
    Replies: 0
    Last Post: 07-28-2008, 12:10 PM
  2. What's wrong with this script?
    By H Kromberg in forum Alpha Five Version 6
    Replies: 10
    Last Post: 04-09-2006, 11:29 AM
  3. What is wrong with this script?
    By David Farr in forum Alpha Five Version 5
    Replies: 5
    Last Post: 09-19-2003, 04:58 AM
  4. Calling script from Dialog box
    By magdin in forum Alpha Five Version 5
    Replies: 2
    Last Post: 01-10-2003, 01:17 PM
  5. Print dialog box interrupts multi-print script
    By Matthew Wilson in forum Alpha Five Version 4
    Replies: 0
    Last Post: 04-26-2002, 07:37 AM

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
  •