The Daily Static
  The Daily Static
UF Archives
Register
UF Membership
Ad Free Site
Postcards
Community

Geekfinder
UFie Gear
Advertise on UF

Forum Rules
& FAQ


Username

Password


Create a New Account

 
 

Back to UserFriendly Strip Comments Index

OTcl question (Attn: OTCl or ns2 users) by oot 2010-04-25 05:03:14
Code sample 1:
Class TestClass

TestClass aTestClass
TestClass bTestClass
aTestClass set foo 5

Code sample 2:
Class TestClass

Testclass instproc dostuff {} {
$self instvar foo
set foo 5
set bar 7 }

TestClass aTestClass
TestClass bTestClass
aTestClass dostuff

Is there any difference in the nature of the variable "foo" between code samples 1 and 2? (Scope or something maybe?)

...also, just to double-check that I'm understanding the basics, are both of the following correct?
- In both code examples, bTestClass does NOT contain a variable called foo
- In the second code example, the variable bar is not a member of the class, it is a local variable with no existence outside of the function/procedure in which it is set
[ Reply ]
  And another question by oot2010-04-25 05:15:06

 

[Todays Cartoon Discussion] [News Index]

Come get yer ARS (Account Registration System) Source Code here!
All images, characters, content and text are copyrighted and trademarks of J.D. Frazer except where other ownership applies. Don't do bad things, we have lawyers.
UserFriendly.Org and its operators are not liable for comments or content posted by its visitors, and will cheerfully assist the lawful authorities in hunting down script-kiddies, spammers and other net scum. And if you're really bad, we'll call your mom. (We're not kidding, we've done it before.)