home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / sys / mac / programm / 22049 < prev    next >
Encoding:
Text File  |  1993-01-24  |  1.5 KB  |  36 lines

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