Ich möchte gerne, das ein Macro eine Funktion mehrfach,
je nach Anzahl der ans Macro übergebenen Parameter,
ausführt.
In meinem Beispiel soll die Funktion "LineTo_"
so oft ausgeführt werden, wie Parameter dazu übergeben werden.
Gibt es einen Weg?
Ich hoffe, Ihr versteht anhand meines Beispielcode was ich meine.
Danke & Gruß: Bernd
Code: Alles auswählen
;-====== Macros
Macro DrawTo(vx,vy,tx,ty)
MoveToEx_(hDC,vx,vy,0)
LineTo_(hDC,tx,ty)
EndMacro
Macro DrawToTo(vx,vy,tx1,ty1,tx2,ty2)
MoveToEx_(hDC,vx,vy,0)
LineTo_(hDC,tx1,ty1)
LineTo_(hDC,tx2,ty2)
EndMacro
Macro DrawToToTo(vx,vy,tx1,ty1,tx2,ty2,tx3,ty3)
MoveToEx_(hDC,vx,vy,0)
LineTo_(hDC,tx1,ty1)
LineTo_(hDC,tx2,ty2)
LineTo_(hDC,tx3,ty3)
EndMacro
;usw.
; Und so, z.B. sieht bisher der Aufruf aus
Case 2
SelectObject_(hdc, PBlack)
DrawTo(x,y,w,h)
DrawTo(xm,ym,w,ym)
DrawTo(xm,ym,xm,h)
SelectObject_(hdc, c)
If r=0
DrawTo(x,y,w,h)
ElseIf r=1
DrawToTo(x,y,xm,ym,w,ym)
ElseIf r=2
DrawToTo(x,y,xm,ym,xm,h)
EndIf