mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-13 09:39:09 +02:00
* Added generic IfThen, as proposed by Thaddy de Koning, bug id #34012
git-svn-id: trunk@39521 -
This commit is contained in:
parent
d5601e3631
commit
1e3f44965f
@ -266,6 +266,8 @@ type
|
|||||||
procedure AddTerminateProc(TermProc: TTerminateProc);
|
procedure AddTerminateProc(TermProc: TTerminateProc);
|
||||||
function CallTerminateProcs: Boolean;
|
function CallTerminateProcs: Boolean;
|
||||||
|
|
||||||
|
generic function IfThen<T>(val:boolean;const iftrue:T; const iffalse:T) :T; inline; overload;
|
||||||
|
|
||||||
|
|
||||||
Var
|
Var
|
||||||
OnShowException : Procedure (Msg : ShortString);
|
OnShowException : Procedure (Msg : ShortString);
|
||||||
|
@ -801,3 +801,14 @@ begin
|
|||||||
result:=ExecuteProcess(ToSingleByteFileSystemEncodedFileName(Path),ComLineA);
|
result:=ExecuteProcess(ToSingleByteFileSystemEncodedFileName(Path),ComLineA);
|
||||||
end;
|
end;
|
||||||
{$endif}
|
{$endif}
|
||||||
|
|
||||||
|
|
||||||
|
// generic ifthen..
|
||||||
|
|
||||||
|
generic function IfThen<T>(val:boolean;const iftrue:T; const iffalse:T) :T; inline; overload;
|
||||||
|
begin
|
||||||
|
if val then
|
||||||
|
Result := ifTrue
|
||||||
|
else
|
||||||
|
Result:=ifFalse;
|
||||||
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user