SRL Archive - Help and Support

Why 'T'


Bad Boy JH

2010-10-02 04:41:30

This just occoured to me, after scripting for quite a while…why do all these variable types, have the 'T' prefix? eg TPoint, TBox, TIntegerArray, TPlayer, TNPC…etc

Dgby714

2010-10-02 04:49:34

It means "Type" because thats what those are

Ex:
program _Types;

type
TType = record
Str: string;
Int: integer;
Bool: boolean;
end;
TTypeArray = array of TType;

var
TypeArray: TTypeArray;

begin
SetArrayLength(TypeArray, 1);
with TypeArray[0] do
begin
Str := 'String';
Int := 0;
Bool := False;
WriteLn('TypeArray[0] := ['#39 + Str + #39', ' + IntToStr(Int) + ', ' + BoolToStr(Bool); + '];');
end;
end.

Bad Boy JH

2010-10-02 08:28:11

I know what a type is, I have used them before (not actually in SRL scripts though, but in an unrelated SCAR script), that just never occoured to me…

Cstrike

2010-10-02 12:27:22

I always thought it stood for something like "two" or "2D" (until I met ATPA)

Nava2

2010-10-02 13:58:13

Its to signify its a custom type independent of the primary types (int, string, float, etc)