Ignore:
Timestamp:
Dec 17, 2009, 9:36:15 AM (14 years ago)
Author:
george
Message:
  • Přidáno: Podpora pro ukládání serverových proměnných HTTP sezení.
  • Upraveno: U funkce Explode lze nyní omezit počet výsledných částí řetězce.
Location:
branches/DirectWeb
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/DirectWeb

    • Property svn:ignore
      •  

        old new  
        33WoWHostingWebServer
        44Config.xml
         5Session
  • branches/DirectWeb/UCommon.pas

    r82 r87  
    2323function BCDToInt(Value: Byte): Byte;
    2424function CompareByteArray(Data1, Data2: TArrayOfByte): Boolean;
    25 function Explode(Separator: Char; Data: string): TArrayOfString;
     25function Explode(Separator: Char; Data: string; SlicesCount: Integer = -1): TArrayOfString;
    2626
    2727implementation
     
    110110end;
    111111
    112 function Explode(Separator: char; Data: string): TArrayOfString;
     112function Explode(Separator: char; Data: string; SlicesCount: Integer = -1): TArrayOfString;
    113113begin
    114114  SetLength(Result, 0);
    115   while Pos(Separator, Data) > 0 do begin
     115  while (Pos(Separator, Data) > 0) and
     116  ((Length(Result) < (SlicesCount - 1)) or (SlicesCount = -1)) do begin
    116117    SetLength(Result, Length(Result) + 1);
    117118    Result[High(Result)] := Copy(Data, 1, Pos(Separator, Data) - 1);
Note: See TracChangeset for help on using the changeset viewer.