Close Procedure

Discussion in 'Cadence' started by ecnedad, Sep 9, 2009.

  1. ecnedad

    ecnedad Guest

    Good day!

    I have a procedure that I want to perform upon the closing of a
    Schematic Window.

    I have found the command hiRegCloseProc(winId 'myFunction) but it does
    not work.

    I hope anyone could help me with this problem.

    Thank you and God bless!
     
    ecnedad, Sep 9, 2009
    #1
  2. ecnedad

    I-F AB Guest

    Hi,

    Could you please elaborate your usage of this command.
    I suspect you're code may not be reading the desired window ID.

    Best regards,
    I-FAB
     
    I-F AB, Sep 10, 2009
    #2
  3. ecnedad

    ecnedad Guest

    I'm using the following command:

    procedure( myFunction(win)
    let( (cv x lstShapes)
    cv = win~>cellView
    lstShapes= setof(x cv~>shapes x~>layerName == "text")
    println(list("lstShapes" lstShapes))
    );let
    );procedure
    hiRegCloseProc(getCurrentWindow() 'myFunction)

    Is this correct?
     
    ecnedad, Sep 10, 2009
    #3
  4. ecnedad

    Guest Guest

    The Skill window close proc is called after any internal close procs, so the
    cellView may no longer be available from the window at that point.

    -Pete Zakel
    ()

    Q: How many surrealists does it take to change a light bulb?
    A: Two. One to hold the girrafe and the other to fill the bathtub with
    brightly colored machine tools.
     
    Guest, Sep 10, 2009
    #4
  5. ecnedad

    I-F AB Guest

    Hi,
    While trying to understand the mechanics of this function, I tried:

    procedure( myFunction(win)
    println( "This line should be printed!" )
    ) ;proc myFunction

    Sure I got the line in the CIW, but wasn't a "t" also to have been
    returned?
    Also, using "printf" instead of "println" gave me nothing - not even
    the test message.

    Am I missing something here?

    Regards,
    I-FAB
     
    I-F AB, Sep 11, 2009
    #5
  6. ecnedad

    ecnedad Guest

    Thank you for the ideas and information.

    What I really want to do is the following:

    1. I will write note shape circle on the schematic.
    2. Then when the Schematic Window is to be closed, I should do the
    following before the closing:
    a. Delete all the circle shapes with the layerName "text".
    b. Then save the changes (deletion) so the Prompt "If the user
    wants to save the changes" will not show.

    Since Mr. Pete Zakel told that the window close proc is called after
    any internal close procs, it could not be possible that my 'myFunction
    will work.

    Now, I want to know if it possible to bypass or disable the prompt
    asking the user if he/she wants to save the changes?

    I hope anyone could help me with this problem.

    Thank you and God bless! (^_^)
     
    ecnedad, Sep 11, 2009
    #6
  7. I-F AB wrote, on 09/11/09 00:54:
    You won't see the return value, because the function was not triggered by a
    direct user interaction (e.g. typing in the function call, a bindkey or a menu).
    So it's not supposed to show the return value.

    As for printf, was it just because you had no "\n" at the end?

    Regards,

    Andrew.
     
    Andrew Beckett, Sep 14, 2009
    #7
  8. ecnedad wrote, on 09/11/09 02:07:
    There are a couple of possibilities in IC5141.

    dbRegPostSaveTrigger - is called after save. You could potentially do the
    modification and do a save again (making sure you don't end up in an infinitely
    recursive loop).
    schRegPostCheckTrigger - is called after the "check" (but prior to save in a
    check-and-save).

    In IC613 you have better choices:

    dbRegSaveTrigger - this is a pre-save trigger, so you can intercept prior to a save.
    schRegPreCheckTrigger - this happens before the "check" operation in a
    check-and-save.

    Regards,

    Andrew.
     
    Andrew Beckett, Sep 14, 2009
    #8
  9. ecnedad

    I-F AB Guest

    Hi,
    Why is it that the 'printf' requires a "\n" at the end to be
    displayed?
    I seem to uncover more questions than help solve one!
    Regards,
    I-FAB
     
    I-F AB, Sep 15, 2009
    #9
  10. I-F AB wrote, on 09/15/09 04:25:
    Lines normally don't get printed until a carriage return is included - this is
    to allow you to partially print a line in pieces:

    printf("hello ")
    printf("world ")
    printf("\n")

    In fact if you use:

    procedure( myFunction(win)
    printf( "This line should be printed!" )
    ) ;proc myFunction

    And then:

    hiRegCloseProc(hiGetCurrentWindow() 'myFunction)

    then close the window, and then type:

    printf("\n")

    in the CIW, the message then appears. println() includes a carriage return
    automatically (that's what the "ln" standards for - printing, with a newLiNe).

    Regards,

    Andrew.
     
    Andrew Beckett, Sep 15, 2009
    #10
  11. ecnedad

    Guest Guest

    println() automatically appends a newline.

    printf() does not.

    The output buffer is flushed when a newline is encountered.

    -Pete Zakel
    ()

    De java (day zha va') n. The feeling, as you put sugar in your coffee,
    that you've already put sugar in your coffee.
     
    Guest, Sep 15, 2009
    #11
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.