[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: LOGO-L> Need help with variables



On Tue, 17 Mar 1998 kathymc@key.net.au wrote:
> teacher.  I am doing an assignment on the basics of logo and am having
> trouble distinguishing between global and local variables.  I know that
> global variables are created with make " and a local variable is within
> one procedure only.  However, I have a problem with understanding why if
> running a procedure such as square :side a global variable is created
> rather than a local.  Does this make any sense to you because I am
Kathy

unless your assignment explicitly asks you to deal with global and local 
variables, don't worry about it too much. It's not something that I'd 
count as 'basic' to Logo.

But the difference works like this:
a global variable exists of itself, with a name and a value which can be 
used at any time by any procedure;
a local variable exists only within a particular procedure, while that 
procedure is running.

It's a feature of the language that best encountered and understood in 
context; i.e. when you're making a program or project needs it.

A reference to guide you with it is Brian Harvey's 'Computer Science Logo 
Style Vols 1-3' MIT Press.

all the best

Jeff Richardson
Monash University
Australia
---------------------------------------------------------------
Please post messages to the Logo forum to logo-l@gsn.org.  Mail
questions about the list administration to logofdn@gsn.org.  To
unsubscribe send    unsubscribe logo-l    to majordomo@gsn.org.



Global SchoolNet Foundation - Linking Kids Around the World!
Copyright GSN - All Rights Reserved - Comments & Questions
Visit GSN's Global Schoolhouse for more exciting learning resources!
Search our Site - Home