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

  1. Newsgroups: comp.sys.mac.programmer
  2. Path: sparky!uunet!munnari.oz.au!uniwa!cujo!ncrpda.curtin.edu.au!rocky.curtin.edu.au!user
  3. From: peter@cujo.curtin.edu.au (Peter N Lewis)
  4. Subject: Re: "GLOBAL System Variables", Help!!!
  5. Message-ID: <peter-260193111702@rocky.curtin.edu.au>
  6. Followup-To: comp.sys.mac.programmer
  7. Lines: 29
  8. Sender: news@ncrpda.curtin.edu.au
  9. Nntp-Posting-Host: ncrpda.curtin.edu.au
  10. Organization: NCRPDA, Curtin University
  11. References: <1993Jan21.200510.7950@fcom.cc.utah.edu> <C1CAAv.9Hu@news.udel.edu>
  12. Date: Tue, 26 Jan 1993 03:17:57 GMT
  13.  
  14. In article <1993Jan21.200510.7950@fcom.cc.utah.edu> Dmitry Boldyrev
  15. <dmitry@chemistry.chem.utah.edu> writes:
  16. >Does anyone know how to write/read Global variables in THINK Pascal ?
  17. >I have an address of CurActivate ($0A64) and size (4).
  18. >Think Reference says that it's a "Global Variable", but
  19. >when I tried to use it in Pascal it says "unknown indef.".
  20. >" MyWindow := CurActivate; "
  21.  
  22. I do it thusly:
  23.  
  24.     const
  25.         ToolScratch = $9CE;
  26.  
  27. var
  28.             ToolScratchP: ^ptr;
  29.  
  30. begin
  31.         ToolScratchP := POINTER(ToolScratch);
  32.  { then use or set ToolScratchP^ }
  33. end;
  34.  
  35. Unfortunately, THINK Pascal doesn't support globals, so this is the only
  36. way of doing it, I think.  I'm not sure if there isn't an interface you
  37. could include that has all the global addresses defined, I just paste them
  38. in with ObiWan :-)
  39.    Peter.
  40.  
  41. _______________________________________________________________________
  42. Peter N Lewis <peter@cujo.curtin.edu.au>             Ph: +61 9 368 2055
  43.