//---------------------------------------------------------------------------



#include "Token.h"
using namespace std;

std::string Token::NewToken (double Wert )
{
   Length ++;
   std::string Tokenname;
   std::stringstream sstring;
   sstring << "#TOK" << Length;
   sstring >> Tokenname;
	itsTokenname.push_back (Tokenname);
   itsWert.push_back (Wert);
   return Tokenname;
}

double Token::GetToken (std::string Tokenname)
{
	int i=-1;
	try
   {
		while (1)
      {
      	i++;
   		if (itsTokenname[i] == Tokenname)
      	{
            return itsWert[i];
      	}
		}
   }
   catch (...)
   {
   	return 0.0;
   }
}

void Token::Ausgabe ()
{
   for (int i = 0; i<Length; i++)
   {
	   std::cout << "Name : " << itsTokenname[i];
      cout << "\t\tWert: " << itsWert[i] << endl;
   }
   cout << endl;
}

#pragma package(smart_init)

