Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!hc!lanl!opus!ksitze From: ksitze@nmsu.edu (Kevin Sitze) Newsgroups: comp.sys.mac.programmer Subject: Re: Declaring "thePort" Message-ID: Date: 10 May 89 14:56:44 GMT References: <1069@mailrus.cc.umich.edu> Sender: news@nmsu.edu Organization: NMSU Computer Science Lines: 34 In article >What are the consequences of declaring a local variable within >a function called "thePort" and setting it explicitly with >GetPort(thePort). I find the following code in some examples >in LSC TransSkel (release 2.0) > >DoWClose () >{ >GrafPtr thePort; >MenuHandle m; >Integer i, mItems; >Str255 iTitle, wTitle; > > GetPort (&thePort); /* grafport of window to be closed */ > >Seems kind of strange to me.... Nothing wrong with it at all. Brushup on your scoping rules and look at the program again... -Kelesi -- ------------------------------------+------------------------------- From the Macintosh of: Kevin Sitze | Disclamer: Who the heck needs | a disclamer? After all, Dan EMail: ksitze%NMSU.edu | Quayle doesn't. SMail: 601 S. Melendres +------------------------------- Las Cruces, NM 88005 | "We have the answers, the ------------------------------------+ trouble lies in finding the "The difference between intelligence| questions..." and stupidity is that intelligence | "The information is there, has a limit." - anonymous | finding it is another story." The dolt confuses you -- more -- | - Any consultant ------------------------------------+-------------------------------