Path: utzoo!censor!geac!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!asuvax!stjhmc!p12.f56.n114.z1.fidonet.org!Chris.Gehlker From: Chris.Gehlker@p12.f56.n114.z1.fidonet.org (Chris Gehlker) Newsgroups: comp.sys.mac.programmer Subject: Accessing globals w/ Pascal (a novice wonders) Message-ID: <34034.27833A4E@stjhmc.fidonet.org> Date: 3 Jan 91 14:01:26 GMT Sender: ufgate@stjhmc.fidonet.org (newsout1.26) Organization: FidoNet node 1:114/56.12 - AZ MAC UG, Phoenix AZ Lines: 44 M> How do you access 'globals' from Pascal? Example: Changing the M> volume of the Mac. Example: Setting the height of the menu bar M> to 0. I know, don't touch these, but I write games. Need I say M> more? (Bane of the Human Interface Guidelines :) ). Has this M> been beaten like a dog already? You can set the sound volume with SetSoundVol and avoid globals alltoghther. As for the menu bar height, the following code doesn't work but it does illustrate setting globals: program MBarHeight; uses Script; type WordPtr = ^integer; var OldHeight: integer; theMBarHeight: WordPtr; begin OldHeight := GetMBarHeight; theMBarHeight := WordPtr($BAA); theMBarHeight^ := 0; DrawMenuBar; repeat until Button; theMBarHeight^ := OldHeight; DrawMenuBar end. Setting the global here doesn't really change the way DrawMenuBar works. You'll have to convince the Menu Manager that the System Font is zero pixels high or just draw over the menu bar. -- Uucp: ...{gatech,ames,rutgers}!ncar!asuvax!stjhmc!56.12!Chris.Gehlker Internet: Chris.Gehlker@p12.f56.n114.z1.fidonet.org