"{" expected in line 4.

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

"{" expected in line 4.

LunatMercall
I want to start working with these macros I've found, but when I start to run it, pops up the same error "{" expected in line 4. I'm new with this program, I really need some help or advice.  Here  is the .txt


Var

Nombre, w:string;

numero, volver:integer;

macro 'area basal 1';

{ hace hasta que se ajuste el threshold}

var

name, wPath, FullPath: string;

FileType, a,aa: string;

FileSize: integer;

begin

volver:='0';

Open('');

Sharpen;

Sharpen;

SetOptions('grayscale');

MoveWindow(300,58);

name := WindowTitle;
 
  wPath := GetPath('window'); {Grab path before before opening window}

FullPath := concat(wPath, name);

Open(FullPath);

sharpen;

ResetCounter;

invert;

Autothreshold;

Autothreshold;

SelectTool('lut');

NextWindow;

w:='no';

if aa='n' then begin

    end;

end;



macro 'area basal 2';

{deja en watershed marcar el anillo}

var

i:integer;

begin

setbinarycount(6);

MakeBinary;

for i:=1 to 5 do begin

Erode;

end;

 binary('watershed');

 SelectTool('freehand');

end;



macro 'marca anillo';

var

name, wPath, FullPath: string;

FileType, a: string;

FileSize: integer;

begin

name := WindowTitle;

wPath := GetPath('window');



a:= 'coor'
;
FullPath := concat(wPath, name,a);

SetExport('xy Coordinates');

Export(FullPath);



setscale(0.33393,'µm');

Measure;

rUser2[1]:=rArea[1];

PutMessage(' valor del area',rUser2[1]);

Copy;

  SelectAll;

  Clear;

  RestoreRoi;

  Paste;

  KillRoi;





{cambia el color del pincel SetBrushSize(7);asi no funciona}

  wPath := GetPath('window'); {Grab path before before opening window}

ImageMath('sub',1,2,0.5,128,'resultado');

a:='q';

Nombre:= concat(wPath, name,a);

{SaveAs(FullPath);}

PutMessage(' ahora debe perfeccionar la imagen, use blanco para rellenar y negro para dividir');

SelectTool('brush');

SetForegroundColor(0);

end;



macro 'medir 1';

var

name, wPath, FullPath: string;

FileType, z, a: string;

FileSize: integer;

i:integer;

begin

if w='no' then begin

Autothreshold;

MakeBinary;

invert;

end else begin

UpdateResults;

end;



FullPath:=Nombre;

SaveAs(FullPath);

wPath := GetPath('window');

name := WindowTitle;

setscale(0.33393,'µm');

SetOptions('Area;X-Y Center; Perimeter; Major; Minor;Angle;User1;User2');
if volver=1 then begin

numero:=GetNumber(' Elimina particulas menores que:',30,0);

end else begin

numero:=30;

end;

SetParticleSize(numero,999999);

LabelParticles(true);

  OutlineParticles(true);

  IgnoreParticlesTouchingEdge(true);

  IncludeInteriorHoles(false);

  WandAutoMeasure(false);

  AdjustAreas(false);

 SetPrecision(0);

 ShowResults;

{en esta parte empieza a medir y sumar}

  AnalyzeParticles;

  SetUser1Label('Sum');

   rUser1[1]:=rArea[1];

  for i:=2 to rCount do begin

     rUser1[i]:=rArea[i] + rUser1[i-1];

     rUser2[i]:=0;

  end;



  UpdateResults;

a:= 'm';

FullPath := concat(a,wPath,name);

SetExport('Measurements');

Export(FullPath);

dispose;

end;



macro 'final';

var

a, z, FullPath: string
;
wPath, name: string;

begin

a:=GetString(' Debe volver ','no');

if a='s' then begin

volver:=1;

NextWindow;

wPath := GetPath('window');
name := WindowTitle;

z:='q';
FullPath := concat(wPath, name,z);

NextWindow;

close;
Open(FullPath)
;
w:='s';

end else begin
DisposeAll;
end;
end;