Registriert seit: 16. Jan 2004
Ort: Bendorf
5.219 Beiträge
Delphi 10.2 Tokyo Professional
|
AW: Ist Variable in (Integer-Wert, Integer-Wert) - wie umsetzen?
2. Aug 2011, 10:48
Hallo,
Vielleicht sowas:
Delphi-Quellcode:
function ValueIn(Val: Integer; Arr: Array of Integer): Boolean;
var i: Integer;
begin
Result := false;
for i:= 0 to High(Arr) do
if Arr[i] = Val then
exit(true);
end;
// Aufruf:
if ValueIn(lFehlerCode,[-99,-98]) then
ShowMessage('Doof');
Michael "Programmers talk about software development on weekends, vacations, and over meals not because they lack imagination,
but because their imagination reveals worlds that others cannot see."
|
|
Zitat
|