AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

memo in ini speichern

Ein Thema von Nemesis333 · begonnen am 8. Mai 2004 · letzter Beitrag vom 26. Apr 2005
Antwort Antwort
Benutzerbild von SirThornberry
SirThornberry
(Moderator)

Registriert seit: 23. Sep 2003
Ort: Bockwen
12.235 Beiträge
 
Delphi 2006 Professional
 
#1

Re: memo in ini speichern

  Alt 26. Apr 2005, 21:36
und falls man doch die memos in die ini packen will:
Hilfsfunktion
Delphi-Quellcode:
function ConvStrToHex(AStr: String): String;
var LGiveback, LStr: String;
    LCount: Integer;
begin
  setlength(LGiveback, length(AStr) * 2);
  for LCount := 1 to length(AStr) do
  begin
    LStr := IntToHex(Byte(AStr[LCount]), 2);
    move(LStr[1], LGiveback[(LCount - 1) * 2 + 1], 2);
  end;
  result := LGiveback;
end;

function ConvHexToStr(AHex: String): String;
var LGiveback: String;
    LCount: Integer;
begin
  setlength(LGiveback, Trunc(length(AHex) / 2));
  for LCount := 0 to length(LGiveback) - 1 do
    LGiveback[LCount + 1] := Char(StrToInt('$' + AHex[LCount * 2 + 1] + AHex[LCount * 2 + 2]));
  result := LGiveback;
end;
so wird in die Ini-Datei gespeichert
ini.WriteString('Section', 'MemoInhalt', ConvStrToHex(Memo1.Text)); und so wirds wieder ausgelesen
Memo1.Text := ConvHexToStr(ini.ReadString('Section', 'MemoInhalt', ''));
Jens
Mit Source ist es wie mit Kunst - Hauptsache der Künstler versteht's
  Mit Zitat antworten Zitat
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 06:41 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz