• 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 variables of one procedure function to other...

Stats

  • Locked Locked
  • Replies 4
  • Subscribers 143
  • Views 8376
  • 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 variables of one procedure function to other procedure function

Sathvik44
Sathvik44 over 2 years ago

Hello,

I have been trying to access the y and z variables from the pointDone to getPoints and am stuck.

How can I access the y and z variables from point done to getpoints?

procedure(pointDone( w done pts )
if( done then
l=pts
x=car(l)
y=car(x)+0.0
z=car(cdr(x))+0.0
printf("Point entered was %L.\n" pts)
else
println("Point entry aborted.")
)
list(y z)
)

enterPoint( ?prompts
list( "Enter a point.")
?doneProc "pointDone"
)

procedure(getPoints()
printf("%f" ?)
)

  • Cancel
Parents
  • AurelBuche
    AurelBuche over 2 years ago

    Hi Sathvik,

    This cannot be done in classic SKILL but is achievable in SKILL++

    Below is an example of what your code could look like

    Cheers

    Aurélien

    inScheme(

    ;; Let defining shared variable amongst contained procedures
    let( (x y z)

    globalProc(pointDone( w done pts )
    if( done then
    l=pts
    x=car(l)
    y=car(x)+0.0
    z=car(cdr(x))+0.0
    printf("Point entered was %L.\n" pts)
    else
    println("Point entry aborted.")
    )
    list(y z)
    )

    enterPoint( ?prompts
    list( "Enter a point.")
    ?doneProc "pointDone"
    )

    globalProc(getPoints()

    ;; Here x, y and z variables are the same as `pointDone' ones
    printf("%f" ?)
    )

    ));inScheme
    • Cancel
    • Vote Up +1 Vote Down
    • Cancel
Reply
  • AurelBuche
    AurelBuche over 2 years ago

    Hi Sathvik,

    This cannot be done in classic SKILL but is achievable in SKILL++

    Below is an example of what your code could look like

    Cheers

    Aurélien

    inScheme(

    ;; Let defining shared variable amongst contained procedures
    let( (x y z)

    globalProc(pointDone( w done pts )
    if( done then
    l=pts
    x=car(l)
    y=car(x)+0.0
    z=car(cdr(x))+0.0
    printf("Point entered was %L.\n" pts)
    else
    println("Point entry aborted.")
    )
    list(y z)
    )

    enterPoint( ?prompts
    list( "Enter a point.")
    ?doneProc "pointDone"
    )

    globalProc(getPoints()

    ;; Here x, y and z variables are the same as `pointDone' ones
    printf("%f" ?)
    )

    ));inScheme
    • Cancel
    • Vote Up +1 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