Ich habe mich mal an einer Art Preprocessor für Autoit versucht.
Neue Version
Diese Version läuft etwas langsamer als die alte, dafür ist die Statusanzeige vielfach schneller (GDI+ statt RichEdit)
Zusätzlich wird auch noch ein LogFile erstellt.
Aufruf via CMD-Line und Run_Before ist auch möglich.
#AutoIt3Wrapper_Run_Before=""%autoitdir%\aapp.exe" "%in%""
(es wird auch ein Backup erstellt)
Der PreProcessor
.) fügt alle Includes ein
.) entfernt alle überflüssigen Funktionen
.) ersetzt Global Const durch ihren Wert
.) entfernt überflüssige Global Const
.) benennt Funktionen und Variablen in ganz kurze Namen um
.) berechnet einfache mathematische Ausdrücke
.) kombiniert & _ geteilte Zeilen (außer die Zeilenlänge würde 4095 Zeichen übersteigen)
.) kombiniert & geteilte Strings
.) optimiert IF und CASE
.) wandelt Zahlen in Hex um
Einige Probleme hatte ich mit den Stringcalls, also Funktionen bzw. Variablen die via String aufgerufen werden.
Wenn ein String erwartet wird, jedoch nur eine Variable gefunden wird:
$Str='_Func'
Call($Str)
dann wird in diesem Fall keine Funktion entfernt oder umbenannt, denn $Str könnte den Namen jeder Funktion enthalten!
oft verwendet man Execute nur um 2 Strings zusammenzufügen oder sonst was, jedoch nicht um eine Funktion oder Variable aufzurufen.
deshalb gibt es die Funktion Execute is used to call functions/variables
z.B.: bei Unicalc Grafik von Ludwig kann man diese Optionen deaktivieren, da sonst keine Funktionen entfernt bzw. umbenannt werden würden...
jedoch beim Hilfebeispiel _FTP_SetStatusCallback muß man diese Optionen aktiviert lassen, ansonsten ist das fertige Script nicht lauffähig
---
Kann mir jemand helfen die englischen Sätze richtig und gut zu formulieren?!
mein Englisch ist leider sehr bescheiden
thx
lgE