In (keyword)

From RemObjects Software

Jump to: navigation, search

This is a Oxygene Keyword topic
Feel free to add your notes to this topic below.


The in (and not in) operator can be used to check if a given value is one of the members of a set. It returns true, if a match is found, otherwise false.

if a in [a,b,c] then .. // True
if x not in foo then... // shortcut for if not (x in foo) then

Starting with Oxygene 3.0, in can be used on sets of string constants; the compiler will create an array of String automatically:

if City in ['Berlin', 'New York'] then //...

When mixing Ints of different sizes (Say Int32 and Int64), all values will be upgraded to the largest type (for example Int64); when mixing integers and floats, all values will be converted to floats; mixing chars and strings causes the chars to be converted to strings.

For Loops

The keyword in is also used in for loops, to enumerate all the values in an enumerator.

for each el: String in mylist do
for each matching el: String in mylist do
for each el in mylist do
for el in mylist do

See Also

Product: RemObjects Oxygene (formerly known as Chrome)
Current version: 3.0 Previous Versions: 'Joyride' (2.0), 'Floorshow' (1.5), 'Adrenochrome' (1.0)

GlossaryKeywordsLanguage FeaturesPlatform FeaturesSamplesArticlesHow ToIssues

Personal tools