Jump to content

Associative array/Iteration: Difference between revisions

m
→‎{{header|FutureBasic}}: Added descriptions above options
m (→‎{{header|FutureBasic}}: More options added)
m (→‎{{header|FutureBasic}}: Added descriptions above options)
Line 1,423:
=={{header|FutureBasic}}==
There are many ways to iterate over an associative array (dictionary) in FutureBasic. Below are a selection.
 
1. for ... in ...
<syntaxhighlight lang="futurebasic">
void local fn DoIt
Line 1,438 ⟶ 1,440:
</syntaxhighlight>
 
2. Enumerator callback
<syntaxhighlight lang="futurebasic">
void local fn MyDictEnumerator( dict as CFDictionaryRef, key as CFTypeRef, obj as CFTypeRef, stp as ^BOOL, userData as ptr )
Line 1,453 ⟶ 1,456:
</syntaxhighlight>
 
3. Array of keys
<syntaxhighlight lang="futurebasic">
void local fn DoIt
Line 1,469 ⟶ 1,473:
</syntaxhighlight>
 
4. Array of values
<syntaxhighlight lang="futurebasic">
void local fn DoIt
Line 1,485 ⟶ 1,490:
</syntaxhighlight>
 
5. Key/object enumerators
<syntaxhighlight lang="futurebasic">
void local fn DoIt
408

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.