Set of char


(Friedrich Westermann) #1

Can’t find in in Dokumentation so:
is there a equivalent for a construct like this in island?
[‘a’…‘z’, ‘A’…‘Z’,‘0’…‘9’, ‘_’, ‘&’]


(marc hoffman) #2

i believe Char is too big (16 bit) for set.


(Friedrich Westermann) #3

Ok that’s understandable,
is there a simple way to create sequences like this?
Not a big Deal I can create a static Helperclass.
Only to know if I’m missing something here.


(marc hoffman) #4

What’s the goal for using this?


(Friedrich Westermann) #5

Porting a IFC Parser to Elements.
IFC is the Fileforrmat for BIM (https://en.wikipedia.org/wiki/Building_information_modeling)
So I have to parse IFC Textfiles they look like:

  DATA;
#1= IFCPERSON($,'Non d\X2\00E9\X0\fini',$,$,$,$,$,$);
#3= IFCORGANIZATION($,'Non d\X2\00E9\X0\fini',$,$,$);
#7= IFCPERSONANDORGANIZATION(#1,#3,$);
#10= IFCORGANIZATION('GS','GRAPHISOFT','GRAPHISOFT',$,$);
#11= IFCAPPLICATION(#10,'21.0.0','ARCHICAD-64','IFC2x3 add-on version: 3005 FRA FULL');
#12= IFCOWNERHISTORY(#7,#11,$,.ADDED.,$,$,$,1536911967);
#13= IFCSIUNIT(*,.LENGTHUNIT.,.MILLI.,.METRE.);
#14= IFCSIUNIT(*,.AREAUNIT.,$,.SQUARE_METRE.);
#15= IFCSIUNIT(*,.VOLUMEUNIT.,$,.CUBIC_METRE.);

(Carlo Kok) #6

Note that in works fine:

if c in [‘a’…‘z’, ‘0’…‘9’] then …

It’s just that you can’t define a set for it.


(Friedrich Westermann) #7

Aaaah I was looking to pass it to a function like CharInSet…

Sometimes it is too easy…
Thanks a lot