Path: csiph.com!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail From: Alexis Newsgroups: comp.lang.c Subject: Re: Loops (was Re: do { quit; } else { }) Date: Sat, 19 Apr 2025 11:01:57 +1000 Organization: A noiseless patient Spider Lines: 23 Message-ID: <87ecxp7ym2.fsf@gmail.com> References: <20250413072027.219@kylheku.com> <20250415053852.166@kylheku.com> <20250416150837.00004587@yahoo.com> MIME-Version: 1.0 Content-Type: text/plain Injection-Date: Sat, 19 Apr 2025 03:01:58 +0200 (CEST) Injection-Info: dont-email.me; posting-host="63c88ad17cc943e163fb4899f098f560"; logging-data="190984"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+ptbjtGdJ2c/kGlz2Xr2KBhj5tty0tTaw=" User-Agent: Gnus/5.13 (Gnus v5.13) Cancel-Lock: sha1:K/rIMiudS/9wSvq66OO4PIsRAaA= sha1:dqF+YrZlJAdH2S6CiJFPx+z6WvQ= Xref: csiph.com comp.lang.c:392702 bart writes: > * Awk primarily uses a C-style for loop; using 'for in' is an > alternative (it's not clear if this is specific to gnu-Awk) It's POSIX. Quoting awk(1p): | Syntax | Name | Type of Result | Associativity | | [...] | | | | | expr in array | Array membership | Numeric | Left | | ( index ) in array | Multi-dimension | Numeric | Left | | | array membership | | | [...] The delete statement shall remove an individual array element. Thus, the following code deletes an entire array: for (index in array) delete array[index] Alexis.