Codebase list libmawk / 30b66529-447f-407d-a34b-b48ac0e29c37/main src / example_apps / 90_custom_array / test.awk
30b66529-447f-407d-a34b-b48ac0e29c37/main

Tree @30b66529-447f-407d-a34b-b48ac0e29c37/main (Download .tar.gz)

test.awk @30b66529-447f-407d-a34b-b48ac0e29c37/mainraw · history · blame

BEGIN {
# fill in the array with "HELLO WORLD" from index 1; split() tries to fill
# the array with each word, but the virtual array set code will consider only
# the first character of each word
	split("Haha Error Light Lungs Old Water Opponent Riot Long Diode !", CARR, " ")

# use numbers to fill in some more, leaving a gap between the end of the
# last index used by split() and the first used by this call
	for(n = 14; n < 32; n++)
		CARR[n] = 65+n-14

# delete [4], which is the second "L"; deletion means setting to 0
# with this custom implementation since there is no way to really
# remove items from a static array
	delete CARR[4]
}