Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!pt.cs.cmu.edu!andrew.cmu.edu!mm3d+ From: mm3d+@andrew.cmu.edu (Matt McNally) Newsgroups: comp.sys.mac.programmer Subject: Re: zones Message-ID: Date: 18 Jan 90 14:57:44 GMT References: Organization: Computing Systems, Carnegie Mellon, Pittsburgh, PA Lines: 40 In-Reply-To: nf0i+@andrew.cmu.edu (Norman William Franke, III) Writes: >I found out how to read the zones from some sample code from Apple, but >how does one determine what zone one is in? I thought it was the first >zone returned, but it just "broke". Does anyone know how to do this? After perusing the DTS sample code, and chapter 8 (Zone Information Protocol) in Inside AppleTalk it seems that the only real differnece between looking for *your* zone and looking for *all* the zones is the constant you pack into the userData field of the ATP Param Block. Below I've included a source fragment that I hope highlights the main differences between requesting all of the 'available' zones, or the current (ie. '*') zone. If you have any questions, or I've gone awry in a major way, feel free to send me EMail. Also, if anyone would like the complete sources let me know and I'll forward them on. ----- kGZNCall = $07000000; {GetMyZone indicator} kGZLCall = $08000000; {GetZoneList indicator} ...set up ATP Param Block... dIndex := 1; If AllZones Then dATPPBptr^.userData := kGZLCall+dIndex {indicate GetZoneInfo request} Else dATPPBptr^.userData := kGZNCall; ...make ATP Request and Extract Zone or Zones from BDS elements... ------------------------------------------------------------------------- Matt M. McNally - 'Macintosh II Initiative' Research Programmer/Dugan Carnegie Mellon, H&SS Dean's Office, Pittsburgh 15213 mm3d@andrew.cmu.edu | Baker Hall 369B, (412) 268-6990 -------------------------------------------------------------------------