/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#+
#+     Mumps Bioinformatics Software Library
#+     Copyright (C) 2003 - 2025  by Kevin C. O'Kane
#+
#+     Kevin C. O'Kane
#+     kc.okane@gmail.com
#+     okane@uni.edu
#+     https://threadsafebooks.com/
#+     https://www.cs.uni.edu/~okane
#+
#+ 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
#+
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/

// April 21, 2025
// echo "y" | mumps-sql-db-create.script && mumpsc global2.cpp && global2

//--------------------------------
// To compile:
//    mumpsc global1.cpp
//
// To run:
//    global1
//--------------------------------

#include <stdio.h>
#include <stdlib.h>

#include <mumpsc/libmpscpp.h>

int	main() {

    global a("a");

    int i;

    a("").Kill();

    for (i = 0; i < 100; i++) a(i) = i;
    cout << endl;

	cout << "expect 1 " << a(22).Data() << endl;

    a("").Kill();

    for (i = 0; i < 100; i++) a(i,1) = i;
    cout << endl;

	cout << "expect 10 " << a(22).Data() << endl;

    a("").Kill();

    for (i = 0; i < 100; i++) { a(i)=i; a(i,1) = i; }
    cout << endl;

	cout << "expect 11 " << a(22).Data() << endl;

    cout << endl;

	cout << "expect 0 " <<a(222).Data() << endl;


    return 0;

    }
