Ignore:
Timestamp:
Nov 17, 2010, 7:38:07 PM (14 years ago)
Author:
george
Message:
  • Upraveno: Třída TStringListEx nahrazena specializovanou TListString.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Common/USqlDatabase.pas

    r38 r40  
    88
    99uses
    10   SysUtils, Classes, Dialogs, mysql50, TypInfo, UStringListEx,
    11   ListObject, DictionaryStringString;
     10  SysUtils, Classes, Dialogs, mysql50, TypInfo, SpecializedObjectList,
     11  SpecializedDictionary, SpecializedList;
    1212
    1313type
     
    113113end;
    114114
     115function StrToStr(Value: string): string;
     116begin
     117  Result := Value;
     118end;
     119
    115120function SQLToDateTime(Value: string): TDateTime;
    116121var
    117   Parts: TStringListEx;
    118   DateParts: TStringListEx;
    119   TimeParts: TStringListEx;
    120 begin
    121   try
    122     Parts := TStringListEx.Create;
    123     DateParts := TStringListEx.Create;
    124     TimeParts := TStringListEx.Create;
    125 
    126     Parts.Explode(' ', Value);
    127     DateParts.Explode('-', Parts[0]);
     122  Parts: TListString;
     123  DateParts: TListString;
     124  TimeParts: TListString;
     125begin
     126  try
     127    Parts := TListString.Create;
     128    DateParts := TListString.Create;
     129    TimeParts := TListString.Create;
     130
     131    Parts.Explode(Value, ' ', StrToStr);
     132    DateParts.Explode(Parts[0], '-', StrToStr);
    128133    Result := EncodeDate(StrToInt(DateParts[0]), StrToInt(DateParts[1]),
    129134      StrToInt(DateParts[2]));
    130135    if Parts.Count > 1 then begin
    131       TimeParts.Explode(':', Parts[1]);
     136      TimeParts.Explode(Parts[1], ':', StrToStr);
    132137      Result := Result + EncodeTime(StrToInt(TimeParts[0]), StrToInt(TimeParts[1]),
    133138        StrToInt(TimeParts[2]), 0);
Note: See TracChangeset for help on using the changeset viewer.