• 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. hiCreateAppForm() callback to print field value

Stats

  • Locked Locked
  • Replies 3
  • Subscribers 143
  • Views 15384
  • 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

hiCreateAppForm() callback to print field value

ajayghoshmv
ajayghoshmv over 5 years ago

Hi

I created a Form with stringFileds and corresponding ButtonFields.

I need The stringField value to be printed to a file when corresponding ButtonField is clicked.

stringF1   ButtonF1

stringF2   ButtonF2

stringF3   ButtonF3

...

...

stringFN   ButtonFN

I get below error. Could you please  help with solution or suggest alternate method ?

*Error* funcall: argument #1 should be a function object or name (type template = "ug") - nil

If my understanding is correct, the error is because I am trying to assign filed handle to a variable [ d1 here in my code].

 

excerpt from my code;

hiCreateButton(
?name 'ButtonFN
?buttonText "Submit"
?callback 'Sclose
)

procedure(Sclose(field form "og")

n2=atoi(car(parseString(artMakeString(field) "ButtonF")))   

d1=concat("stringF" artMakeString(n2))

toFile=outfile("report.txt")

fprintf(toFile "%s\n" form->d1->value)

close(toFile)

);procedure

Thanks

Ajay

  • Cancel
Parents
  • Andrew Beckett
    Andrew Beckett over 5 years ago

    Hi Ajay,

    Which IC subversion are you using? (i.e. what does getVersion(t) return)? For me this worked, although the Sclose function didn't fully work mainly because form->d1->value won't work as d1 needs to be evaluated, but I changed it as follows:

    hiCreateAppForm(
      ?name 'forumForm
      ?fields list(
        hiCreateStringField(
          ?name 'stringF1
          ?value "testing"
        )
        hiCreateButton(
          ?name 'ButtonF1
          ?buttonText "Submit"
          ?callback 'Sclose
        )
    )
    )
    
    procedure(Sclose(field form "og")
      let((n2 d1 toFile)
        ; use symbolToString rather than an ADE-specific function
        n2=atoi(car(parseString(symbolToString(field->hiFieldSym) "ButtonF")))   
        d1=concat("stringF" n2)
        toFile=outfile("report.txt")
        ; can't use form->d1->value because you need d1 to be evaluated
        fprintf(toFile "%s\n" get(form d1)->value)
        close(toFile)
      )
    );procedure
    
    hiDisplayForm(forumForm)

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • Andrew Beckett
    Andrew Beckett over 5 years ago

    Hi Ajay,

    Which IC subversion are you using? (i.e. what does getVersion(t) return)? For me this worked, although the Sclose function didn't fully work mainly because form->d1->value won't work as d1 needs to be evaluated, but I changed it as follows:

    hiCreateAppForm(
      ?name 'forumForm
      ?fields list(
        hiCreateStringField(
          ?name 'stringF1
          ?value "testing"
        )
        hiCreateButton(
          ?name 'ButtonF1
          ?buttonText "Submit"
          ?callback 'Sclose
        )
    )
    )
    
    procedure(Sclose(field form "og")
      let((n2 d1 toFile)
        ; use symbolToString rather than an ADE-specific function
        n2=atoi(car(parseString(symbolToString(field->hiFieldSym) "ButtonF")))   
        d1=concat("stringF" n2)
        toFile=outfile("report.txt")
        ; can't use form->d1->value because you need d1 to be evaluated
        fprintf(toFile "%s\n" get(form d1)->value)
        close(toFile)
      )
    );procedure
    
    hiDisplayForm(forumForm)

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Children
  • ajayghoshmv
    ajayghoshmv over 5 years ago in reply to Andrew Beckett

    Hi Andrew,

    Thank you for the quick reply.

    I am using  "sub-version  ICADV12.3-64b.500.22 ".

    As suggested replaced "form->d1->value " with get(form d1)->value. This worked perfectly fine for me. Thanks again.

    Regards,

    Ajay

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 5 years ago in reply to ajayghoshmv

    Hi Ajay,

    Not sure why it would have been failing with the funcall error earlier because using form->d1->value wouldn't have caused that (it gave a different error), but glad it's resolved now!

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel

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