Unit Globals

DescriptionUsesClasses, Interfaces, Objects and RecordsFunctions and ProceduresTypesConstantsVariables

Description

Original documentation:

v1.1 sept 1993
Made a start at cleaning up all these globals, but still a lot to do.  I have removed a
couple of dozen variables which were just wasting memory, and moved others to
local variable status.  For the most part, they need to be made into parameters or
file-scoped variables with unit initializer; this is too much work for now.

Uses

Overview

Classes, Interfaces, Objects and Records

Name Description
packed record tSystem  
record person  
record Full  
record God  
record Lin  
record Pic  
record Menagerie  

Types

CursorList = ARRAY[iBeamCursor..BlankCursor] OF CursHandle;
PtrInteger = ˆInteger;
PtrString = ˆstr255;
SwellType = (...);
HorizPos = (...);
VertPos = (...);
SmallNumber = -1..1;
chromosome = ARRAY[1..9] OF Integer;
Compass = (...);
CompletenessType = (...);
SpokesType = (...);
FullPtr = ˆFull;
FullHandle = ˆFullPtr;
GodPtr = ˆGod;
GodHandle = ˆGodPtr;
PartOfBox = (...);
LinPtr = ˆLin;
LinHandle = ˆLinPtr;
BaseHandle = ˆPtr;
PointArray = ARRAY[1..4] OF Point;
mode = (...);

Constants

SafetyValve = 20;
CarefulThreshold = 8192;
trickle = 10;
MutSizestart = 10;
iconhalfsize = 128;
ScrollBarWidth = 16;
TopBoxHeight = 10;
MaxGene9 = 12;
MaxAlbum = 100;
MaxBoxes = 100;
StackSize = 100;
GenesHeight = 20;
PicSizeMax = 4095;
WorryMax = 4095;
TickDelay = 20;
MutTypeNo = 9;
MenuCnt = 8;
ApplMenu = 1000;
FileMenu = 1001;
LoadAlbumItem = 1;
LoadFossilsItem = 2;
SaveBiomorphItem = 3;
SaveFossilsItem = 4;
SaveAlbumItem = 5;
CloseAlbumItem = 6;
QuitItem = 7;
EditMenu = 1002;
UndoItem = 1;
CutItem = 3;
Copyitem = 4;
PasteItem = 5;
ClearItem = 6;
HighlightBiomItem = 8;
AddBiomItem = 9;
ShowAlbumItem = 10;
OperMenu = 1004;
BreedItem = 1;
DriftItem = 2;
EngineeringItem = 3;
HopeMonsterItem = 4;
InitFossRecItem = 5;
PlayFossilItem = 6;
RecordFossilItem = 7;
TriangleItem = 8;
BoxMenu = 1005;
MoreRowsItem = 1;
FewerRowsItem = 2;
MoreColumnsItem = 3;
FewerColumnsItem = 4;
ThickerPenItem = 5;
ThinnerPenItem = 6;
DriftSweepItem = 7;
TriangleTopItem = 8;
TriangleLeftItem = 9;
TriangleRightItem = 10;
HideWindowItem = 12;
MutationMenu = 1006;
PedigreeMenu = 1007;
DisplayPedigreeItem = 1;
DrawOutItem = 3;
NoMirrorsItem = 4;
SingleMirrorItem = 5;
DoubleMirrorItem = 6;
MoveItem = 8;
DetachItem = 9;
KillItem = 10;
HelpMenu = 3238;
HelpCurrentItem = 1;
HelpMiscItem = 2;
SpecMenu = 21537;
ClosePlaybackItem = 1;
BreedCurrentItem = 2;
QuitPlaybackItem = 3;
AM = 1;
FM = 2;
EM = 3;
OM = 4;
BM = 5;
MM = 6;
PM = 7;
HM = 8;
PascalKind = 32700;
MainID = 1000;
AboutID = 1000;
Text1ID = 1000;
Text2ID = 1001;
Text3ID = 1002;
Text4ID = 21950;
WarnDiscString = 22773;
SaveAlbumString = 4720;
SaveFossilString = 11609;
WarnIconString = 7852;
TooLargeString = 13603;
SaveBiomorphString = 3866;
kAlertStringsID = 128;
kFossilsID = 7;
kAlbumID = 8;
kBiomorphID = 9;
kQuittingID = 10;
kClosingID = 11;
kResettingID = 12;
PlusIconString = 4477;
AsString = 17474;
AlbumPageID = 5102;
ClipID = 2000;
Clip1ID = 2000;
Clip2ID = 2001;
Clip3ID = 2002;
leftCursID = 135;
leftCursor = 5;
rightCursID = 136;
rightCursor = 6;
UpCursId = 137;
UpCursor = 7;
DownCursID = 138;
DownCursor = 8;
EqCursID = 139;
EqCursor = 9;
InjectCursID = 140;
InjectCursor = 10;
QCursID = 141;
QCursor = 11;
BlackCursId = 142;
BlackCursor = 12;
BoxCursID = 143;
BoxCursor = 13;
RandCursID = 144;
RandCursor = 14;
BreedCursID = 145;
BreedCursor = 15;
HandCursID = 146;
HandCursor = 16;
DrawOutCursID = 147;
DrawOutCursor = 17;
ScissorCursId = 148;
ScissorCursor = 18;
GunCursID = 149;
GunCursor = 19;
LensCursID = 150;
LensCursor = 20;
BlankCursID = 151;
BlankCursor = 21;
BSize = 512;
BCount = 256;

Variables

Finished: Boolean;
DotheSave: Boolean;
LoadingFossils: Boolean;
AlbumChanged: Boolean;
Danger: Boolean;
Pastable: Boolean;
Zoomed: Boolean;
theEvent: EventRecord;
TV: Integer;
TH: Integer;
FossilCounter: LongInt;
SizeWorry: integer;
DragArea: Rect;
GrowArea: Rect;
ScreenArea: Rect;
CursList: CursorList;
theCursor: Cursor;
MenuList: ARRAY[1..MenuCnt] OF MenuHandle;
SpecialBreedMenu: MenuHandle;
MainPtr: WindowPtr;
MainRec: WindowRecord;
PlayBackPtr: WindowPtr;
PlayBackRecord: WindowRecord;
PlayBackRect: Rect;
MyControl: ControlHandle;
MainPeek: WindowPeek;
ScreenPort: GrafPtr;
frontw: WindowPtr;
AlbumBitMap: ARRAY[0..4] OF BitMap;
mybitmap: bitmap;
OldBox: Integer;
k: Integer;
NumberInFile: Integer;
MyPenSize: Integer;
MLoc: Point;
MidScreen: Point;
hideInBackGround: Boolean;
DefaultVolume: Str255;
dirID: LongInt;
defaultDir: LongInt;
fileName: Str63;
volRefNum: Integer;
DefaultVolNum: Integer;
MaxPages: Integer;
Slides: Integer;
SizeOfPerson: LongInt;
LastPutFileName: Str255;
LastGetFileName: Str255;
FossilsToSave: Boolean;
FirstTime: Boolean;
ThereAreLines: Boolean;
SweepOn: Boolean;
AlbumEmpty: Boolean;
j: Integer;
NRows: Integer;
Ncols: Integer;
NBoxes: Integer;
NActiveBoxes: Integer;
MidBox: Integer;
special: Integer;
oldspecial: Integer;
width: Integer;
height: Integer;
AlbumNRows: Integer;
AlbumNCols: Integer;
BreedNRows: Integer;
BreedNCols: Integer;
BreedNBoxes: Integer;
RememberSpecial: integer;
margin: Rect;
DamageRect: Rect;
PRect: Rect;
BusinessPart: Rect;
DummyRect: Rect;
child: ARRAY[1..MaxBoxes] OF person;
box: ARRAY[1..MaxBoxes] OF Rect;
centre: ARRAY[1..MaxBoxes] OF point;
TheMode: mode;
SaveMode: mode;
OldMode: mode;
RememberMode: mode;
GeneBox: ARRAY[1..16] OF Rect;
ClipBoarding: Boolean;
Fossilizing: Boolean;
naive: Boolean;
burst: Boolean;
WarningHasBeenGiven: Boolean;
Midline: Integer;
CurrentPage: Integer;
DelayedDrawing: Boolean;
ZeroMargin: Boolean;
DAon: Boolean;
BrokenOut: Boolean;
MyPic: Pic;
ThisPic: PicHandle;
Mut: ARRAY[1..MutTypeNo] OF Boolean;
DocumentMessage: Integer;
DocumentCount: Integer;
Rays: Integer;
Verdict: Integer;
Album: Menagerie;
ThisMenagerie: Menagerie;
NPages: Integer;
Morph: Integer;
Page: Integer;
BoxNo: Integer;
DriftOne: Integer;
GodCounter: Integer;
PBoxNo: ARRAY[1..4] OF Integer;
MyPicture: PicHandle;
StoreChild: ARRAY[1..MaxBoxes] OF Person;
SomethingToRestore: Boolean;
AlreadyTriangling: Boolean;
SpecialFull: FullHandle;
OldSpecialFull: FullHandle;
RunningFull: FullHandle;
ThatFull: FullHandle;
FullSize: Size;
Region2: RgnHandle;
DestRegion: RgnHandle;
SaveRegion: RgnHandle;
RootGod: GodHandle;
theGod: GodHandle;
SaveGod: GodHandle;
HitListHead: GodHandle;
firstBiomorph: Person;
theBiomorph: Person;
topan: Person;
leftan: Person;
rightan: Person;
copiedanimal: Person;
target: Person;
MidPoint: Point;
r1: real;
r2: real;
r3: real;
a: Point;
b: Point;
c: Point;
mous: Point;
LastMouse: Point;
NowMouse: Point;
AsymString: Str255;
BilatString: Str255;
SingleString: Str255;
UpDnString: Str255;
RadialString: Str255;
gSystem: tSystem;

Description

Types

CursorList = ARRAY[iBeamCursor..BlankCursor] OF CursHandle;
 
PtrInteger = ˆInteger;
 
PtrString = ˆstr255;
 
SwellType = (...);
 
Values
  • Swell:  
  • Same:  
  • Shrink:  
HorizPos = (...);
 
Values
  • LeftThird:  
  • MidThird:  
  • RightThird:  
VertPos = (...);
 
Values
  • TopRung:  
  • MidRung:  
  • BottomRung:  
SmallNumber = -1..1;
 
chromosome = ARRAY[1..9] OF Integer;
 
Compass = (...);
 
Values
  • NorthSouth:  
  • EastWest:  
CompletenessType = (...);
 
Values
  • Single:  
  • Double:  
SpokesType = (...);
 
Values
  • NorthOnly:  
  • NSouth:  
  • Radial:  
FullPtr = ˆFull;
 
FullHandle = ˆFullPtr;
 
GodPtr = ˆGod;
 
GodHandle = ˆGodPtr;
 
PartOfBox = (...);
 
Values
  • MainPart:  
  • MovePart:  
  • GoAwayPart:  
  • AnyPart:  
LinPtr = ˆLin;
 
LinHandle = ˆLinPtr;
 
BaseHandle = ˆPtr;
 
PointArray = ARRAY[1..4] OF Point;
 
mode = (...);
 
Values
  • preliminary:  
  • breeding:  
  • albuming:  
  • phyloging:  
  • killing:  
  • moving:  
  • detaching:  
  • randoming:  
  • engineering:  
  • drifting:  
  • highlighting:  
  • PlayingBack:  
  • triangling:  
  • sweeping:  

Constants

SafetyValve = 20;
 
CarefulThreshold = 8192;
 
trickle = 10;
 
MutSizestart = 10;
 
iconhalfsize = 128;
 
ScrollBarWidth = 16;
 
TopBoxHeight = 10;
 
MaxGene9 = 12;
 
MaxAlbum = 100;

v1.1 was set to 15, but turbo version said 100

MaxBoxes = 100;

v1.1 was set to 50

StackSize = 100;
 
GenesHeight = 20;
 
PicSizeMax = 4095;

Height of the GeneBoxes, in pixels

WorryMax = 4095;
 
TickDelay = 20;
 
MutTypeNo = 9;
 
MenuCnt = 8;

*** Menu Constants ***

ApplMenu = 1000;

Menu Constant

FileMenu = 1001;

Menu Constant

LoadAlbumItem = 1;

v1.1 added these menu item constants. Life is too hard without them

LoadFossilsItem = 2;

v1.1 added these menu item constants. Life is too hard without them

SaveBiomorphItem = 3;

v1.1 added these menu item constants. Life is too hard without them

SaveFossilsItem = 4;

v1.1 added these menu item constants. Life is too hard without them

SaveAlbumItem = 5;

v1.1 added these menu item constants. Life is too hard without them

CloseAlbumItem = 6;

v1.1 added these menu item constants. Life is too hard without them

QuitItem = 7;

v1.1 added these menu item constants. Life is too hard without them

EditMenu = 1002;

Menu Constant

UndoItem = 1;

v1.1 added these menu item constants. Life is too hard without them

CutItem = 3;

v1.1 added these menu item constants. Life is too hard without them

Copyitem = 4;

v1.1 added these menu item constants. Life is too hard without them

PasteItem = 5;

v1.1 added these menu item constants. Life is too hard without them

ClearItem = 6;

v1.1 added these menu item constants. Life is too hard without them

HighlightBiomItem = 8;

v1.1 added these menu item constants. Life is too hard without them

AddBiomItem = 9;

v1.1 added these menu item constants. Life is too hard without them

ShowAlbumItem = 10;

v1.1 added these menu item constants. Life is too hard without them

OperMenu = 1004;

Menu Constant

BreedItem = 1;

v1.1 added these menu item constants. Life is too hard without them

DriftItem = 2;

v1.1 added these menu item constants. Life is too hard without them

EngineeringItem = 3;

v1.1 added these menu item constants. Life is too hard without them

HopeMonsterItem = 4;

v1.1 added these menu item constants. Life is too hard without them

InitFossRecItem = 5;

v1.1 added these menu item constants. Life is too hard without them

PlayFossilItem = 6;

v1.1 added these menu item constants. Life is too hard without them

RecordFossilItem = 7;

v1.1 added these menu item constants. Life is too hard without them

TriangleItem = 8;

v1.1 added these menu item constants. Life is too hard without them

BoxMenu = 1005;

Menu Constant

MoreRowsItem = 1;

v1.1 added these menu item constants. Life is too hard without them

FewerRowsItem = 2;

v1.1 added these menu item constants. Life is too hard without them

MoreColumnsItem = 3;

v1.1 added these menu item constants. Life is too hard without them

FewerColumnsItem = 4;

v1.1 added these menu item constants. Life is too hard without them

ThickerPenItem = 5;

v1.1 added these menu item constants. Life is too hard without them

ThinnerPenItem = 6;

v1.1 added these menu item constants. Life is too hard without them

DriftSweepItem = 7;

v1.1 added these menu item constants. Life is too hard without them

TriangleTopItem = 8;

v1.1 added these menu item constants. Life is too hard without them

TriangleLeftItem = 9;

v1.1 added these menu item constants. Life is too hard without them

TriangleRightItem = 10;

v1.1 added these menu item constants. Life is too hard without them

HideWindowItem = 12;

v1.1 added these menu item constants. Life is too hard without them

MutationMenu = 1006;

Menu Constant

PedigreeMenu = 1007;

Menu Constant

DisplayPedigreeItem = 1;

v1.1 added these menu item constants. Life is too hard without them

DrawOutItem = 3;

v1.1 added these menu item constants. Life is too hard without them

NoMirrorsItem = 4;

v1.1 added these menu item constants. Life is too hard without them

SingleMirrorItem = 5;

v1.1 added these menu item constants. Life is too hard without them

DoubleMirrorItem = 6;

v1.1 added these menu item constants. Life is too hard without them

MoveItem = 8;

v1.1 added these menu item constants. Life is too hard without them

DetachItem = 9;

v1.1 added these menu item constants. Life is too hard without them

KillItem = 10;

v1.1 added these menu item constants. Life is too hard without them

HelpMenu = 3238;

Menu Constant

HelpCurrentItem = 1;

v1.1 added these menu item constants. Life is too hard without them

HelpMiscItem = 2;

v1.1 added these menu item constants. Life is too hard without them

SpecMenu = 21537;

Menu Constant

ClosePlaybackItem = 1;

v1.1 added these menu item constants. Life is too hard without them

BreedCurrentItem = 2;

v1.1 added these menu item constants. Life is too hard without them

QuitPlaybackItem = 3;

v1.1 added these menu item constants. Life is too hard without them

AM = 1;

index into MenuList for Apple Menu

FM = 2;

index into File Menu

EM = 3;
 
OM = 4;

index into Operation Menu

BM = 5;

index into Boxes Menu

MM = 6;

index into Mutations Menu

PM = 7;

index into Pedigree Menu

HM = 8;

W for Window Menu

PascalKind = 32700;

windowKind of pascal windows

MainID = 1000;

resource ID for MainWindow

AboutID = 1000;

resource ID for dialog box

Text1ID = 1000;

resource IDs for 'About...' text

Text2ID = 1001;
 
Text3ID = 1002;
 
Text4ID = 21950;
 
WarnDiscString = 22773;
 
SaveAlbumString = 4720;
 
SaveFossilString = 11609;
 
WarnIconString = 7852;
 
TooLargeString = 13603;
 
SaveBiomorphString = 3866;
 
kAlertStringsID = 128;

new STR# IDs for alerts - v1.1

kFossilsID = 7;
 
kAlbumID = 8;
 
kBiomorphID = 9;
 
kQuittingID = 10;
 
kClosingID = 11;
 
kResettingID = 12;
 
PlusIconString = 4477;
 
AsString = 17474;
 
AlbumPageID = 5102;
 
ClipID = 2000;
 
Clip1ID = 2000;
 
Clip2ID = 2001;
 
Clip3ID = 2002;
 
leftCursID = 135;

CURSORS > made these contiguous numbers so that they can be read in a loop and checked - Alun

leftCursor = 5;
 
rightCursID = 136;
 
rightCursor = 6;
 
UpCursId = 137;
 
UpCursor = 7;
 
DownCursID = 138;
 
DownCursor = 8;
 
EqCursID = 139;
 
EqCursor = 9;
 
InjectCursID = 140;
 
InjectCursor = 10;
 
QCursID = 141;
 
QCursor = 11;
 
BlackCursId = 142;
 
BlackCursor = 12;
 
BoxCursID = 143;
 
BoxCursor = 13;
 
RandCursID = 144;
 
RandCursor = 14;
 
BreedCursID = 145;
 
BreedCursor = 15;
 
HandCursID = 146;
 
HandCursor = 16;
 
DrawOutCursID = 147;
 
DrawOutCursor = 17;
 
ScissorCursId = 148;
 
ScissorCursor = 18;
 
GunCursID = 149;
 
GunCursor = 19;
 
LensCursID = 150;
 
LensCursor = 20;
 
BlankCursID = 151;
 
BlankCursor = 21;
 
BSize = 512;
 
BCount = 256;

****Added for v1.1****

Variables

Finished: Boolean;
 
DotheSave: Boolean;
 
LoadingFossils: Boolean;
 
AlbumChanged: Boolean;
 
Danger: Boolean;
 
Pastable: Boolean;
 
Zoomed: Boolean;
 
theEvent: EventRecord;

event passed from operating system

TV: Integer;

location of text

TH: Integer;

location of text

FossilCounter: LongInt;
 
SizeWorry: integer;
 
DragArea: Rect;

defines area where window can be dragged in

GrowArea: Rect;

defines area to which a window's size can change

ScreenArea: Rect;

defines screen dimensions

CursList: CursorList;

used to hold cursor handles

theCursor: Cursor;
 
MenuList: ARRAY[1..MenuCnt] OF MenuHandle;

holds menu info

SpecialBreedMenu: MenuHandle;
 
MainPtr: WindowPtr;

pointer to main window

MainRec: WindowRecord;

holds data for main window

PlayBackPtr: WindowPtr;
 
PlayBackRecord: WindowRecord;
 
PlayBackRect: Rect;
 
MyControl: ControlHandle;
 
MainPeek: WindowPeek;

pointer to MainRec

ScreenPort: GrafPtr;

pointer to entire screen

frontw: WindowPtr;

pointer to active window

AlbumBitMap: ARRAY[0..4] OF BitMap;
 
mybitmap: bitmap;
 
OldBox: Integer;
 
k: Integer;
 
NumberInFile: Integer;
 
MyPenSize: Integer;
 
MLoc: Point;
 
MidScreen: Point;
 
hideInBackGround: Boolean;

added v1.1 if TRUE hide our windows when switched out. Toggled by menu

DefaultVolume: Str255;

name of disk we are running on

dirID: LongInt;

Folder ID for fossil file and app

defaultDir: LongInt;

Folder ID for fossil file and app

fileName: Str63;

name of fossil file, normally 'Fossil History'

volRefNum: Integer;

volRefNum is volume containing fossil file, DefaultVolNum contains app

DefaultVolNum: Integer;

volRefNum is volume containing fossil file, DefaultVolNum contains app

MaxPages: Integer;

volRefNum is volume containing fossil file, DefaultVolNum contains app

Slides: Integer;

fileNum of fossil file

SizeOfPerson: LongInt;

Record size for saving to files.

LastPutFileName: Str255;
 
LastGetFileName: Str255;
 
FossilsToSave: Boolean;
 
FirstTime: Boolean;
 
ThereAreLines: Boolean;
 
SweepOn: Boolean;
 
AlbumEmpty: Boolean;
 
j: Integer;
 
NRows: Integer;
 
Ncols: Integer;
 
NBoxes: Integer;
 
NActiveBoxes: Integer;
 
MidBox: Integer;
 
special: Integer;
 
oldspecial: Integer;
 
width: Integer;
 
height: Integer;
 
AlbumNRows: Integer;
 
AlbumNCols: Integer;
 
BreedNRows: Integer;
 
BreedNCols: Integer;
 
BreedNBoxes: Integer;
 
RememberSpecial: integer;
 
margin: Rect;
 
DamageRect: Rect;
 
PRect: Rect;
 
BusinessPart: Rect;
 
DummyRect: Rect;
 
child: ARRAY[1..MaxBoxes] OF person;
 
box: ARRAY[1..MaxBoxes] OF Rect;
 
centre: ARRAY[1..MaxBoxes] OF point;
 
TheMode: mode;
 
SaveMode: mode;
 
OldMode: mode;
 
RememberMode: mode;
 
GeneBox: ARRAY[1..16] OF Rect;
 
ClipBoarding: Boolean;
 
Fossilizing: Boolean;
 
naive: Boolean;
 
burst: Boolean;
 
WarningHasBeenGiven: Boolean;
 
Midline: Integer;
 
CurrentPage: Integer;
 
DelayedDrawing: Boolean;
 
ZeroMargin: Boolean;
 
DAon: Boolean;
 
BrokenOut: Boolean;
 
MyPic: Pic;
 
ThisPic: PicHandle;
 
Mut: ARRAY[1..MutTypeNo] OF Boolean;
 
DocumentMessage: Integer;
 
DocumentCount: Integer;
 
Rays: Integer;
 
Verdict: Integer;
 
Album: Menagerie;
 
ThisMenagerie: Menagerie;
 
NPages: Integer;
 
Morph: Integer;
 
Page: Integer;
 
BoxNo: Integer;
 
DriftOne: Integer;
 
GodCounter: Integer;
 
PBoxNo: ARRAY[1..4] OF Integer;
 
MyPicture: PicHandle;
 
StoreChild: ARRAY[1..MaxBoxes] OF Person;
 
SomethingToRestore: Boolean;
 
AlreadyTriangling: Boolean;
 
SpecialFull: FullHandle;
 
OldSpecialFull: FullHandle;
 
RunningFull: FullHandle;
 
ThatFull: FullHandle;
 
FullSize: Size;
 
Region2: RgnHandle;
 
DestRegion: RgnHandle;
 
SaveRegion: RgnHandle;
 
RootGod: GodHandle;
 
theGod: GodHandle;
 
SaveGod: GodHandle;
 
HitListHead: GodHandle;
 
firstBiomorph: Person;
 
theBiomorph: Person;
 
topan: Person;
 
leftan: Person;
 
rightan: Person;
 
copiedanimal: Person;
 
target: Person;
 
MidPoint: Point;
 
r1: real;
 
r2: real;
 
r3: real;
 
a: Point;
 
b: Point;
 
c: Point;
 
mous: Point;
 
LastMouse: Point;
 
NowMouse: Point;
 
AsymString: Str255;
 
BilatString: Str255;
 
SingleString: Str255;
 
UpDnString: Str255;
 
RadialString: Str255;
 
gSystem: tSystem;

v1.1 A record of info on the capabilities of the current system


Generated by PasDoc 0.14.0.