; WHILE ;--------------------------------------------------------------- ;! Start a conditional statement ;# PSEUDOVERB POPS ;----------------------------------------------------------------------- ;; Copyright (C) 1995, 2017 ;; Associated Universities, Inc. Washington DC, USA. ;; ;; This program is free software; you can redistribute it and/or ;; modify it under the terms of the GNU General Public License as ;; published by the Free Software Foundation; either version 2 of ;; the License, or (at your option) any later version. ;; ;; This program is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. ;; ;; You should have received a copy of the GNU General Public ;; License along with this program; if not, write to the Free ;; Software Foundation, Inc., 675 Massachusetts Ave, Cambridge, ;; MA 02139, USA. ;; ;; Correspondence concerning AIPS should be addressed as follows: ;; Internet email: aipsmail@nrao.edu. ;; Postal address: AIPS Project Office ;; National Radio Astronomy Observatory ;; 520 Edgemont Road ;; Charlottesville, VA 22903-2475 USA ;----------------------------------------------------------------------- ;--------------------------------------------------------------- WHILE LLLLLLLLLLLLUUUUUUUUUUUU CCCCCCCCCCCCCCCCCCCCCCCCCCCCC ---------------------------------------------------------------- WHILE Type: Pseudoverb - procedures only Use: To establish a section of code that will be repeated until a certain codition becomes false. Grammar: WHILE condition ; statement1;... ; END where condition is a logical statement, either a relation using =, <=, >=, <>, &, ! or a logical variable. The Used in procedures only. Statementi are AIPS statements. These statements may not have an omittted optional immediate numeric argument. Such statements depend on the POPS stack being empty in the absence of the argument. But the FOR loop uses the stack for the 'fini' and 'increment' values and so the stack is not empty. Thus TVON with no argument will see a non-empty stack and assume that it is getting an immediate argument from the stack. Use in this case TVON(2**(TVCHAN-1)) inside your loop. Verbs of this sort include EHEX, GROFF, GRON, HUEWEDGE, IMWEDGE, REHEX, TVOFF, TVON, TVWEDGE. Example: WHILE X <> 0; X = X - 1; PRINT X; END This example will continue to decrement and print X until X is equal to zero. ----------------------------------------------------------------