/************************************************************************
 *									*
 *		   Using the "do" Statement				*
 *		   ========================				*
 *									*
 *	  Copyright © 1993 by Mark Little, All Rights Reserved		*
 *									*
 * This source and program are provided as part of the OZAmiga Cover	*
 * Disk and may not be used in any other publication or training course *
 * without the written permission of the Author.			*
 *									*
 ************************************************************************
 *									*
 * Function								*
 * ========								*
 *									*
 * This program demonstrates how to use the "do" statement.		*
 *									*
 ************************************************************************
 *									*
 * Source File:		  UseDo.c					*
 * Source Version:	  1.0					 	*
 * Destination File:	  UseDo						*
 *									*
 * Source Computer:	  Amiga 3000					*
 * Operating System:	  AmigaDOS					*
 * O/S Version:		  2.04						*
 * Compiler:		  SAS C						*
 * Version:		  6.2						*
 * Destination Computer:  Any Amiga					*
 *									*
 ************************************************************************
 *									*
 * Revision History							*
 * ================							*
 *									*
 * 07-Mar-93								*
 * ---------								*
 *									*
 *    Original Version							*
 *									*
 ************************************************************************/

/************************************************************************
 *			INCLUDE Files					*
 ************************************************************************
 These files usually define external functions which will be called by the
 program. They can be functions supplied with the compiler, or they can
 be functions you have written. File names enclosed in angle brackets will
 be looked for along the search path, while file names enclosed in double
 quotes (") will be looked for in the current directory only.
 ************************************************************************/

#include    <stdio.h>
#include    <string.h>

/************************************************************************
 *			Definations					*
 ************************************************************************
 These lines define structures which will be used in the program.
 This allows changes to be made in many places by only changing one line.
 ************************************************************************/

/************************************************************************
 *			GLOBAL Variables				*
 ************************************************************************
 Variables defined outside of the program modules can be accessed by all
 program modules in this file and by other modules which are linked to
 this file. Variables defined inside the opening braces of a program module
 are only accessable by that module.
 ************************************************************************/


/*======================================================================*
 *			Force a Larger WorkBench Window			*
 *======================================================================*
 *** CAUTION *** This following statements are designed for the SAS C
 compiler version 6.2 and defines the type of window to be opened if this
 program is run from WorkBench instead of the CLI. To stop this from being
 compiled by other compilers, it is enclosed in a conditional clause.
 My compiler defines __SASC_60 which means this statement will be compiled
 into the program.
 You should also remember that some compilers may produce programs which
 may crah if they are run from the WorkBench when they should be run from
 the CLI - Rebuild this program and see what happens!
 *======================================================================*/

#ifdef __SASC_60
		  char	__stdiowin[] =
				"CON:0/0/640/200/Learning C - UseDo";
#endif

/*======================================================================*
 *			Program Variables				*
 *======================================================================*
 These statements tell the compiler what the names of the variables used
 in this program are. They also define what type of information is to be
 stored in the variables.
 *======================================================================*/

   int   Count;

/************************************************************************
 *			MAIN PROGRAM					*
 ************************************************************************
 The module named "main" is the starting point of execution. Your compiler
 may open resources such as DOS, EXEC and other libraries before main is
 called. Consult your compiler documentation for details of what it can
 do.
 ************************************************************************/

void main(void)
{

/*======================================================================*
 *			Use the "do" Construct to Display Numbers	*
 *======================================================================*

 *======================================================================*/

   Count = 10;
   do
   {
      printf("%d\n",Count--);
   } while (Count > 0);
}
