digi_cs
2024-10-17 04:44:41 UTC
@include github.com/digics/UID10/uid.lib
LIST = hid::get( LIST )
An array (A) in AWK can represent a list of unique items with an undefined order.
To introduce the concept of an array with a defined sequence of its indexes (items),
we need to specify this sequence in a subarray A[LIST] as a simple list.
# items of A: first, next and last:
A[ LIST ][ ] = first
[ first ] = next
[ next ] = last
[ last [ =
[ first ]...
[ next ]...
[ last ]...
Thus, instead of a for-in loop for array A, we use:
i =
while ( != i = A[ LIST][ i ] )
# process A[ i ]
or
for ( i = ; != i = A[ LIST ][ i ]; )
# process A[ i ]
At the same time, we can still work with the main array in a for-in loop with one caveat:
for ( i in A )
if ( i in HID )
continue # this is hid (LIST)
else
# process A[ i ]
--------------= Posted using GrabIt =----------------
------= Binary Usenet downloading made easy =---------
-= Get GrabIt for free from https://www.shemes.com/ =-
LIST = hid::get( LIST )
An array (A) in AWK can represent a list of unique items with an undefined order.
To introduce the concept of an array with a defined sequence of its indexes (items),
we need to specify this sequence in a subarray A[LIST] as a simple list.
# items of A: first, next and last:
A[ LIST ][ ] = first
[ first ] = next
[ next ] = last
[ last [ =
[ first ]...
[ next ]...
[ last ]...
Thus, instead of a for-in loop for array A, we use:
i =
while ( != i = A[ LIST][ i ] )
# process A[ i ]
or
for ( i = ; != i = A[ LIST ][ i ]; )
# process A[ i ]
At the same time, we can still work with the main array in a for-in loop with one caveat:
for ( i in A )
if ( i in HID )
continue # this is hid (LIST)
else
# process A[ i ]
--------------= Posted using GrabIt =----------------
------= Binary Usenet downloading made easy =---------
-= Get GrabIt for free from https://www.shemes.com/ =-