.... wahrscheinlich wieder 'mal nur ein banales Problem: Ich probiere gerade aus, einen String zu komprimieren, aber schon bei der Programm-Funktion erscheint folgende Fehlermeldung:
"Error: Identifier not found "CompressBuf" - (selbiges bei "DecompressBuf")
obwohl "ZLib" bei "uses" eingebunden ist.
Warum findet Lazarus "CompressBuf" nicht?
Was muss ich noch einbinden?
Danke!
Aliobaba
Code: Alles auswählen
uses
... Zlib, ...;
function CompressString(input:string):string;
var
InpBuf, OutBuf: Pointer;
OutBytes: Integer;
begin
InpBuf := nil;
OutBuf := nil;
try
GetMem(InpBuf, Length(input));
Move(input[1], InpBuf^, Length(input));
CompressBuf(InpBuf, Length(input), OutBuf, OutBytes);
SetLength(result,OutBytes);
Move(OutBuf^, result[1], OutBytes);
finally
if InpBuf <> nil then FreeMem(InpBuf);
if OutBuf <> nil then FreeMem(OutBuf);
end;
end;
function DeCompressString(input:string):string;
var
InpBuf, OutBuf: Pointer;
OutBytes: Integer;
begin
InpBuf := nil;
OutBuf := nil;
try
GetMem(InpBuf, Length(input));
Move(input[1], InpBuf^, Length(input));
DeCompressBuf(InpBuf, Length(input),0,OutBuf, OutBytes);
SetLength(result,OutBytes);
Move(OutBuf^, result[1], OutBytes);
finally
if InpBuf <> nil then FreeMem(InpBuf);
if OutBuf <> nil then FreeMem(OutBuf);
end;
end;
http://www.delphipraxis.net/18249-strin ... ieren.html