Functions

/Users/garethloy/Musimathics/Musimat1.2/MusimatTutorial/B0107.cpp File Reference

#include "MusimatTutorial.h"

Go to the source code of this file.

Functions

 MusimatTutorialSection (B0107)

Function Documentation

MusimatTutorialSection ( B0107   )

Definition at line 2 of file B0107.cpp.

                              {
        Print("*** B.1.7 Lists ***");
        /*****************************************************************************
         
         B.1.7 Lists
         
         We can group sets of variables to keep track of their relations. 
         An IntegerList represents a collection of Integer expressions, for example,
         *****************************************************************************/
        
        IntegerList iL(1, 1+1, 3, 5-1);
        
        /*****************************************************************************
         defines a list iL containing the integers 1 through 4.
         A RealList represents a collection of Real expressions:
         *****************************************************************************/
        
        RealList rL(1.1, 2.2, 3.3, 4.4);
        
        /*****************************************************************************
         We can print these lists as follows.
         *****************************************************************************/
        
        Print("iL=", iL);
        Print("rL=", rL);
        
        /*****************************************************************************
         We can obtain the length of a list of any type. For example,
         *****************************************************************************/
        
        Integer n = Length(rL);
        Print(n);
        
        /*****************************************************************************
         prints 4.
         
         The value can be seen when running this application in the console window 
         if the output of this application has not been redirected.
         
         *****************************************************************************/
}