Get a Jumpstart with our Sample Apps
Results 1 to 8 of 8

Thread: is the Function 'close_if_exists()' still exist

  1. #1
    Member
    Real Name
    Dave Mac Callum
    Join Date
    Jan 2006
    Location
    Johannesburg. South Africa
    Posts
    380

    Default is the Function 'close_if_exists()' still exist

    Hi There,

    When trying to run Function 'close_if_exists()' 'Function is not recognized' is displayed.

    Has this been deleted from available Functions ?

    Looking forward
    Dave Mac

    It's not so much what you don't know that gets you into trouble, but what you know for sure, that just ain't so. - Mark Twain.

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

    Default Re: is the Function 'close_if_exists()' still exist

    I believe that was a udf defined in AlphaSports. You can of course copy it from there and save it in your database.

    Or, as Selwyn answered a similar question.

    dim window_to_close as c
    window_to_close = "customers"
    dim tempObj as p
    tempObj = obj(window_to_close)
    if is_object(tempObj) then
    tempObj.close()
    end if
    Last edited by Stan Mathews; 09-09-2016 at 09:20 AM.
    There can be only one.

  3. #3
    Member
    Real Name
    Dave Mac Callum
    Join Date
    Jan 2006
    Location
    Johannesburg. South Africa
    Posts
    380

    Default Re: is the Function 'close_if_exists()' still exist

    Quote Originally Posted by Stan Mathews View Post
    I believe that was a udf defined in AlphaSports. You can of course copy it from there and save it in your database.

    Or, as Selwyn answered a similar question.

    dim window_to_close as c
    window_to_close = "customers"
    dim tempObj as p
    tempObj = obj(window_to_close)
    if is_object(tempObj) then
    tempObj.close()
    end if

    Hi Stan,

    Thanks for your response. I'll dig it out and give it a try.

    (the above from Selwyn, seems to suggest that the code actually closes the "customers'.

    I actuallw want to check that "Customers" is closed. Are we on the same page ?)

    have a good one
    Dave Mac

    It's not so much what you don't know that gets you into trouble, but what you know for sure, that just ain't so. - Mark Twain.

  4. #4
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    24,698

    Default Re: is the Function 'close_if_exists()' still exist

    In the sample posted

    is_object(tempObj)

    returns true if customers is open, false if it isn't.
    There can be only one.

  5. #5
    Member
    Real Name
    Dave Mac Callum
    Join Date
    Jan 2006
    Location
    Johannesburg. South Africa
    Posts
    380

    Default Re: is the Function 'close_if_exists()' still exist

    Quote Originally Posted by Stan Mathews View Post
    In the sample posted

    is_object(tempObj)

    returns true if customers is open, false if it isn't.

    Hi Stan,

    Thanks for your input. I have a real problem which I am not sure
    whether sensing Form closing, is going to help. Just casting around.
    Maybe you can spot where I need to fix.

    I have attached a few Screen dumps


    19 Sep 2016

    Problem with closing Form and reopening a different Form.

    Sequence as follows

    'Debt_Xact_Crn_m' Form.jpeg

    'Debt_Xact_Crn_m' Form Editor.jpeg

    'Debt_Xact_Xxx_m' Action Closing Form.jpeg

    'Debt_Xact_Xxx_m' Action 'Opening Next_Acc_m' Form.jpeg

    'Next_Debt_CrNote_Acc_m' display correctly.jpeg

    'Next_Debt_CrNote_Acc_m' display before closing 'Debt_Xact_Crn_m' - hang.JPG

    My problems starts with 'Debt_Xact_Crn_m' Form.jpeg on pushing btn_Commit_Transaction (F9).

    Refer 'Debt_Xact_Xxx_m' Action Closing Form.jpeg I have this Action closing the Form.
    This XBasic Action has been Converted to XBasic to allow different Forms to be closed
    dependent upon data retrieved from Table 'Params_tnm'. Refer 'Params_tnm,jpeg.JPG'

    Some processing is then done Conditions dependent.

    Refer 'Debt_Xact_Xxx_m' Action 'Opening Next_Acc_m' Form.jpeg'
    This Action has been converted to XBasic to allow different Forms to be opened.

    Now logic seems to give up and luck takes over !
    If we are lucky then 'Next_Debt_CrNote_Acc_m' display correctly.jpeg' displays (95% of cases)

    If however, we are unlucky then
    'Next_Debt_CrNote_Acc_m' display before closing 'Debt_Xact_Crn_m'.JPG' display (5% of cases)
    In this case the Title? Bar display that it is displaying 'Next_Debt_CrNote_Acc_m'
    with its Find by Key box correctly prompting, while the 'Debt_Xact_Crn_m' Form.jpeg has not obeyed the
    Close Form Action ? Only intermittently !

    I have tried many and varied differently stratergies to shake this one, to no avail.

    I am hoping that you cas spot the problem area with your extensive exposure to Alpha5.

    if not I can try and sqeeze my App down to the required size to send you my coding.
    However, this is a real mission, which I am hoping we can circumvent.

    PS. I see I can only add 5 attachments.
    Will seend the other 3 seperately
    Dave Mac

    It's not so much what you don't know that gets you into trouble, but what you know for sure, that just ain't so. - Mark Twain.

  6. #6
    Member
    Real Name
    Dave Mac Callum
    Join Date
    Jan 2006
    Location
    Johannesburg. South Africa
    Posts
    380

    Default Re: is the Function 'close_if_exists()' still exist

    Hi Stan,

    Here are the other Attachments
    Dave Mac

    It's not so much what you don't know that gets you into trouble, but what you know for sure, that just ain't so. - Mark Twain.

  7. #7
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    24,698

    Default Re: is the Function 'close_if_exists()' still exist

    I would think it a timing issue. The easiest way to avoid such is

    codeTxt = <<%code%
    form.open()'appropriate command here to open next form
    %code%
    'command here to close the current form
    parentform.close() '??
    on_xbasic_idle(codeTxt,"R")
    There can be only one.

  8. #8
    Member
    Real Name
    Dave Mac Callum
    Join Date
    Jan 2006
    Location
    Johannesburg. South Africa
    Posts
    380

    Default Re: is the Function 'close_if_exists()' still exist

    Quote Originally Posted by Stan Mathews View Post
    I would think it a timing issue. The easiest way to avoid such is

    codeTxt = <<%code%
    form.open()'appropriate command here to open next form
    %code%
    'command here to close the current form
    parentform.close() '??
    on_xbasic_idle(codeTxt,"R")
    Thanks for the input Stan.

    I'll let you know if my luck changes
    Dave Mac

    It's not so much what you don't know that gets you into trouble, but what you know for sure, that just ain't so. - Mark Twain.

Similar Threads

  1. Does Security Function a5w_GetGroupsDialog() Exist?
    By iRadiate in forum Application Server Version 11 - Web/Browser Applications
    Replies: 2
    Last Post: 01-19-2012, 12:18 PM
  2. CLOSE_IF_EXISTS() error?
    By brett s in forum Alpha Five Version 7
    Replies: 12
    Last Post: 12-11-2006, 02:44 AM
  3. Close_if_exists() and the docs
    By whanigsberg in forum Alpha Five Version 7
    Replies: 1
    Last Post: 10-10-2006, 02:31 PM
  4. CLOSE_IF_EXISTS() Function
    By Tom Mills in forum Alpha Five Version 5
    Replies: 3
    Last Post: 10-11-2002, 01:18 PM
  5. FUNCTION File.Exists() does not exist
    By Jesse Sanders in forum Alpha Five Version 4
    Replies: 5
    Last Post: 06-27-2001, 08:17 AM

Posting Permissions

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