Hi Everybody!
Got a problem with defining the parameters in the doFractal(148.5,210,0,148.5,3); at the end of the script for use in a plugin... the idea is to be able to set object width, height and iteration etc...
how do i properly define this parameters??
THANX!
PROCEDURE faltFractal;
PROCEDURE doFractal(x,ya,yb,breite:REAL; iteration:INTEGER);
VAR
pageWidth,pageHeight,pageFoldX,xp,xn,ym:REAL;
rect1,rect2:HANDLE;
BEGIN
pageWidth:=297;
pageHeight:=210;
pageFoldX:=pageWidth/2;
PenFore(0,0,65535);
moveto(0,0);
lineto(pageWidth,0);
lineto(pageWidth,pageHeight);
lineto(0,pageHeight);
lineto(0,0);
moveto(pageFoldX,pageHeight);
lineto(pageFoldX,0);
xp:=x-(breite/2.0);
xn:=x+(breite/2.0);
ym:=(ya+yb)/2.0;
Rect(xp,yb,x,ym);
rect1:=LNewObj;
SetFPat(rect1,9);
Rect(x,yb,xn,ym);
rect2:=LNewObj;
SetFPat(rect2,70);
MoveTo(xp,ym);
LineTo(xn,ym);
MoveTo(x,ym);
LineTo(x,yb);
IF(iteration=0) THEN BEGIN
MoveTo(x,ym);
LineTo(x,ya);
MoveTo(xp,yb);
LineTo(xp,ym);
MoveTo(xn,yb);
LineTo(xn,ym);
END ELSE BEGIN
doFractal(x,ya,ym,breite/2.0,iteration-1);
doFractal(xp,ym,yb,breite/2.0,iteration-1);
doFractal(xn,ym,yb,breite/2.0,iteration-1);
END;
END;
BEGIN
doFractal(148.5,210,0,148.5,3);
END;
run (faltFractal);