Warning: ob_start(): function 'compress_handler' not found or invalid function name in /www/htdocs/xfmantis/core.php on line 18
0001868: TStringlist-Variablen werden nicht gespeichert - Mantis
Mantis Bugtracker
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0001868 [X-Force] Allgemein minor always 16.05.08 07:19 24.06.08 03:00
Reporter Natter View Status public  
Assigned To Natter
Priority normal Resolution fixed  
Status closed   Product Version V0.911 - RC
Summary 0001868: TStringlist-Variablen werden nicht gespeichert
Description Variablen vom Typ TSTringList werden offensichtlich nicht mit gespeichert, und sind daher nach dem Laden ungültig (bzw. müssen neu erzeugt werden). Hier sollte man mal prüfen, ob man das ändern kann.
Additional Information
Attached Files

- Relationships

SYSTEM WARNING: Creating default object from empty value


- Notes
(0003196)
Natter
23.05.08 18:36

Also zumindest werden die TStringlist jetzt erstmal gespeichert. Allerdings funktioniert es noch nicht ganz sauber (die Zugewiesenen Texte stimmen nicht ganz - anscheinend wird der Zeilenumbruch als Trenner interpretiert).

function script_utils_WriteObjToString(Obj: TObject): String;
type
  TWriteToScriptString = function(slf: TObject): String;
var
  func: TWriteToScriptString;
begin
  if IsObject(Obj) then
  begin
    result:=Obj.ClassName+'|:';
    if Obj is TStringList then
      result:='TStringList|:'+TStringList(Obj).Text
    else
    begin
      func:=Obj.MethodAddress('WriteToScriptString');
      if Assigned(func) then
        result:=result+TWriteToScriptString(func)(Obj)
      else
        result:='nil';
    end;
  end
  else
    result:='nil';
end;

function script_utils_ReadObjFromString(Str: String; aClass: TClass): TObject;
type
  TReadFromScriptString = function(slf: TClass; ObjStr: String): TObject;
var
  Parts: TStringArray;
begin
  if Str<>'nil' then
  begin
    Parts:=string_utils_explode('|:',Str);
    if length(Parts)=2 then
    begin
      Str:=Parts[1];

      if Parts[0] = 'TStringList' then
      begin
         result:=TStringList.Create;
         TStringList(result).Text:=Parts[1];
         exit;
      end
      else if (aClass=nil) or (aClass=TObject) then
        aClass:=script_utils_GetClass(Parts[0]);
    end;
    result:=TReadFromScriptString(aClass.MethodAddress('ReadFromScriptString'))(aClass,Str);
  end
  else
    result:=nil;
end;
 

- Issue History
Date Modified Username Field Change
16.05.08 07:19 Natter New Issue
16.05.08 07:19 Natter Relationship added related to 0001867
23.05.08 18:35 Natter Status new => assigned
23.05.08 18:35 Natter Assigned To  => Natter
23.05.08 18:36 Natter Note Added: 0003196
23.05.08 18:37 Natter Relationship added related to 0001881
23.05.08 23:08 Natter Note Added: 0003198
23.05.08 23:47 Natter Status assigned => resolved
23.05.08 23:47 Natter Fixed in Version  => V0.912
23.05.08 23:47 Natter Resolution open => fixed
23.05.08 23:47 Natter Note Added: 0003199
23.05.08 23:54 Natter Note Deleted: 0003198
23.05.08 23:55 Natter Status resolved => assigned
23.05.08 23:55 Natter Note Deleted: 0003199
24.05.08 00:56 Natter Status assigned => resolved
24.06.08 03:00 Gast Status resolved => closed


Mantis 1.0.7[^]
Copyright © 2000 - 2007 Mantis Group
Powered by Mantis Bugtracker