home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.mac.programmer
- Path: sparky!uunet!gatech!paladin.american.edu!howland.reston.ans.net!usc!cs.utexas.edu!bcm!aio!mark@cheers.jsc.nasa.gov
- From: mark@cheers.jsc.nasa.gov (Mark Manning)
- Subject: A Difference of Pointers
- Message-ID: <1993Jan5.005151.4558@aio.jsc.nasa.gov>
- Sender: news@aio.jsc.nasa.gov (USENET News System)
- Organization: NASA
- Date: Tue, 5 Jan 1993 00:51:51 GMT
- Lines: 44
-
- Hello everyone!
-
- Thanks ahead of time for everyone who has helped me in the past! :)
-
- And now for the present we have....
-
-
- I am using MPW Pascal. In my travels of programming the Mac, I
- have repeatedly come up against the need to convert one type of
- handle to another. What I'd like to ask (in this area) is:
-
- Why does
-
- NewHandle := @OldHandle;
-
- work some of the time and
-
- NewHandle := Pointer( ord( OldHandle ) );
-
- work at other times?
-
- I would have thought that only one or the other would always work,
- but this doesn't seem to be the way MPW works. For example, in a
- dialog manager set of routines I did the following:
-
- SetPort( theDialog );
- GetDItem (theDialog, theItem, theType, theHandle, theRect);
- theControl := @theHandle;
- theValue := GetCtlValue( theControl );
-
- while in another procedure I had to do the following to get the
- same information out of the dialog:
-
- SetPort( theDialog );
- GetDItem (theDialog, theItem, theType, theHandle, theRect);
- theControl := Pointer( ord(theHandle) );
- theValue := GetCtlValue( theControl );
-
- So I'm stumped. I don't know why one works one time and the other
- works the other time. I just use them that way. But if someone could
- explain this to me I'd appreciate it. :)
-
- Thanks again! :)
-
-