Jump to content
Developer Wiki and Function Reference Links ×

define parameters for plug-in


Recommended Posts

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);

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...