Alpha Video Training
Results 1 to 11 of 11

Thread: Calling and ending forms

  1. #1
    Jeff Klages
    Guest

    Default Calling and ending forms

    Dows the calling script "HAVE" to be the thing that ends the called form?

    For example, I have a form, MAINFORM, with a button, BUTTON1, and its only job is to display a form, FORM1, and it does it with the form.view("FORM1","Dialog") command. Once the script runs it ends.. it did its job.

    Now FORM1 is displayed, as a dialog cuz I like the size better, and on this form is a button, BUTTON1, and part of its job is to close the form with FORM1.close() command.

    Problem seems to be that I end up with duplicate forms open but not displayed and it makes the script do funky things.

    So is this because BUTTON1 on MAINFORM is the originating "caller" and must also be the one to close the form? Or am I doing something else wrong maybe.. probably?

    I love this stuff

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

    Default RE: Calling and ending forms

    Jeff,

    If you're opening forms as dialogs you must master chapter 22 of the Xbasic Reference Manual, plus the Form.view() stuff in Ch. 13. It's my understanding that the dialog style requires the calling script to close out the called dialog form. This is not true for regular forms.

    -- tom cone

  3. #3
    Jeff Klages
    Guest

    Default RE: Calling and ending forms

    yep.. I kinda figured that was the case since it only seems to happen with my dialogs.

    It's forcing me to develop my logic skills now since I have one large script on the originating button that does it all.. works this way tho so I guess its not a bad thing... who knows.. after a while I might even get a clue what I'm doing... ha!

  4. #4
    "Certified" Alphaholic
    Real Name
    William Hanigsberg
    Join Date
    Apr 2000
    Location
    Toronto, ON
    Posts
    4,018

    Default RE: Calling and ending forms

    Jeff,

    You write, "...Now FORM1 is displayed, as a dialog cuz I like the size better...."

    I do not thing the form's mode is in any way dependent on whether it is opened in dialog mode. This is not disparage dialog mode but to point out that a form's size can be managed independent of mode.

    Bill

  5. #5
    Volunteer Moderator
    Real Name
    James A. Talbott, Jr.
    Join Date
    Apr 2000
    Location
    Lexington, KY
    Posts
    1,458

    Default RE: Calling and ending forms

    Maybe I am missing the whole point, but why not just add the following line to the button which calls the form:

    formname.close()

    Wouldn't that resolve the whole problem?

    Regards,

    Jay Talbott

  6. #6
    "Certified" Alphaholic
    Real Name
    Ken Herrold
    Join Date
    May 2000
    Posts
    1,081

    Default RE: Calling and ending forms

    Jeff:

    Like you, I had questions about the 'dialog' method for form prompts. While my methods might be considered laughable by others on the board, the example I have attached works well for me. The opening of a dialog style form was upsetting because it might appear anywhere on the Alpha desktop and I seemingly had no control over that. In a board response to this problem I got a centering snippet of code.

    You can see in the attached sample what I did with that.

    Give comments and suggestions all....

    Ken

  7. #7
    Jeff Klages
    Guest

    Default RE: Calling and ending forms

    Thanks all for your replies....

    I open the form as a dialog because I maximize all my forms.. this way I know exactly how large my form (read window) will always be... I had an issue early in this (my first) database with the small forms opening maximized.. and the dialogs allow me to control both size and placement so to me it just looks better... perhaps I am taking the wrong approach but it works pretty well ... for now.

  8. #8
    Mick Magnuson
    Guest

    Default RE: Calling and ending forms

    Hi Jeff

    There are 2 ways to open a dialog.

    form.view("Form","dialog")
    and
    form.dialog("Form")

    The first will never close no matter what. (if there is a trick, hope someone posts it) It will always be retained in memory. You can check this by looking in the object container.

    By putting a close button on this form, it will close itself and remove itself from memory.

    Hope that helps.

  9. #9
    Mick Magnuson
    Guest

    Default RE: Calling and ending forms

    Sorry, the second example works with a close button.

  10. #10
    Volunteer Moderator Peter.Greulich's Avatar
    Real Name
    Peter Greulich
    Join Date
    Apr 2000
    Location
    Boston, MA
    Posts
    11,644

    Default RE: Calling and ending forms

    The first will never close no matter what. (if there is a trick, hope someone posts it) It will always be retained in memory. You can check this by looking in the object container.


    f=form.view("Form","dialog")
    f.activate()
    f.show()

    f.close()

    The script will pause at the show command. When you close the dialog with the upper right X button or your own close button, the dialog script will continue and execute the f.close(), thus completely closing the form.

  11. #11
    Jeff Klages
    Guest

    Default RE: Calling and ending forms

    James... I was originally "handing off" control of the dialog to the buttons on the dialog... the calling script ended at the point where I called the dialog.. this way I broke my scripting in small pieces and was easy (easier) for me to make progress.... doesnt work well tho as the forms (dialogs) never really close...

    Now I make the calling script handle everything on / with the dialog... makes a longer script but at least the forms (dialogs) actually close now..

Similar Threads

  1. Start date & Week ending date..
    By rae4sp in forum Alpha Five Version 6
    Replies: 2
    Last Post: 09-22-2005, 11:29 AM
  2. Beta Program ending at Firm Support
    By Danny Naccarato in forum Announcements
    Replies: 0
    Last Post: 07-27-2005, 11:46 AM
  3. Beta Program ending at Firm Support
    By Danny Naccarato in forum Web Application Server v6
    Replies: 0
    Last Post: 07-27-2005, 11:45 AM
  4. Calling an Outside Program
    By seidel1 in forum Alpha Five Version 6
    Replies: 4
    Last Post: 11-01-2004, 04:36 PM
  5. Calling another APP
    By Thomas Henkel in forum Alpha Five Version 4
    Replies: 10
    Last Post: 09-13-2000, 09:26 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
  •