I get this error message:
"Error: TIPO_E_AREA N - String index or count must be from 1 to 255"
When I run this script:
{Selecione um objeto 2D e use o comando - Select a 2D object and run the
command}
Procedure Tipo_e_Area;
VAR
Shape: HANDLE;
Center,Area1,X,Y: REAL;
Area,Comodo: STRING;
n: INTEGER;
BEGIN
Shape := Nil;
Shape:= FSActLayer;
IF Shape <> NIL THEN BEGIN
Area1:= HArea(Shape)/10000;
Area:= Num2Str(2, Area1);
n := Pos('.', Area);
Delete(Area, n, 1);
Insert(',', Area, n);
HCenter(Shape,X,Y);
Comodo:= StrDialog('Nome do Comodo or Room name','Quarto');
IF NOT DidCancel THEN BEGIN
PushAttrs;
TextJust(2);
TextVerticalAlign(2);
TextSize(9);
TextOrigin(X,Y);
TextSize(12);
FillPat(0);
BeginText;
ConCat(Comodo, Chr(13), Area, ' m2')
EndText;
PopAttrs;
DSelectAll;
END;
END ELSE AlrtDialog('Select a solid 2D shape and try again.');
END;
Run(Tipo_e_Area);"
What am I doing wrong?