RosettaCodeData/Task/Collections/FutureBasic/collections.basic

49 lines
1.2 KiB
Plaintext

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