PROCEDURE lampe; VAR RealDial1,RealDial2,RealDial3,RealDial4,RealDial5,RealDial6,RealDial7,RealDial8,RealDial9 : REAL; IntDial1,IntDial2,IntDial3,IntDial4,IntDial5,IntDial6,IntDial7,IntDial8,IntDial9 : INTEGER; a,i,m,n: INTEGER; px, py : REAL; meinlayerhandle, myhandle : HANDLE; BEGIN {Parameter bestimmen} RealDial1 := RealDialog ('Aus wievielen Segmenten soll die Lampe bestehen?', '20'); IntDial1 := Round(RealDial1); RealDial2 := RealDialog ('Zufallsfaktor fŸr x-Koordinate der etappe1 (positiver Wert von 0.5 bis 5.0)', '3.4'); IntDial2 := Round(RealDial2); RealDial3 := RealDialog ('Zufallsfaktor fŸr y-Koordinate der etappe1 (negativer Wert von 0.5 bis 5.0)', '-2.0'); IntDial3 := Round(RealDial3); RealDial4 := RealDialog ('Zufallsfaktor fŸr x-Koordinate der etappe2 (positiver Wert von 0.5 bis 5.0)', '2.0'); IntDial4 := Round(RealDial4); RealDial5 := RealDialog ('Zufallsfaktor fŸr y-Koordinate der etappe2 (positiver Wert von 0.5 bis 5.0)', '6.0'); IntDial5 := Round(RealDial5); RealDial6 := RealDialog ('Zufallsfaktor fŸr x-Koordinate der etappe3 (negativer Wert von 0.5 bis 5.0)', '-2.5'); IntDial6 := Round(RealDial6); RealDial7 := RealDialog ('Zufallsfaktor fŸr y-Koordinate der etappe3 (positiver Wert von 0.5 bis 5.0)', '1.0'); IntDial7 := Round(RealDial7); RealDial8 := RealDialog ('Zufallsfaktor fŸr x-Koordinate der etappe4 (negativer Wert von 0.5 bis 5.0)', '-2'); IntDial8 := Round(RealDial8); RealDial9 := RealDialog ('Zufallsfaktor fŸr y-Koordinate der etappe4 (negativer Wert von 0.5 bis 5.0)', '-1'); IntDial9 := Round(RealDial9); FOR a := 1 TO IntDial1 DO BEGIN BeginPoly; {fixe etappe} Absolute; MoveTo (4,0); LineTo(4,-0.5); LineTo(8,-0.5); LineTo(8,-0.7); LineTo(4,-0.7); LineTo(4,-15.7); LineTo(0,-15.7); {etappe1} Relative; FOR i := 1 TO 10 DO BEGIN px := random*IntDial2; py := random*IntDial3; LineTo(px,py); END; {etappe2} FOR i := 1 TO 15 DO BEGIN px := random*IntDial4; py := random*IntDial5; LineTo(px,py); END; {etappe3} FOR i := 1 TO 10 DO BEGIN px := random*IntDial6; py := random*IntDial7; LineTo(px,py); END; {etappe4} FOR i := 1 TO 9 DO BEGIN px := random*IntDial8; py := random*IntDial9; LineTo(px,py); END; {polylinie schliessen} Absolute; LineTo(4,0); EndPoly; END; {segmente auseinander ziehen} meinlayerhandle := ActLayer; For m:=0 TO IntDial1 DO BEGIN myHandle := FObject; For n:=0 TO NumObj(meinlayerhandle) DO BEGIN HMove(myhandle, n*2, 0); myhandle := NextObj(myhandle); redraw; wait(0.3); END; END; {fixes oval zeichnen} Oval (16,-58,0,-42); Oval (10,-52,6,-48); END; Run(lampe);