Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Computer Aided Design - CAD > Cadence > Re: New batch o...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 5 of 5 Topic 3976 of 4210
Post > Topic >>

Re: New batch of skill questions - appreciate your help

by pxhxz@[EMAIL PROTECTED] (Pete nospam Zakel) Apr 28, 2008 at 05:42 PM

In article <1209371450_3825@[EMAIL PROTECTED]
>
stephane.badel@[EMAIL PROTECTED]
 writes:
>> Q1. When I define two procedures as following: procedure( proc1()
>> x=10) and the other is: procedure(proc2() x); if i called the first
>> one (i.e. proc1) it will return the value of the variable x defined
>> there, why when i call proc2 it gives me error that variable x is
>> undefined? Although i am not using either prog or let for making it
>> local? I think i misunderstand the concept! How to let a variable
>> global?

>No... it should really work...

x won't be defined until after you invoke proc1().  Just declaring x
within
a statement in proc1() doesn't define it:

# skill
> procedure( proc1() x=10)
proc1
> procedure(proc2() x)
proc2
> x
*Error* toplevel: undefined variable - x
> proc2()
*Error* eval: unbound variable - x
> proc1()
10
> x
10
> proc2()
10

However, I wouldn't use "x" as a global since it's likely to be clobbered
by other routines.  And you shouldn't begin any globals you create with a
lowercase letter.

-Pete Zakel
 (phz@[EMAIL PROTECTED]
)

"Walking on water and developing software from a specification are easy
 if both are frozen."
					-Edward V. Berard
 




 5 Posts in Topic:
New batch of skill questions - appreciate your help
Reotaro Hashemoto <ahm  2008-04-27 16:04:07 
Re: New batch of skill questions - appreciate your help
Riad KACED <riad.kaced  2008-04-27 17:42:15 
Re: New batch of skill questions - appreciate your help
"S. Badel" <  2008-04-28 10:30:50 
Re: New batch of skill questions - appreciate your help
"S. Badel" <  2008-04-28 16:32:16 
Re: New batch of skill questions - appreciate your help
pxhxz@[EMAIL PROTECTED]   2008-04-28 17:42:06 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sun Sep 7 23:07:48 CDT 2008.