ich glaube ich steh mal wieder aufm Schlauch.
Vielleicht könnt ihr mir ja helfen:
Ich habe eine kurze Funktion, die einen String konvertieren soll:
Code: Alles auswählen
function ConvertVariable(aLine: string): string;
var
Varname: string;
ValuePreset: string;
x: integer;
begin
ValuePreset := '0';
if Pos('=', aLine) > 0 then
begin
x := Pos(';', aLine) - 1;
if x < 0 then x := Length(aLine);
ValuePreset := Copy(aLine, Pos('=', aLine) + 1, x);
ValuePreset := Trim(ValuePreset);
aLine := Copy(aLine, 0, Pos('=', aLine) - 1);
end;
x := Pos(';', aLine) - 1;
if x < 0 then x := Length(aLine);
Varname := Trim(Copy(aLine, 0, x));
Result := Format('var #%s %s', [Varname, ValuePreset]);
end;
Code: Alles auswählen
X = 0;
Y;
Code: Alles auswählen
var #X 0
var #Y 0
Code: Alles auswählen
var #X 0;
var #Y 0
Wahrscheinlich seh ich mal wieder den Wald vor lauter Bäumen nicht.
MFG
Komoluna