Collections: Difference between revisions

no edit summary
m (syntax highlighting fixup automation)
No edit summary
Line 1,426:
1 4
</pre>
 
=={{header|FutureBasic}}==
<syntaxhighlight lang="futurebasic">
include "NSLog.incl"
 
void local fn Array
CFArrayRef array = @[@"Alpha",@"Bravo",@"Charlie",@"Delta"]
NSLog(@"Array:%@\n",array)
end fn
 
void local fn Dictionary
CFDictionaryRef dict = @{@"Key1":@"Value1",@"Key2":@"Value2",@"Key3":@"Value3"}
NSLog(@"Dictionary:%@\n",dict)
end fn
 
void local fn Set
CFSetRef set = fn SetWithArray( @[@"Echo",@"Echo",@"FutureBasic",@"Golf",@"Hotel",@"India"] )
NSLog(@"Set:%@\n",set)
end fn
 
void local fn IndexPath
long indexes(3)
indexes(0) = 1 : indexes(1) = 4 : indexes(2) = 3 : indexes(3) = 2
IndexPathRef indexPath = fn IndexPathWithIndexes( @indexes(0), 4 )
NSLog(@"IndexPath:%@\n",indexPath)
end fn
 
void local fn IndexSet
IndexSetRef indexSet = fn IndexSetWithIndexesInRange( fn CFRangeMake( 12, 5 ) )
NSLog(@"IndexSet:%@\n",indexSet)
end fn
 
void local fn CountedSet
CountedSetRef countedSet = fn CountedSetWithArray( @[@"Juliet",@"Lima",@"Mike",@"Lima",@"Kilo",@"Lima",@"Juliet",@"Mike",@"Lima"] )
NSLog(@"CountedSet:%@\n",countedSet)
end fn
 
void local fn OrderedSet
OrderedSetRef orderedSet = fn OrderedSetWithObjects( @"November", @"Oscar", @"Papa", NULL )
NSLog(@"OrderedSet:%@\n",orderedSet)
end fn
 
fn Array
fn Dictionary
fn Set
fn IndexPath
fn IndexSet
fn CountedSet
fn OrderedSet
 
HandleEvents
</syntaxhighlight>
 
{{out}}
<pre>
Array:(
Alpha,
Bravo,
Charlie,
Delta
)
 
Dictionary:{
Key1 = Value1;
Key2 = Value2;
Key3 = Value3;
}
 
Set:{(
India,
Echo,
Hotel,
FutureBasic,
Golf
)}
 
IndexPath:<NSIndexPath: 0x93855b96cef033ba> {length = 4, path = 1 - 4 - 3 - 2}
 
IndexSet:<NSIndexSet: 0x600000318cc0>[number of indexes: 5 (in 1 ranges), indexes: (12-16)]
 
CountedSet:<NSCountedSet: 0x60000031aa60> (Mike [2], Lima [4], Juliet [2], Kilo [1])
 
OrderedSet:{(
November,
Oscar,
Papa
)}
</pre
 
=={{header|Gambas}}==
408

edits