Path: utzoo!attcan!uunet!cs.utexas.edu!rice!uw-beaver!Teknowledge.COM!unix!mxmora From: mxmora@unix.SRI.COM (Matt Mora) Newsgroups: comp.sys.mac.programmer Subject: Re: Using a handle to get data: How? Message-ID: <13990@unix.SRI.COM> Date: 9 Jul 90 20:10:55 GMT References: <1990Jul8.171009.1@mel.cipl.uiowa> Reply-To: mxmora@unix.UUCP (Matt Mora) Organization: SRI International, Menlo Park, CA Lines: 39 Keywords:blockmove In article <1990Jul8.171009.1@mel.cipl.uiowa> wolf@mel.cipl.uiowa writes: [stuff deleted] I gathered from your post that you obtained the handle from the resource manager with success. >Basically what I want to know is how to use a handle to get a value of a >certain byte at a specified offset from the handle. > >If someone could enlighten me on this I would be very appreciative. I am will >take responses in pascal (I am using turbo at the time). Try something like this: function GetByteFromHandle (TheHandle: Handle; offset: longint): Byte; var temp: byte; begin BlockMove(ptr(ord(TheHandle^) + offset), @temp, 1); GetByteFromHandle := temp; end; Blockmove is not listed as a trap that might move memory so you can probably get away with not locking down the handle before you call this routine. >Thanks >WOLF@MEL.CIPL.UIOWA.EDU -- ___________________________________________________________ Matthew Mora | my Mac Matt_Mora@sri.com SRI International | my unix mxmora@unix.sri.com ___________________________________________________________