suve

awful: function: dict-nextkey

Declaration

string :dict-nextkey ( dict $DICT , string $KEY )

Summary

Returns the next (ASCII-wise) key present in the dictionary after the current KEY. An empty string should be used to find the first key. When passed the last key, returns an empty string.

Example

# Dictionary example.
:set &D :dict s'one' s'eins' s'two' s'zwei' s'three' s'drei'
:set &D[s'four'] s'vier'
:set &K :dict-nextkey &D s''
!while :neq $K s''
    :writeln $K s' == ' $D[$K]
    :set &K :dict-nextkey &D $K
    !done

wikistrona zmodyfikowana 2014/0601/2317