Global Vars question

Discussion in 'Cadence' started by PolyPusher, Jul 22, 2010.

  1. PolyPusher

    PolyPusher Guest

    Hi All,

    I am trying to clean up all my global variables(using Skill Lint).
    In some of my routines I am accessing the form like
    EFSchematicProbeForm->EFSpecTrace->choices. It seems if you do
    this, EFSchematicProbeForm needs to be global. If I put
    EFSchematicProbeForm in the let or prog, then I won't be able
    communitcate with the form.

    Is there an app for that ;)

    Thank you in advance for any help,
    Eric


    procedure(EFSpecTraceList()
    let((EFNetNavSpecFullDone EFNetNavSpecFullListVar)

    foreach(mapc EFNetTwoProbeVar EFSchematicProbeForm->EFProbeBox->value

    foreach(mapc x EFSchematicProbeForm->EFSpecTrace->choices
    x=list(x)
    if(EFNetTwoProbeVar==car(parseString(car(x) "=="))
     
    PolyPusher, Jul 22, 2010
    #1
  2. PolyPusher wrote, on 07/22/10 15:08:
    Hi Eric,

    In general, top level user interface storage variables need to be global
    (strictly speaking this isn't true, the UI is blocking and you display it in the
    same scope that it was created, but it's a good general rule).

    Otherwise if you create them as local, when you try to interact with the form,
    it cannot find the variable in scope - and it needs that to be able to have the
    expression in the CDS.log...

    So, the best thing is to give SKILL Lint a prefix to filter out any "valid"
    global variables.

    Note that you don't need form fields to be global - just forms, menus and dialog
    boxes (etc) - not form fields, menu items.

    Regards,

    Andrew.
     
    Andrew Beckett, Jul 22, 2010
    #2
  3. PolyPusher

    Guest Guest

    Not really. The form *is* global. If you create a local variable of the
    same name, then you are hiding the global variable and that's why you cannot
    then access the form, since the local variable has whatever value you assigned
    to it (or nil if you didn't assign a value).

    You could create a local variable of a different name that you assign the
    global variable to hide it, but the form itself must have a global variable to
    access it.

    -Pete Zakel
    ()

    "LISP is the machine language of higher-level languages."

    -- Alan Kay
     
    Guest, Jul 22, 2010
    #3
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.