Recent

Author Topic: Set operations (Solved)  (Read 1526 times)

mijen67

  • Full Member
  • ***
  • Posts: 130
  • It's hard to beat the bandwidth of a flying DVD
Set operations (Solved)
« on: January 22, 2018, 11:22:16 pm »
Say I have a two arrays of set of integers:

Code: Pascal  [Select][+][-]
  1. type
  2.   TSomeSetVar = set of 0..255;
  3. var
  4.   Array1, Array2: array of TSomeSetVar;

Is it possible to investigate if by example Array1[4] and Array2[5] has overlapping entries? (without looping over integers 0 to 255?)
« Last Edit: January 22, 2018, 11:37:20 pm by mijen67 »

Bart

  • Hero Member
  • *****
  • Posts: 5290
    • Bart en Mariska's Webstek
Re: Set operations
« Reply #1 on: January 22, 2018, 11:27:45 pm »
Code: Pascal  [Select][+][-]
  1. if Array1[4] * [Array2[5] = [] then writeln('No overlap');
  2.  

See https://www.freepascal.org/docs-html/ref/refsu49.html.

Bart

mijen67

  • Full Member
  • ***
  • Posts: 130
  • It's hard to beat the bandwidth of a flying DVD
Re: Set operations
« Reply #2 on: January 22, 2018, 11:36:59 pm »
Code: Pascal  [Select][+][-]
  1. if Array1[4] * [Array2[5] = [] then writeln('No overlap');
  2.  

See https://www.freepascal.org/docs-html/ref/refsu49.html.

Bart

Perfect, thanks!

 

TinyPortal © 2005-2018