home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.mac.programmer
- Path: sparky!uunet!haven.umd.edu!darwin.sura.net!news.udel.edu!bach.udel.edu!lecates
- From: lecates@bach.udel.edu (Roy LeCates)
- Subject: Re: "GLOBAL System Variables", Help!!!
- Message-ID: <C1CAAv.9Hu@news.udel.edu>
- Sender: usenet@news.udel.edu
- Nntp-Posting-Host: bach.udel.edu
- Organization: University of Delaware
- References: <1993Jan21.200510.7950@fcom.cc.utah.edu>
- Date: Sun, 24 Jan 1993 03:42:30 GMT
- Lines: 23
-
- In article <1993Jan21.200510.7950@fcom.cc.utah.edu> Dmitry Boldyrev <dmitry@chemistry.chem.utah.edu> writes:
- >Does anyone know how to write/read Global variables in THINK Pascal ?
- >I have an address of CurActivate ($0A64) and size (4).
- >Think Reference says that it's a "Global Variable", but
- >when I tried to use it in Pascal it says "unknown indef.".
- >" MyWindow := CurActivate; "
-
- You might be able to "trick" the program into looking at $0A64.
- Create a variable as a POINTER to a WindowPtr. Then set it
- to 0x00000A64 and dereference it whenever you need to read it.
- I'm not sure about Pascal, but the C equivalent would be like this:
- ...
- const WindowPtr *myptr = 0x00000A64;
- WindowPtr MyWindow;
- MyWindow = *myptr;
- ...
- You could make the 'const' line a global variable, so it's accessable
- everywhere. Enjoy!
- --
- ------------------------------------------------------------------
- Roy M. LeCates EE Undergraduate lecates@bach.udel.edu
- University of Delaware Electrical Engineering and Computer Science
- ------------------------------------------------------------------
-