Alpha Video Training
Results 1 to 2 of 2

Thread: Dialog "Cancel" Button does not stop scr

  1. #1
    Member
    Real Name
    Hoyt Stepp
    Join Date
    Dec 2003
    Location
    Juneau, Alaska
    Posts
    12

    Default Dialog "Cancel" Button does not stop scr

    I have the following dialog box that I am using to branch between two tables and forms. Everything works fine except when the cancel button is selected the scripts still run and the designated form still opens. I have tried adding:
    varC_Result = "CANCEL"
    END
    END IF

    but still does not work, can anyone help?
    Hoyt.


    'Create an XDialog dialog box to prompt for parameters.
    'In order to evaluate expressions using the eval() function, in the context of
    'the current form, the "form_name" variable is defined.
    DIM form_name as C
    if is_object(topparent.this) then
    form_name = topparent.name()+".this"
    else
    form_name = ""
    end if
    DIM GLOBAL vcTest as C
    DIM GLOBAL varC_result as C
    heading_string = "All sections are"
    footer_string = "Click GO to enter the selected section"
    ok_button_label = "&GO"
    cancel_button_label = "&Cancel"
    DELETE expression_result
    expression_result = eval("\"ARSON\"",form_name)
    vcTest = convert_type(expression_result,"C")
    varC_result = ui_dlg_box("TITLE 11 SECTIONS",""%dlg%
    {region}
    {text=30,1:heading_string}
    {endregion};
    {region}
    {region}listed alphabetically:{endregion}|
    {region}(vcTest:ARSON);
    (vcTest:ASSAULT);
    (vcTest:BURGLARY);
    (vcTest:CONDITIONS OF RELEASE);
    (vcTest:COMPUTERS);
    (vcTest:CUSTODIAL INTERFERENCE);
    (vcTest:DISORDERLY CONDUCT);
    (vcTest:DV ORDER);
    (vcTest:ESCAPE);
    (vcTest:FALSE REPORTS);
    (vcTest:FORGERY);
    (vcTest:HARASSMENT);
    (vcTest:HINDERING PROSECUTION);
    (vcTest:INCEST);
    (vcTest:INDECENT EXPOSURE);
    (vcTest:KIDNAPPING);
    (vcTest:MICS);
    (vcTest:MIW);
    (vcTest:MINORS);
    (vcTest:MISCHIEF);
    (vcTest:TRESPASS);{endregion};
    ;
    {endregion};
    {region}
    {text=30,2:footer_string}
    {endregion};
    {line=1,0};
    {region}
    "*15=ok_button_label!OK" "15=cancel_button_label!CANCEL"
    {endregion};
    %dlg%)

  2. #2
    "Certified" Alphaholic
    Real Name
    Tom Cone Jr
    Join Date
    Apr 2000
    Location
    Florida
    Posts
    23,311

    Default RE: Dialog

    The script you posted does not seem complete. You should post a working "model" of the database so that we can see the entire script functioning in context.

    There's a difference between the concept of closing the dialog and ending the script. These are not synonymous. In most xdialog dialogs the cancel button simply closes the dialog while leaving "Cancel" in the variable a_dlg_button. Subsequent portions of the script can then examine that variable and branch accordingly.

    -- t

Similar Threads

  1. Can a button cancel the "on exit" event?
    By hpjrt in forum Alpha Five Version 5
    Replies: 2
    Last Post: 11-03-2003, 04:26 AM
  2. Msg Box "OK, Cancel" a script - Solution
    By John Gamble in forum Alpha Five Version 5
    Replies: 0
    Last Post: 09-02-2002, 12:03 PM
  3. How to "exit" the record on a cancel?...
    By Jeff Klages in forum Alpha Five Version 4
    Replies: 8
    Last Post: 04-02-2002, 06:27 AM
  4. Stop the "Printing box"
    By Terry Morgan in forum Alpha Five Version 4
    Replies: 5
    Last Post: 11-12-2001, 08:35 AM
  5. "CLOSE" button on dialog
    By Bill Warner in forum Alpha Five Version 4
    Replies: 4
    Last Post: 09-29-2000, 05:12 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
  •