SRL Archive - Help and Support

Weird constants.


Wanted

2007-07-14 21:11:40

Any one know how to make TBox and TPoint constants?

I tried doing this

{const
MMC.X = MMCX;
MMC.Y = MMCY;
MM.X1 = MMX1;
MM.Y1 = MMY1;
MM.X2 = MMX2; I have no idea how to do this, but
MM.Y2 = MMY2; I'm trying to make TPoint and TBox
MSC.X = MSCX; constants of the MainScreen ect...
MSC.Y = MSCY;
MS.X1 = MSX1;
MS.Y1 = MSY1;
MS.X2 = MSX2;
MS.Y2 = MSY2;
MIC.X = MICX;
MIC.Y = MICY;
MI.X1 = MIX1;
MI.Y1 = MIY1;
MI.X2 = MIX2;
MI.Y2 = MIY2;
MCC.X = MCCX;
MCC.Y = MCCY;
MC.X1 = MCX1;
MC.Y1 = MCY1;
MC.X2 = MCX2;
MC.Y2 = MCY2;}

Starblaster100

2007-07-14 21:52:12

You have to create them as variables in a procedure.

SKy Scripter

2007-07-14 21:59:15

not possible in SCAR sorry

if it was for delphi you would do somthing like this


const
Point : TPoint =
(
x : 10;
y : 20

);

for arrays


const
X : array [1..5] Integer =
(
1, 2, 3, 4, 5
);

jhildy

2007-07-15 01:22:06

im pretty sure set MMc as a Tpoint variable set Mm and Ms as a tbox Msc as a tpoint Ms as tbox Mic as tpoint ect then set them like Mm.x1 :=MMX1 in a procedure.

Wanted

2007-07-15 21:32:29

Yea, I know but I wanted to make them constants :(

jhildy

2007-07-16 20:00:58

how come?

Wanted

2007-07-16 22:51:15

Well actually I could just make them functions like Pi.

n3ss3s

2007-07-17 05:59:41

const PointX = 1;
const PointY = 1;

Point.x := PointX
Point.y := PointY

SKy Scripter

2007-07-18 16:51:29

From: n3ss3s
const PointX = 1;
const PointY = 1;

Point.x := PointX
Point.y := PointY


lol any way that would be usless for rs coords when there are already constants

pnt := Point(MSX1, MSY1);