diff options
-rw-r--r-- | mystringlistunit.pas | 13 |
1 files changed, 13 insertions, 0 deletions
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)); |