mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-06 05:28:07 +02:00
* Fix by Mark Paley to add IfThen for StringList and TStringDynArray. Issue #39314
This commit is contained in:
parent
c587f5a681
commit
52c8ac0ca0
@ -74,6 +74,7 @@ Function AnsiReverseString(const AText: AnsiString): AnsiString;inline;
|
||||
Function StuffString(const AText: string; AStart, ALength: Cardinal; const ASubText: string): string;
|
||||
Function RandomFrom(const AValues: array of string): string; overload;
|
||||
Function IfThen(AValue: Boolean; const ATrue: string; const AFalse: string = ''): string; overload;
|
||||
Function IfThen(AValue: Boolean; const ATrue: TStringDynArray; const AFalse: TStringDynArray = nil): TStringDynArray; overload;
|
||||
function NaturalCompareText (const S1 , S2 : string ): Integer ;
|
||||
function NaturalCompareText(const Str1, Str2: string; const ADecSeparator, AThousandSeparator: Char): Integer;
|
||||
|
||||
@ -1227,6 +1228,15 @@ begin
|
||||
result:=afalse;
|
||||
end;
|
||||
|
||||
Function IfThen(AValue: Boolean; const ATrue: TStringDynArray; const AFalse: TStringDynArray = nil): TStringDynArray; overload;
|
||||
|
||||
begin
|
||||
if avalue then
|
||||
result:=atrue
|
||||
else
|
||||
result:=afalse;
|
||||
end;
|
||||
|
||||
function NaturalCompareText(const Str1, Str2: string; const ADecSeparator, AThousandSeparator: Char): Integer;
|
||||
{
|
||||
NaturalCompareBase compares strings in a collated order and
|
||||
|
@ -2459,6 +2459,15 @@ end;
|
||||
|
||||
{ Utility routines }
|
||||
|
||||
|
||||
Function IfThen(AValue: Boolean; const ATrue: TStringList; const AFalse: TStringList = nil): TStringList; overload;
|
||||
begin
|
||||
if avalue then
|
||||
result:=atrue
|
||||
else
|
||||
result:=afalse;
|
||||
end;
|
||||
|
||||
function LineStart(Buffer, BufPos: PChar): PChar;
|
||||
|
||||
begin
|
||||
|
@ -2469,4 +2469,4 @@ function LineStart(Buffer, BufPos: PChar): PChar;
|
||||
procedure BinToHex(BinValue, HexValue: PChar; BinBufSize: Integer); deprecated 'use procedures from unit StrUtils';
|
||||
function HexToBin(HexValue, BinValue: PChar; BinBufSize: Integer): Integer;
|
||||
function ExtractStrings(Separators, WhiteSpace: TSysCharSet; Content: PChar; Strings: TStrings; AddEmptyStrings : Boolean = False): Integer;
|
||||
|
||||
Function IfThen(AValue: Boolean; const ATrue: TStringList; const AFalse: TStringList = nil): TStringList; overload;
|
||||
|
Loading…
Reference in New Issue
Block a user