Platforms to show: All Mac Windows Linux Cross-Platform

Back to NSIndexSetMBS class.

NSIndexSetMBS.Constructor

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa MBS MacBase Plugin 9.1 ✅ Yes ❌ No ❌ No ✅ Yes All
Initializes an allocated NSIndexSet object.
Example
Var x as new NSIndexSetMBS

See also:

NSIndexSetMBS.Constructor(index as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa MBS MacBase Plugin 9.1 ✅ Yes ❌ No ❌ No ✅ Yes All
Initializes an allocated NSIndexSet object with an index.
Example
Var n as new NSIndexSetMBS(5)
MsgBox str(n.firstIndex)+" "+str(n.lastIndex)

See also:

NSIndexSetMBS.Constructor(indexes as NSIndexSetMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa MBS MacBase Plugin 9.1 ✅ Yes ❌ No ❌ No ✅ Yes All
Initializes an allocated NSIndexSet object with an index set.
Example
Var n as new NSIndexSetMBS(5)
Var x as new NSIndexSetMBS(n)
MsgBox str(x.firstIndex)

See also:

NSIndexSetMBS.Constructor(StartIndex as Integer, Length as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa MBS MacBase Plugin 9.1 ✅ Yes ❌ No ❌ No ✅ Yes All
Initializes an allocated NSIndexSet object with an index range.
Example
Var n as new NSIndexSetMBS(5,6) // 5, 6, 7, 8, 9, 10

This method raises an NSRangeException when indexRange would add an index that exceeds the maximum allowed value for unsigned integers.

See also:

NSIndexSetMBS.containsIndex(index as Integer) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa MBS MacBase Plugin 9.1 ✅ Yes ❌ No ❌ No ✅ Yes All
Indicates whether the receiver contains a specific index.
Example
Var n as new NSIndexSetMBS(5,6) // 5, 6, 7, 8, 9, 10

if n.containsIndex(6) then
MsgBox "OK"
else
MsgBox "Error."
end if

if n.containsIndex(11) then
MsgBox "Error."
else
MsgBox "OK"
end if

Returns true when the receiver contains index, false otherwise.

Some examples using this method:

NSIndexSetMBS.containsIndexes(indexes as NSIndexSetMBS) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa MBS MacBase Plugin 9.1 ✅ Yes ❌ No ❌ No ✅ Yes All
Indicates whether the receiver contains a superset of the indexes in another index set.
Example
Var n as new NSIndexSetMBS(5,6) // 5, 6, 7, 8, 9, 10
Var m as new NSIndexSetMBS(6,2)

if n.containsIndexes(m) then
MsgBox "OK"
else
MsgBox "Error."
end if

True when the receiver contains a superset of the indexes in indexSet, false otherwise.

NSIndexSetMBS.containsIndexesInRange(StartIndex as Integer, Length as Integer) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa MBS MacBase Plugin 9.1 ✅ Yes ❌ No ❌ No ✅ Yes All
Indicates whether the receiver contains the indexes represented by an index range.
Example
Var n as new NSIndexSetMBS(5,6) // 5, 6, 7, 8, 9, 10
if n.containsIndexesInRange(6,2) then
MsgBox "OK"
else
MsgBox "Error."
end if

Returns true when the receiver contains the indexes in indexRange, false otherwise.

NSIndexSetMBS.copy as NSIndexSetMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa MBS MacBase Plugin 9.6 ✅ Yes ❌ No ❌ No ✅ Yes All
Creates a copy of the Cocoa and RB object.

NSIndexSetMBS.count as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa MBS MacBase Plugin 9.1 ✅ Yes ❌ No ❌ No ✅ Yes All
Returns the number of indexes in the receiver.
Example
Var n as new NSIndexSetMBS(5,6) // 5, 6, 7, 8, 9, 10
MsgBox str(n.count) // shows 6

NSIndexSetMBS.countOfIndexesInRange(StartIndex as Integer, Length as Integer) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa MBS MacBase Plugin 9.1 ✅ Yes ❌ No ❌ No ✅ Yes All
Returns the number of indexes in the receiver that are members of a given range.
Example
Var n as new NSIndexSetMBS(5,6) // 5, 6, 7, 8, 9, 10
MsgBox str(n.countOfIndexesInRange(1,8)) // shows 4

Available in Mac OS X v10.5 and later.

The items on this page are in the following plugins: MBS MacBase Plugin.


The biggest plugin in space...