a system of tags was pondered to make use of Sets;
where values would be specified in the Function, returning the Set with the required range;
Sets are restricted to 256 elements.
If you don't need to handle ranges you can use generic classes in
Generics.Collections:
THashSet<>,
TSortedSet<>,
TSortedHashSet. Also there is
TSet<,> of unit
gset. For efficient use of ranges you might want to implement your own.
You could even throw in an operator overload of
in so that it would behave a bit more like a set.
function ReturningOfSets(myNumber:System.Int64):Set Of System.Int64;
begin
case myNumber of
1: Result := [100..200];
2: Result := [1000..2000];
end;
end;
if randomNumber in [ReturningOfSets( myOtherNumber )] then
ShowMessage('The Range Was Processed, The Logic Now May Proceed;');
Please note that even if such sets would be supported this code would be wrong as the square brackets around the call to
ReturningOfSets would turn this into a set of sets so to speak (which is not allowed).