From 92dd95e43f55bed097ff1f57c41b4462640b083a Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Wed, 9 Dec 2015 12:58:54 +0100 Subject: loadFromResource neu in mystringlistunit.pas --- mystringlistunit.pas | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'mystringlistunit.pas') diff --git a/mystringlistunit.pas b/mystringlistunit.pas index 0a043a3..cdc0933 100644 --- a/mystringlistunit.pas +++ b/mystringlistunit.pas @@ -19,6 +19,7 @@ type destructor destroy; override; procedure loadFromFile(const s: ansiString); override; procedure loadFromGz(const s: ansiString); + procedure loadFromResource(const s: ansiString); procedure saveToGz(const s: ansiString); function readln(out s: string): boolean; inline; function metaReadln(out s: string; subRoutine: boolean): boolean; inline; @@ -104,6 +105,18 @@ begin gibAus(inttostr(count)+' Zeilen eingelesen',1); end; +procedure tMyStringlist.loadFromResource(const s: ansiString); +var + st: tResourceStream; + buf: ansistring; +begin + st:=tResourceStream.create(hInstance,s,RT_RCDATA); + setlength(buf,st.size); + st.readBuffer(buf[1],length(buf)); + st.free; + text:=buf; +end; + procedure tMyStringlist.saveToGz(const s: ansiString); begin fileunit.saveToGz(s,@(text[1]),length(text)); -- cgit v1.2.3-70-g09d2