• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Custom IC SKILL
  3. How to access/get symbol Name of a form when using gensym...

Stats

  • Locked Locked
  • Replies 4
  • Subscribers 143
  • Views 1999
  • Members are here 0
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to access/get symbol Name of a form when using gensym()

SnSkill
SnSkill over 3 years ago

I created the form as 

FileCheckFileForm = hiCreateAppForm(
    ?name gensym()
    ?formTitle "checkfile"
    ?fields list( aFileCheckField)
    ?unmapAfterCB t
)

How to get the form symbol of such form? Using 'FileCheckFileForm doesn't work while using putprop() function.

How to get what symbol is generated by gensym() for the form so as to be used in putprop( "formSymbol") argument?

If I create form as 

FileCheckFileForm = hiCreateAppForm(
    ?name 'FileCheckFileForm
    ?formTitle "checkfile"
    ?fields list( aFileCheckField)
    ?unmapAfterCB t
)

Then using 'FileCheckFileForm as the form symbol works everywhere it is used. 

  • Cancel
Parents
  • SnSkill
    SnSkill over 3 years ago

    I checked and found hiFormSym attribute of the form works. But if there's any other way, please share. 

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 3 years ago in reply to SnSkill

    That's probably the simplest. You could of course use:

    formSymbol=gensym('MyFormPrefix)

    and then:

    ?name formSymbol

    when creating the form, and then store the form symbol as a user property on the form but that's a bit pointless when hiFormSym is there already...

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • SnSkill
    SnSkill over 3 years ago in reply to Andrew Beckett

    Hey Andrew, Thanks! 

    I saw your reply today, and really grateful for the help.

    Meanwhile, I also have a doubt that when a form is created using gensym(), like take my above example; so why even putting a tick(') mark at the beginning of the name don't work? Shouldn't it give the form symbol only ('FileCheckFileForm)? Why there is need to use hiFormSym attribute?

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 3 years ago in reply to SnSkill
    SnSkill said:
    Meanwhile, I also have a doubt that when a form is created using gensym(), like take my above example; so why even putting a tick(') mark at the beginning of the name don't work? Shouldn't it give the form symbol only ('FileCheckFileForm)? Why there is need to use hiFormSym attribute?

    I'm not entirely sure I understand what your doubt is here, but maybe that's because you've misunderstood the difference between the ?name argument and the return value of the function?

    The ?name argument to hiCreateAppForm will create a global variable with that name and use this to store the form data structure. Any interaction with the form will also use that name to generate a SKILL expression to go into the CDS.log for replay purposes - and the name that is used for that is stored in the hiFormSym slot of the form data structure. Note that global variables are created for top-level user interface objects, such as forms and pulldown menus, but not for member items like form fields and menu items (the name is still important  in those cases).

    Some parts of the UI infrastructure also will retrieve other information from properties on the same symbol used to create the form (for example for the help button - see my recent response  RE: How to edit/modify Help button in GUI using Skill ).

    The function also returns the form data structure created, and that can be passed to another function, stored in a variable (which can be a local variable). However, hiCreateAppForm has no way of knowing the variable name (that was used to store the return value, if any), because the assignment happens after the function has returned. Therefore if anything within the UI infrastructure needs to look stuff up for the form, it will do so using the name that was given with ?name, not the variable you happened to store the return value in. You can of course use:

    form=hiCreateAppForm(
      ?name 'MyGlobalFormName
       ...
    )

    and then do form->fieldName->value="blah" - because form is just a pointer to the data structure.

    Does that help?

    Regards,

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • Andrew Beckett
    Andrew Beckett over 3 years ago in reply to SnSkill
    SnSkill said:
    Meanwhile, I also have a doubt that when a form is created using gensym(), like take my above example; so why even putting a tick(') mark at the beginning of the name don't work? Shouldn't it give the form symbol only ('FileCheckFileForm)? Why there is need to use hiFormSym attribute?

    I'm not entirely sure I understand what your doubt is here, but maybe that's because you've misunderstood the difference between the ?name argument and the return value of the function?

    The ?name argument to hiCreateAppForm will create a global variable with that name and use this to store the form data structure. Any interaction with the form will also use that name to generate a SKILL expression to go into the CDS.log for replay purposes - and the name that is used for that is stored in the hiFormSym slot of the form data structure. Note that global variables are created for top-level user interface objects, such as forms and pulldown menus, but not for member items like form fields and menu items (the name is still important  in those cases).

    Some parts of the UI infrastructure also will retrieve other information from properties on the same symbol used to create the form (for example for the help button - see my recent response  RE: How to edit/modify Help button in GUI using Skill ).

    The function also returns the form data structure created, and that can be passed to another function, stored in a variable (which can be a local variable). However, hiCreateAppForm has no way of knowing the variable name (that was used to store the return value, if any), because the assignment happens after the function has returned. Therefore if anything within the UI infrastructure needs to look stuff up for the form, it will do so using the name that was given with ?name, not the variable you happened to store the return value in. You can of course use:

    form=hiCreateAppForm(
      ?name 'MyGlobalFormName
       ...
    )

    and then do form->fieldName->value="blah" - because form is just a pointer to the data structure.

    Does that help?

    Regards,

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Children
No Data

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information