
Das neue, Herliche Macro gibt uns allen ne Chance, unsere Codes ohne große umbenennungssessions zu optimieren.
PB meckert nämlich nicht, wenn Macros wie PB-Funktionen heißen.
Mein Erstes Beispiel:
Code: Alles auswählen
Macro RGB2(mpr,mpg,mpb)
(mpr)+(mpg)<<8+(mpb)<<16
EndMacro
k=GetTickCount_()
For a=1 To 100000
For b=1 To 20000
farbe.l=RGB(255,0,255)
Next
Next
p=GetTickCount_()
For a=1 To 100000
For b=1 To 20000
farbe.l=RGB2(255,0,255)
Next
Next
l=GetTickCount_()
MessageRequester("Ergebnis:","Ohne Macro: "+Str(p-k)+Chr(13)+"Mit Macro: "+Str(l-p))
Procedure:
Macro:; farbe.l=RGB(255,0,255)
PUSH dword 255
PUSH dword 0
MOV eax,255
CALL PB_RGB
MOV dword [v_farbe],eax
; farbe.l=RGB2(255,0,255)
MOV dword [v_farbe],16711935
Vielleicht folgen noch andere Funktionen, mal schaun