Browse Source

Projektdateien hinzufügen.

Kolja Strohm 7 years ago
parent
commit
b77866267e
55 changed files with 11008 additions and 0 deletions
  1. 3 0
      build.bat
  2. 28 0
      ksgScript.sln
  3. 1647 0
      ksgScript/Befehl/KSGSBefehl.cpp
  4. 296 0
      ksgScript/Befehl/KSGSBefehl.h
  5. 319 0
      ksgScript/Befehl/KSGSFunktion.cpp
  6. 98 0
      ksgScript/Befehl/KSGSFunktion.h
  7. 502 0
      ksgScript/Befehl/KSGSKlasse.cpp
  8. 85 0
      ksgScript/Befehl/KSGSKlasse.h
  9. 19 0
      ksgScript/Befehl/KSGSVariable.h
  10. 137 0
      ksgScript/Error/Error.cpp
  11. 32 0
      ksgScript/Error/Error.h
  12. 69 0
      ksgScript/Funktionen/KSGSRückruf.cpp
  13. 32 0
      ksgScript/Funktionen/KSGSRückruf.h
  14. 370 0
      ksgScript/Include/KSGSStandart.h
  15. 124 0
      ksgScript/Include/KSGScript.h
  16. 203 0
      ksgScript/Klassen/KSGSAnimation2D.cpp
  17. 31 0
      ksgScript/Klassen/KSGSAnimation2D.h
  18. 147 0
      ksgScript/Klassen/KSGSAnimation2DData.cpp
  19. 30 0
      ksgScript/Klassen/KSGSAnimation2DData.h
  20. 131 0
      ksgScript/Klassen/KSGSArray.cpp
  21. 30 0
      ksgScript/Klassen/KSGSArray.h
  22. 327 0
      ksgScript/Klassen/KSGSBild.cpp
  23. 31 0
      ksgScript/Klassen/KSGSBild.h
  24. 240 0
      ksgScript/Klassen/KSGSBildZ.cpp
  25. 36 0
      ksgScript/Klassen/KSGSBildZ.h
  26. 145 0
      ksgScript/Klassen/KSGSBool.cpp
  27. 28 0
      ksgScript/Klassen/KSGSBool.h
  28. 169 0
      ksgScript/Klassen/KSGSDouble.cpp
  29. 29 0
      ksgScript/Klassen/KSGSDouble.h
  30. 536 0
      ksgScript/Klassen/KSGSFenster.cpp
  31. 38 0
      ksgScript/Klassen/KSGSFenster.h
  32. 169 0
      ksgScript/Klassen/KSGSInt.cpp
  33. 29 0
      ksgScript/Klassen/KSGSInt.h
  34. 332 0
      ksgScript/Klassen/KSGSKnopf.cpp
  35. 35 0
      ksgScript/Klassen/KSGSKnopf.h
  36. 138 0
      ksgScript/Klassen/KSGSMausEreignis.cpp
  37. 31 0
      ksgScript/Klassen/KSGSMausEreignis.h
  38. 114 0
      ksgScript/Klassen/KSGSTastaturEreignis.cpp
  39. 31 0
      ksgScript/Klassen/KSGSTastaturEreignis.h
  40. 229 0
      ksgScript/Klassen/KSGSText.cpp
  41. 30 0
      ksgScript/Klassen/KSGSText.h
  42. 425 0
      ksgScript/Klassen/KSGSTextFeld.cpp
  43. 38 0
      ksgScript/Klassen/KSGSTextFeld.h
  44. 81 0
      ksgScript/Klassen/KSGSThread.cpp
  45. 26 0
      ksgScript/Klassen/KSGSThread.h
  46. 62 0
      ksgScript/Klassen/KSGSTyp.h
  47. 608 0
      ksgScript/Leser/KSGSCompile.cpp
  48. 113 0
      ksgScript/Leser/KSGSCompile.h
  49. 1441 0
      ksgScript/Leser/KSGSLeser.cpp
  50. 138 0
      ksgScript/Leser/KSGSLeser.h
  51. 31 0
      ksgScript/Main/Einstieg.cpp
  52. 497 0
      ksgScript/Main/KSGScriptObj.cpp
  53. 91 0
      ksgScript/Main/KSGScriptObj.h
  54. 233 0
      ksgScript/ksgScript.vcxproj
  55. 174 0
      ksgScript/ksgScript.vcxproj.filters

+ 3 - 0
build.bat

@@ -0,0 +1,3 @@
+"D:\Visual Studio 2017\MSBuild\15.0\Bin\MSBuild.exe" "ksgScript.sln" /p:configuration=release /p:platform=win32
+"D:\Visual Studio 2017\MSBuild\15.0\Bin\MSBuild.exe" "ksgScript.sln" /p:configuration=release /p:platform=x64
+"D:\Visual Studio 2017\MSBuild\15.0\Bin\MSBuild.exe" "ksgScript.sln" /p:configuration=debug /p:platform=x64

+ 28 - 0
ksgScript.sln

@@ -0,0 +1,28 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 14
+VisualStudioVersion = 14.0.22823.1
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ksgScript", "ksgScript\ksgScript.vcxproj", "{50E49628-0E0C-41A3-B48D-1E9EE553EC6F}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|Win32 = Debug|Win32
+		Debug|x64 = Debug|x64
+		Release|Win32 = Release|Win32
+		Release|x64 = Release|x64
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{50E49628-0E0C-41A3-B48D-1E9EE553EC6F}.Debug|Win32.ActiveCfg = Debug|Win32
+		{50E49628-0E0C-41A3-B48D-1E9EE553EC6F}.Debug|Win32.Build.0 = Debug|Win32
+		{50E49628-0E0C-41A3-B48D-1E9EE553EC6F}.Debug|x64.ActiveCfg = Debug|x64
+		{50E49628-0E0C-41A3-B48D-1E9EE553EC6F}.Debug|x64.Build.0 = Debug|x64
+		{50E49628-0E0C-41A3-B48D-1E9EE553EC6F}.Release|Win32.ActiveCfg = Release|Win32
+		{50E49628-0E0C-41A3-B48D-1E9EE553EC6F}.Release|Win32.Build.0 = Release|Win32
+		{50E49628-0E0C-41A3-B48D-1E9EE553EC6F}.Release|x64.ActiveCfg = Release|x64
+		{50E49628-0E0C-41A3-B48D-1E9EE553EC6F}.Release|x64.Build.0 = Release|x64
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal

+ 1647 - 0
ksgScript/Befehl/KSGSBefehl.cpp

@@ -0,0 +1,1647 @@
+#include "KSGSBefehl.h"
+#include "../Error/Error.h"
+#include "../Leser/KSGSLeser.h"
+#include "../Leser/KSGSCompile.h"
+#include "../Main/KSGScriptObj.h"
+#include "KSGSKlasse.h"
+#include "../Klassen/KSGSInt.h"
+#include "../Klassen/KSGSDouble.h"
+#include "../Klassen/KSGSBool.h"
+#include "../Klassen/KSGSText.h"
+#include "../Klassen/KSGSTyp.h"
+
+using namespace KSGScript;
+
+// Befehls Strukturen
+KSGSBefehlVariable::KSGSBefehlVariable( Text *txt, KSGSCompKlassTable *zKT, KSGSCompFuncTable *zFT, KSGSCompVarTable *zVT,
+										const char *klassName, const char *funktionName, int *typId, bool *ok )
+{
+	txt->setSuchGrenzen( '(', ')' );
+	removeKlammer( txt );
+	Text name = txt->getText();
+	txt->release();
+	*ok = 0;
+	if( !funktionName && !klassName )
+		return;
+	KSGSCompFuncTable *zLFT = zFT;
+	KSGSCompVarTable *zLVT = zVT;
+	if( klassName )
+	{
+		if( !zKT->hat( klassName ) )
+			return;
+		zLFT = &zKT->get( klassName )->funcs;
+		zLVT = &zKT->get( klassName )->vars;
+	}
+	if( *typId >= 0 )
+	{ // Variable gehört zu einem anderen Zeichnung
+		if( !zKT->hat( *typId ) || !zKT->get( *typId )->vars.hat( name ) )
+			return;
+		varId = zKT->get( *typId )->vars.get( name )->id;
+		varSichtbar = zKT->get( *typId )->vars.get( name )->sichtbar;
+		*typId = zKT->get( *typId )->vars.get( name )->typ;
+	}
+	else
+	{ // Variable gehört zu diesem Zeichnung
+		if( !zLFT->hat( funktionName ) )
+			return;
+		if( zLFT->get( funktionName )->vars.hat( name ) )
+		{
+			varId = zLFT->get( funktionName )->vars.get( name )->id;
+			*typId = zLFT->get( funktionName )->vars.get( name )->typ;
+			varSichtbar = zLFT->get( funktionName )->vars.get( name )->sichtbar;
+		}
+		else if( zLVT->hat( name ) )
+		{
+			varId = zLVT->get( name )->id;
+			*typId = zLVT->get( name )->typ;
+			varSichtbar = zLVT->get( name )->sichtbar;
+		}
+		else if( zVT->hat( name ) )
+		{
+			varId = zVT->get( name )->id;
+			*typId = zVT->get( name )->typ;
+			varSichtbar = zVT->get( name )->sichtbar;
+		}
+		else
+			return;
+	}
+	*ok = 1;
+}
+
+KSGSBefehlFunktion::KSGSBefehlFunktion( KSGScriptObj *zObj, Text *txt, KSGSLeseDebug *dbg, KSGSCompKlassTable *zKT, KSGSCompFuncTable *zFT, KSGSCompVarTable *zVT,
+										const char *klassName, const char *funktionName, int *typId, bool *ok )
+{
+	*ok = 0;
+	int retTyp = -1;
+	txt->setSuchGrenzen( '(', ')' );
+	removeKlammer( txt );
+	if( !txt->hat( '(' ) || ( !klassName && !funktionName ) )
+	{
+		txt->release();
+		return;
+	}
+	Text *name = txt->getTeilText( 0, txt->positionVon( '(' ) );
+	Text *parameter = txt->getTeilText( txt->positionVon( '(' ) );
+	txt->release();
+	name->setSuchGrenzen( '(', ')' );
+	removeKlammer( name );
+	parameter->setSuchGrenzen( '(', ')' );
+	removeKlammer( parameter );
+	KSGSCompFuncTable *zLFT = zFT;
+	KSGSCompVarTable *zLVT = zVT;
+	if( klassName )
+	{
+		if( !zKT->hat( klassName ) )
+		{
+			name->release();
+			parameter->release();
+			return;
+		}
+		zLFT = &zKT->get( klassName )->funcs;
+		zLVT = &zKT->get( klassName )->vars;
+	}
+	if( *typId >= 0 )
+	{ // Funktion gehört zu anderem Zeichnung
+		if( !zKT->hat( *typId ) )
+		{
+			name->release();
+			parameter->release();
+			return;
+		}
+		zLFT = &zKT->get( *typId )->funcs;
+		zLVT = &zKT->get( *typId )->vars;
+	}
+	Array< int > *paramTyps = 0;
+    bool noWarn = 0;
+	if( zLFT->hat( *name ) )
+	{
+		funcId = zLFT->get( *name )->id;
+        if( funcId == 0 && name->istGleich( "Rückruf" ) )
+            noWarn = 1;
+		funkSichtbar = zLFT->get( *name )->sichtbar;
+		paramTyps = &zLFT->get( *name )->parameterTyp;
+		retTyp = zLFT->get( *name )->typ;
+	}
+	else if( *typId < 0 && zFT->hat( *name ) )
+	{
+		funcId = zFT->get( *name )->id;
+        if( funcId == 0 && name->istGleich( "Rückruf" ) )
+            noWarn = 1;
+		funkSichtbar = zFT->get( *name )->sichtbar;
+		paramTyps = &zFT->get( *name )->parameterTyp;
+		retTyp = zFT->get( *name )->typ;
+	}
+	else
+	{
+		name->release();
+		parameter->release();
+		return;
+	} // Parameter
+	int ptAnz = paramTyps->getEintragAnzahl();
+	int pAnz = parameter->anzahlVon( ',' ) + 1;
+	if( !parameter->getLength() )
+		pAnz = 0;
+	if( ptAnz != pAnz )
+	{
+        if( !noWarn )
+            error( 14, { dbg->datei, Text() += dbg->zeile }, zObj );
+		ptAnz = ptAnz < pAnz ? pAnz : ptAnz;
+	}
+	for( int i = 0; i < ptAnz; i++ )
+	{ // für jeden Parameter
+		int beg = 0;
+		int end = parameter->getLength();
+		if( i > 0 )
+			beg = parameter->positionVon( ',', i - 1 ) + 1;
+		if( i < ptAnz - 1 )
+			end = parameter->positionVon( ',', i );
+		Text *p = parameter->getTeilText( beg, end );
+		bool b = 0;
+		int pTyp = -1;
+		KSGSBefehlParameter *param = new KSGSBefehlParameter( zObj, p, dbg, zKT, zFT, zVT, klassName, funktionName, &pTyp, &b );
+		if( !b )
+		{
+			name->release();
+			parameter->release();
+			delete param;
+			return;
+		}
+		this->parameter.add( param );
+	}
+	name->release();
+	parameter->release();
+	*typId = retTyp;
+	*ok = 1;
+}
+
+KSGSBefehlFunktion::~KSGSBefehlFunktion()
+{
+	int anz = parameter.getEintragAnzahl();
+	for( int i = 0; i < anz; i++ )
+		delete parameter.get( i );
+}
+
+KSGSBefehlMember::KSGSBefehlMember( KSGScriptObj *zObj, Text *txt, KSGSLeseDebug *dbg, KSGSCompKlassTable *zKT, KSGSCompFuncTable *zFT,
+									KSGSCompVarTable *zVT, const char *klassName, const char *funktionName, int *typId, bool *ok )
+{
+	*ok = 0;
+	bef = 0;
+	funk = 0;
+	var = 0;
+	txt->setSuchGrenzen( '(', ')' );
+	removeKlammer( txt );
+	Text abschnitt = txt->getText();
+	abschnitt.setSuchGrenzen( '(', ')' );
+	txt->release();
+	if( hatOperator( &abschnitt ) >= 0 )
+	{ // Befehl
+		typ = BEFEHL;
+		KSGSLeseBefehl *tmp = new KSGSLeseBefehl();
+		tmp->befehl = abschnitt.getText();
+		tmp->befehl.setSuchGrenzen( '(', ')' );
+		removeKlammer( &tmp->befehl );
+		tmp->debug.datei = dbg->datei.getText();
+		tmp->debug.zeile = dbg->zeile;
+		tmp->typ = 0;
+		bef = new KSGSOperatorBefehl( zObj, tmp, zKT, zFT, zVT, klassName, funktionName );
+		delete tmp;
+		if( bef->hatFehler() )
+			return;
+		*typId = bef->getReturnTyp();
+	}
+	else if( abschnitt.hat( '(' ) )
+	{ // Funktionsaufruf
+		typ = FUNKTION;
+		bool b = 0;
+		funk = new KSGSBefehlFunktion( zObj, abschnitt.getThis(), dbg, zKT, zFT, zVT, klassName, funktionName, typId, &b );
+		if( !b )
+			return;
+	}
+	else
+	{ // Variable
+		typ = VARIABLE;
+		bool b = 0;
+		var = new KSGSBefehlVariable( abschnitt.getThis(), zKT, zFT, zVT, klassName, funktionName, typId, &b );
+		if( !b )
+			return;
+	}
+	*ok = 1;
+}
+
+KSGSBefehlMember::~KSGSBefehlMember()
+{
+	if( bef )
+		bef->release();
+	delete funk;
+	delete var;
+}
+
+KSGSBefehlParameter::KSGSBefehlParameter( KSGScriptObj *zObj, Text *txt, KSGSLeseDebug *dbg, KSGSCompKlassTable *zKT, KSGSCompFuncTable *zFT,
+										  KSGSCompVarTable *zVT, const char *klassName, const char *funktionName, int *typId, bool *ok )
+{
+	*typId = -1;
+	*ok = 0;
+	int retTyp = -1;
+	Text param = txt->getText();
+	param.setSuchGrenzen( '(', ')' );
+	removeKlammer( &param );
+	txt->release();
+	if( !param.getLength() || ( !klassName && !funktionName ) )
+		return;
+	if( param.getLength() > 2 && param[ 0 ] == '0' && param[ 1 ] == 'x' )
+	{ // Hex Zahl
+		typ = WERT;
+		wert = (int)param;
+		*typId = zKT->get( "int" )->id;
+	}
+	else if( param.getLength() == 3 && param[ 0 ] == '\'' && param[ 2 ] == '\'' )
+	{ // Char
+		typ = WERT;
+		wert = (int)param[ 1 ];
+		*typId = zKT->get( "int" )->id;
+	}
+	else if( param.getLength() > 1 && param[ 0 ] == '"' && param[ param.getLength() - 1 ] == '"' )
+	{ // Text
+		typ = WERT;
+		int anz = param.getLength();
+		bool backSlash = 0;
+		for( int i = 0; i < anz; i++ )
+		{
+			if( param[ i ] == '\\' )
+			{
+				if( backSlash )
+				{
+					wert.append( '\\' );
+					backSlash = 0;
+				}
+				else
+					backSlash = 1;
+			}
+			else if( backSlash )
+			{
+				switch( param[ i ] )
+				{
+				case 'n':
+					wert.append( '\n' );
+					break;
+				case 'r':
+					wert.append( '\r' );
+					break;
+				case 't':
+					wert.append( '\t' );
+					break;
+				case '"':
+					wert.append( '"' );
+					break;
+				case '0':
+					wert.append( '\0' );
+					break;
+				case '1':
+					wert.append( '\1' );
+					break;
+				case '2':
+					wert.append( '\2' );
+					break;
+				case '3':
+					wert.append( '\3' );
+					break;
+				case '4':
+					wert.append( '\4' );
+					break;
+				case '5':
+					wert.append( '\5' );
+					break;
+				case '6':
+					wert.append( '\6' );
+					break;
+				case '7':
+					wert.append( '\7' );
+					break;
+				case '8':
+					wert.append( '\x8' );
+					break;
+				case '9':
+					wert.append( '\x9' );
+					break;
+				}
+				backSlash = 0;
+			}
+			else
+				wert.append( param[ i ] );
+		}
+		*typId = zKT->get( "Text" )->id;
+	}
+	else if( param.istGleich( "true" ) )
+	{ // True
+		typ = WERT;
+		wert = "true";
+		*typId = zKT->get( "Text" )->id;
+	}
+	else if( param.istGleich( "false" ) )
+	{ // False
+		typ = WERT;
+		wert = "false";
+		*typId = zKT->get( "Text" )->id;
+	}
+	else
+	{
+		bool num = 1;
+		bool p = 0;
+		bool m = 0;
+		for( int i = 0; i < param.getLength(); i++ )
+		{
+			num &= ( param[ i ] >= '0' && param[ i ] <= '9' ) || param[ i ] == '.' || param[ i ] == '-';
+			if( param[ i ] == '.' )
+			{
+				if( p )
+					num = 0;
+				p = 1;
+			}
+			if( param[ i ] == '-' )
+			{
+				if( m )
+					num = 0;
+				m = 1;
+			}
+		}
+		if( num )
+		{ // Zahl
+			typ = WERT;
+			if( !p )
+			{
+				wert = (int)param;
+				*typId = KSGS_INT;
+			}
+			else
+			{
+				wert = (double)param;
+				*typId = KSGS_DOUBLE;
+			}
+		}
+		else
+		{ // Objekt
+			typ = OBJEKT;
+			if( hatOperator( &param ) >= 0 )
+			{ // Befehl
+				bool b = 0;
+				KSGSBefehlMember *obj = new KSGSBefehlMember( zObj, param.getThis(), dbg, zKT, zFT, zVT, klassName, funktionName, typId, &b );
+				if( !b )
+				{
+					delete obj;
+					return;
+				}
+				objekt.add( obj );
+			}
+			else
+			{ // Zeichnung Kette
+				int abschnittAnz = param.anzahlVon( '.' ) + 1;
+				int *abschnittEnde = new int[ abschnittAnz ];
+				for( int i = 0; i < abschnittAnz - 1; i++ )
+					abschnittEnde[ i ] = param.positionVon( '.', i );
+				abschnittEnde[ abschnittAnz - 1 ] = param.getLength();
+				for( int i = 0; i < abschnittAnz; i++ )
+				{
+					int beg = 0;
+					if( i > 0 )
+						beg = abschnittEnde[ i - 1 ] + 1;
+					int end = abschnittEnde[ i ];
+					Text *abschnitt = param.getTeilText( beg, end );
+					bool b = 0;
+					KSGSBefehlMember *mem = new KSGSBefehlMember( zObj, abschnitt, dbg, zKT, zFT, zVT, klassName, funktionName, typId, &b );
+					if( !b )
+					{
+						delete mem;
+						delete[] abschnittEnde;
+						return;
+					}
+					objekt.add( mem );
+				}
+				delete[] abschnittEnde;
+			}
+		}
+	}
+	*ok = 1;
+}
+
+KSGSBefehlParameter::~KSGSBefehlParameter()
+{
+	int anz = objekt.getEintragAnzahl();
+	for( int i = 0; i < anz; i++ )
+		delete objekt.get( i );
+}
+
+KSGSBefehlErstell::KSGSBefehlErstell( KSGScriptObj *zObj, Text *txt, KSGSLeseDebug *dbg, KSGSCompKlassTable *zKT, KSGSCompFuncTable *zFT,
+									  KSGSCompVarTable *zVT, const char *klassName, const char *funktionName, bool *ok )
+{
+	param = 0;
+	konstruktor = 0;
+	*ok = 0;
+	Text text = txt->getText();
+	text.setSuchGrenzen( '(', ')' );
+	removeKlammer( &text );
+	txt->release();
+	if( !text.getLength() || ( !klassName && !funktionName ) )
+		return;
+	KSGSCompFuncTable *zLFT = zFT;
+	if( klassName )
+		zLFT = &zKT->get( klassName )->funcs;
+	Text *typ = text.getTeilText( 0, text.positionVon( ' ' ) );
+	typ->setSuchGrenzen( '(', ')' );
+	removeKlammer( typ );
+	if( !zKT->hat( (char*)*typ ) )
+	{
+		typ->release();
+		return;
+	}
+	typId = zKT->get( (char*)*typ )->id;
+	char endC = 0;
+	if( text.hat( '(' ) )
+	{
+		endC = '(';
+		Text *name = text.getTeilText( text.positionVon( ' ' ) + 1, text.positionVon( '(' ) );
+		konstruktor = 1;
+		Text befehl = name->getText();
+		name->release();
+		befehl += ".";
+		befehl += typ->getText();
+		befehl += &text[ text.positionVon( '(' ) ];
+		bool b = 0;
+		int pTyp = -1;
+		param = new KSGSBefehlParameter( zObj, befehl.getThis(), dbg, zKT, zFT, zVT, klassName, funktionName, &pTyp, &b );
+		if( !b )
+		{
+			typ->release();
+			return;
+		}
+	}
+	else if( text.hat( '=' ) )
+	{
+		endC = '=';
+		konstruktor = 0;
+		Text *p = text.getTeilText( text.positionVon( '=' ) + 1 );
+		p->setSuchGrenzen( '(', ')' );
+		removeKlammer( p );
+		bool b = 0;
+		int pTyp = -1;
+		param = new KSGSBefehlParameter( zObj, p, dbg, zKT, zFT, zVT, klassName, funktionName, &pTyp, &b );
+		if( !b )
+		{
+			typ->release();
+			return;
+		}
+	}
+	typ->release();
+	Text *name = text.getTeilText( text.positionVon( ' ' ) + 1, endC ? text.positionVon( endC ) : text.getLength() );
+	name->setSuchGrenzen( '(', ')' );
+	removeKlammer( name );
+	if( zLFT->get( funktionName )->vars.hat( *name ) )
+	{
+		name->release();
+		return;
+	}
+	zLFT->get( funktionName )->vars.addVariable( *name, new KSGSCompileVariable( typId, 3 ) );
+	id = zLFT->get( funktionName )->vars.get( *name )->id;
+	name->release();
+	*ok = 1;
+}
+
+KSGSBefehlErstell::~KSGSBefehlErstell()
+{
+	delete param;
+}
+
+
+// Inhalt der KSGSBefehl Klasse aus KSGSBefehl.h
+// Konstruktor
+KSGSBefehl::KSGSBefehl( Typ typ )
+{
+	this->typ = typ;
+	fehler = 0;
+	returnTyp = -1;
+	ref = 1;
+}
+
+// Destruktor
+KSGSBefehl::~KSGSBefehl()
+{
+
+}
+
+// constant
+KSGSVariable *KSGSBefehl::ausführen( KSGScriptObj *zObj, KSGSFunktionInstanz *zFI, KSGSKlasseInstanz *zKI ) const
+{
+	return 0;
+}
+
+bool KSGSBefehl::hatFehler() const
+{
+	return fehler;
+}
+
+int KSGSBefehl::getReturnTyp() const
+{
+	return returnTyp;
+}
+
+bool KSGSBefehl::istTyp( Typ t ) const
+{
+	return typ == t;
+}
+
+// Reference Counting
+KSGSBefehl *KSGSBefehl::getThis()
+{
+	ref++;
+	return this;
+}
+
+KSGSBefehl *KSGSBefehl::release()
+{
+	ref--;
+	if( !ref )
+		delete this;
+	return 0;
+}
+
+// static
+KSGSVariable *KSGSBefehl::prozessVariable( KSGSVariable *zVorObj, KSGSBefehlVariable *zVar, KSGScriptObj *zObj, KSGSFunktionInstanz *zFI, KSGSKlasseInstanz *zKI )
+{
+	if( !zVar )
+	{
+		error( 22, {}, zObj );
+		return 0;
+	}
+	switch( zVar->varSichtbar )
+	{
+	case 0: // public
+		if( !zVorObj )
+			return zObj->getVariable( zVar->varId );
+		break;
+	case 1: // public in Klasse
+		if( zVorObj )
+			return zVorObj->getVariable( zVar->varId, 0 );
+		else if( zKI )
+			return zKI->getVariable( zVar->varId, 1 );
+		break;
+	case 2: // privat in Klasse
+		if( zKI && !zVorObj )
+			return zKI->getVariable( zVar->varId, 1 );
+		break;
+	case 3: // lokal in Funktion
+		if( !zVorObj && zFI )
+			return zFI->getVariable( zVar->varId );
+		break;
+	}
+	error( 22, {}, zObj );
+	return 0;
+}
+
+KSGSVariable *KSGSBefehl::prozessFunktion( KSGSVariable *zVorObj, KSGSBefehlFunktion *zFunk, KSGScriptObj *zObj, KSGSFunktionInstanz *zFI, KSGSKlasseInstanz *zKI )
+{
+	if( !zFunk )
+	{
+		error( 22, {}, zObj );
+		return 0;
+	}
+	RCArray< KSGSVariable > *parameter = new RCArray< KSGSVariable >();
+	int pAnz = zFunk->parameter.getEintragAnzahl();
+	for( int i = 0; i < pAnz; i++ )
+		parameter->set( prozessParameter( zFunk->parameter.get( i ), zObj, zFI, zKI ), i );
+	switch( zFunk->funkSichtbar )
+	{
+	case 0: // public
+		if( !zVorObj )
+			return zObj->startFunktion( zFunk->funcId, parameter );
+		break;
+	case 1: // public in Klasse
+		if( zVorObj )
+			return zVorObj->startFunktion( zFunk->funcId, 0, parameter );
+		else if( zKI )
+			return zKI->startFunktion( zFunk->funcId, 1, parameter );
+		break;
+	case 2: // privat in Klasse
+		if( zKI && !zVorObj )
+			return zKI->startFunktion( zFunk->funcId, 1, parameter );
+		break;
+	}
+	parameter->release();
+	error( 22, {}, zObj );
+	return 0;
+}
+
+KSGSVariable *KSGSBefehl::prozessMember( KSGSVariable *zVorObj, KSGSBefehlMember *zMem, KSGScriptObj *zObj, KSGSFunktionInstanz *zFI, KSGSKlasseInstanz *zKI )
+{
+	if( !zMem )
+	{
+		error( 22, {}, zObj );
+		return 0;
+	}
+	switch( zMem->typ )
+	{
+	case KSGSBefehlMember::BEFEHL:
+		if( !zVorObj && zMem->bef )
+			return zMem->bef->ausführen( zObj, zFI, zKI );
+		break;
+	case KSGSBefehlMember::FUNKTION:
+		if( zMem->funk )
+			return prozessFunktion( zVorObj, zMem->funk, zObj, zFI, zKI );
+		break;
+	case KSGSBefehlMember::VARIABLE:
+		if( zMem->var )
+			return prozessVariable( zVorObj, zMem->var, zObj, zFI, zKI );
+		break;
+	}
+	error( 22, {}, zObj );
+	return 0;
+}
+
+KSGSVariable *KSGSBefehl::prozessParameter( KSGSBefehlParameter *zParam, KSGScriptObj *zObj, KSGSFunktionInstanz *zFI, KSGSKlasseInstanz *zKI )
+{
+	if( !zParam )
+	{
+		error( 22, {}, zObj );
+		return 0;
+	}
+	switch( zParam->typ )
+	{
+	case KSGSBefehlParameter::WERT:
+		if( zParam->wert.getLength() )
+		{
+			if( !zParam->wert.positionVon( "0x" ) )
+				return new KSGSIntKlasse( zObj, zParam->wert );
+			if( zParam->wert.istGleich( "true" ) )
+				return new KSGSBoolKlasse( zObj, 1 );
+			if( zParam->wert.istGleich( "false" ) )
+				return new KSGSBoolKlasse( zObj, 0 );
+			int anz = zParam->wert.getLength();
+			bool p = 0;
+			bool num = 1;
+			bool m = 0;
+			for( int i = 0; i < anz; i++ )
+			{
+				num &= ( zParam->wert[ i ] >= '0' && zParam->wert[ i ] <= '9' ) || zParam->wert[ i ] == '.' || zParam->wert[ i ] == '-';
+				if( zParam->wert[ i ] == '.' )
+				{
+					if( p )
+						num = 0;
+					p = 1;
+				}
+				if( zParam->wert[ i ] == '-' )
+				{
+					if( m )
+						num = 0;
+					m = 1;
+				}
+			}
+			if( num )
+			{
+				if( p )
+					return new KSGSDoubleKlasse( zObj, zParam->wert );
+				else
+					return new KSGSIntKlasse( zObj, zParam->wert );
+			}
+			if( !zParam->wert.positionVon( '"' ) && zParam->wert.positionVon( '"', zParam->wert.anzahlVon( '"' ) - 1 ) == anz - 1 )
+			{
+				Text *txt = zParam->wert.getTeilText( 1, anz - 1 );
+				KSGSVariable *ret = new KSGSTextKlasse( zObj, *txt );
+				txt->release();
+				return ret;
+			}
+			if( anz == 3 && zParam->wert[ 0 ] == '\'' && zParam->wert[ 2 ] == '\'' )
+				return new KSGSIntKlasse( zObj, zParam->wert[ 1 ] );
+		}
+		break;
+	case KSGSBefehlParameter::OBJEKT:
+		if( zParam->objekt.getEintragAnzahl() )
+		{
+			KSGSVariable *v = 0;
+			int anz = zParam->objekt.getEintragAnzahl();
+			for( int i = 0; i < anz; i++ )
+			{
+				KSGSVariable *tmp = prozessMember( v, zParam->objekt.get( i ), zObj, zFI, zKI );
+				if( v )
+					v->release();
+				v = tmp;
+			}
+			return v;
+		}
+		break;
+	}
+	error( 22, {}, zObj );
+	return 0;
+}
+
+KSGSVariable *KSGSBefehl::prozessErstell( KSGSBefehlErstell *zErst, KSGScriptObj *zObj, KSGSFunktionInstanz *zFI, KSGSKlasseInstanz *zKI )
+{
+	if( !zErst )
+	{
+		error( 22, {}, zObj );
+		return 0;
+	}
+	KSGSVariable *ret = 0;
+	if( zErst->param )
+		ret = prozessParameter( zErst->param, zObj, zFI, zKI );
+	if( !ret )
+	{
+		KSGSVariableDef def = { zErst->typId, zErst->id, 3, "" };
+		ret = KSGSVariable::erstellVariable( zObj, &def );
+	}
+	if( !ret )
+	{
+		error( 22, {}, zObj );
+		return 0;
+	}
+	if( ret->getTyp() != zErst->typId )
+	{
+		KSGSVariable *tmp = ret->umwandelnIn( zErst->typId );
+		ret->release();
+		ret = tmp;
+	}
+	zFI->setVariable( zErst->id, ret->getThis() );
+	return ret;
+}
+
+
+// Inhalt der KSGSCallBefehl Klasse aus KSGSBefehl.h
+// Konstruktor
+KSGSCallBefehl::KSGSCallBefehl( KSGScriptObj *zObj, KSGSLeseBefehl *bef, KSGSCompKlassTable *zKT, KSGSCompFuncTable *zFT,
+								KSGSCompVarTable *zVT, const char *klassName, const char *funktionName )
+	: KSGSBefehl( Typ::CALL )
+{
+	removeKlammer( &bef->befehl );
+	int abschnittAnz = bef->befehl.anzahlVon( '.' ) + 1;
+	int *abschnittEnde = new int[ abschnittAnz ];
+	for( int i = 0; i < abschnittAnz - 1; i++ )
+		abschnittEnde[ i ] = bef->befehl.positionVon( '.', i );
+	abschnittEnde[ abschnittAnz - 1 ] = bef->befehl.getLength();
+	int vTyp = -1;
+	for( int i = 0; i < abschnittAnz; i++ )
+	{
+		int beg = 0;
+		if( i > 0 )
+			beg = abschnittEnde[ i - 1 ] + 1;
+		int end = abschnittEnde[ i ];
+		Text *abschnitt = bef->befehl.getTeilText( beg, end );
+		bool b = 0;
+		KSGSBefehlMember *mem = new KSGSBefehlMember( zObj, abschnitt->getThis(), &bef->debug, zKT, zFT, zVT, klassName, funktionName, &vTyp, &b );
+		if( !b )
+		{
+			error( 13, { bef->debug.datei, Text() += bef->debug.zeile, *abschnitt }, zObj );
+			abschnitt->release();
+			delete mem;
+			delete[] abschnittEnde;
+			fehler = 1;
+			return;
+		}
+		abschnitt->release();
+		objekt.add( mem );
+	}
+	delete[] abschnittEnde;
+	returnTyp = vTyp;
+}
+
+// Destruktor
+KSGSCallBefehl::~KSGSCallBefehl()
+{
+	int anz = objekt.getEintragAnzahl();
+	for( int i = 0; i < anz; i++ )
+		delete objekt.get( i );
+}
+
+// constant
+KSGSVariable *KSGSCallBefehl::ausführen( KSGScriptObj *zObj, KSGSFunktionInstanz *zFI, KSGSKlasseInstanz *zKI ) const
+{
+	KSGSVariable *v = 0;
+	int anz = objekt.getEintragAnzahl();
+	for( int i = 0; i < anz; i++ )
+	{
+		KSGSVariable *tmp = prozessMember( v, objekt.get( i ), zObj, zFI, zKI );
+		if( v )
+			v = v->release();
+		v = tmp;
+	}
+	return v;
+}
+
+// Reference Counting
+KSGSBefehl *KSGSCallBefehl::release()
+{
+	ref--;
+	if( !ref )
+		delete this;
+	return 0;
+}
+
+
+// Inhalt der KSGSOperatorBefehl Klasse aus KSGSBefehl.h
+// Konstruktor
+KSGSOperatorBefehl::KSGSOperatorBefehl( KSGScriptObj *zObj, KSGSLeseBefehl *bef, KSGSCompKlassTable *zKT, KSGSCompFuncTable *zFT,
+										KSGSCompVarTable *zVT, const char *klassName, const char *funktionName )
+	: KSGSBefehl( Typ::OPERATOR )
+{
+	paramL = 0;
+	paramR = 0;
+	removeKlammer( &bef->befehl );
+	operatorId = hatOperator( &bef->befehl );
+	if( operatorId < 0 )
+	{
+		error( 13, { bef->debug.datei, Text() += bef->debug.zeile, bef->befehl }, zObj );
+		fehler = 1;
+		return;
+	}
+	int opLän = 0;
+	int opPos = getOperatorPos( &bef->befehl, &opLän );
+	Text *links = bef->befehl.getTeilText( 0, opPos );
+	bool b = 0;
+	paramL = new KSGSBefehlParameter( zObj, links, &bef->debug, zKT, zFT, zVT, klassName, funktionName, &returnTyp, &b );
+	if( !b )
+	{
+		error( 13, { bef->debug.datei, Text() += bef->debug.zeile, bef->befehl }, zObj );
+		fehler = 1;
+		return;
+	}
+	Text *rechts = bef->befehl.getTeilText( opPos + opLän );
+	b = 0;
+	int rTyp = -1;
+	paramR = new KSGSBefehlParameter( zObj, rechts, &bef->debug, zKT, zFT, zVT, klassName, funktionName, &rTyp, &b );
+	if( !b )
+	{
+		error( 13, { bef->debug.datei, Text() += bef->debug.zeile, bef->befehl }, zObj );
+		fehler = 1;
+		return;
+	}
+	if( operatorId >= 7 && operatorId <= 14 )
+		returnTyp = zKT->get( "bool" )->id;
+}
+
+// Destruktor
+KSGSOperatorBefehl::~KSGSOperatorBefehl()
+{
+	delete paramL;
+	delete paramR;
+}
+
+// constant
+KSGSVariable *KSGSOperatorBefehl::ausführen( KSGScriptObj *zObj, KSGSFunktionInstanz *zFI, KSGSKlasseInstanz *zKI ) const
+{
+	KSGSVariable *l = prozessParameter( paramL, zObj, zFI, zKI );
+	if( operatorId == KSGS_O_SET && ( l ? l->getTyp() > KSGS_TYP_MAX : 1 ) )
+	{
+		if( l )
+			l->release();
+		if( !paramL || !paramR )
+		{
+			error( 22, {}, zObj );
+			return 0;
+		}
+		KSGSVariable *lVObj = 0;
+		int vId = 0;
+		int vS = 0;
+		switch( paramL->typ )
+		{
+		case KSGSBefehlParameter::WERT:
+			error( 22, {}, zObj );
+			return 0;
+		case KSGSBefehlParameter::OBJEKT:
+			if( paramL->objekt.getEintragAnzahl() )
+			{
+				KSGSVariable *v = 0;
+				int anz = paramL->objekt.getEintragAnzahl();
+				for( int i = 0; i < anz; i++ )
+				{
+					if( lVObj )
+						lVObj->release();
+					lVObj = v ? v->getThis() : 0;
+					KSGSVariable *tmp = 0;
+					switch( paramL->objekt.get( i )->typ )
+					{
+					case KSGSBefehlMember::BEFEHL:
+						if( i == anz - 1 )
+						{
+							error( 22, {}, zObj );
+							if( v )
+								v->release();
+							if( lVObj )
+								lVObj->release();
+							return 0;
+						}
+						if( !v && paramL->objekt.get( i )->bef )
+							tmp = paramL->objekt.get( i )->bef->ausführen( zObj, zFI, zKI );
+						break;
+					case KSGSBefehlMember::FUNKTION:
+						if( i == anz - 1 )
+						{
+							error( 22, {}, zObj );
+							if( v )
+								v->release();
+							if( lVObj )
+								lVObj->release();
+							return 0;
+						}
+						if( paramL->objekt.get( i )->funk )
+							tmp = prozessFunktion( v, paramL->objekt.get( i )->funk, zObj, zFI, zKI );
+						break;
+					case KSGSBefehlMember::VARIABLE:
+						vId = paramL->objekt.get( i )->var->varId;
+						vS = paramL->objekt.get( i )->var->varSichtbar;
+						if( paramL->objekt.get( i )->var )
+							tmp = prozessVariable( v, paramL->objekt.get( i )->var, zObj, zFI, zKI );
+						break;
+					}
+					if( v )
+						v->release();
+					v = tmp;
+				}
+				if( v )
+					v->release();
+			}
+			break;
+		default:
+			error( 22, {}, zObj );
+			return 0;
+		}
+		KSGSVariable *r = paramR ? prozessParameter( paramR, zObj, zFI, zKI ) : 0;
+		if( !r )
+		{
+			if( lVObj )
+			    lVObj->release();
+			error( 22, {}, zObj );
+			return 0;
+		}
+		if( vS == 3 ) // Funktionsvariable
+		{
+			if( lVObj )
+				lVObj->release();
+			zFI->setVariable( vId, r->getThis() );
+			return r;
+		}
+		else if( !vS ) // Scriptvariable
+		{
+			if( lVObj )
+				lVObj->release();
+			zObj->setVariable( vId, r->getThis() );
+			return r;
+		}
+		else // Klassenvariable
+		{
+			if( !lVObj )
+			{
+				zKI->setVariable( vId, r->getThis() );
+				return r;
+			}
+			lVObj->setVariable( vId, r->getThis() );
+			if( lVObj )
+				lVObj->release();
+			return r;
+		}
+	}
+	if( !l )
+		return 0;
+	KSGSVariable *r = paramR ? prozessParameter( paramR, zObj, zFI, zKI ) : 0;
+	KSGSVariable *ret = l->doOperator( operatorId, r );
+	if( l )
+		l->release();
+	return ret;
+}
+
+// Reference Counting
+KSGSBefehl *KSGSOperatorBefehl::release()
+{
+	ref--;
+	if( !ref )
+		delete this;
+	return 0;
+}
+
+
+// Inhalt der KSGSIfBefehl Klasse aus KSGSBefehl.h
+// Konstruktor
+KSGSIfBefehl::KSGSIfBefehl( KSGScriptObj *zObj, KSGSLeseBefehl *bef, KSGSCompKlassTable *zKT, KSGSCompFuncTable *zFT,
+							KSGSCompVarTable *zVT, const char *klassName, const char *funktionName )
+	: KSGSBefehl( Typ::IF )
+{
+	bedingung = 0;
+	int bTyp = -1;
+	bool b = 0;
+	bedingung = new KSGSBefehlParameter( zObj, bef->befehl.getThis(), &bef->debug, zKT, zFT, zVT, klassName, funktionName, &bTyp, &b );
+	int anz = bef->listA.getEintragAnzahl();
+	for( int i = 0; i < anz; i++ )
+	{
+		KSGSLeseBefehl *b = bef->listA.get( i );
+		KSGSBefehl *ret = 0;
+		switch( b->typ )
+		{
+		case 0: // call oder operator
+			if( 1 )
+			{
+				removeKlammer( &b->befehl );
+				b->befehl.setSuchGrenzen( '(', ')' );
+				if( hatOperator( &b->befehl ) >= 0 )
+					ret = new KSGSOperatorBefehl( zObj, b, zKT, zFT, zVT, klassName, funktionName );
+				else
+					ret = new KSGSCallBefehl( zObj, b, zKT, zFT, zVT, klassName, funktionName );
+			}
+			break;
+		case 3: // var
+			ret = new KSGSVariableBefehl( zObj, b, zKT, zFT, zVT, klassName, funktionName );
+			break;
+		case 6: // if
+			ret = new KSGSIfBefehl( zObj, b, zKT, zFT, zVT, klassName, funktionName );
+			break;
+		case 7: // for
+			ret = new KSGSForBefehl( zObj, b, zKT, zFT, zVT, klassName, funktionName );
+			break;
+		case 8: // while
+			ret = new KSGSWhileBefehl( zObj, b, zKT, zFT, zVT, klassName, funktionName );
+			break;
+		case 9: // return
+			ret = new KSGSReturnBefehl( zObj, b, zKT, zFT, zVT, klassName, funktionName );
+			break;
+		case 10: // break
+			ret = new KSGSBreakBefehl( b, zKT, zFT, zVT, klassName, funktionName );
+			break;
+		case 11: // continue
+			ret = new KSGSContinueBefehl( b, zKT, zFT, zVT, klassName, funktionName );
+			break;
+		}
+		if( !ret )
+			error( 13, { b->debug.datei, Text() += b->debug.zeile, b->befehl }, zObj );
+		if( ret && ret->hatFehler() )
+			ret = ret->release();
+		if( !ret )
+		{
+			fehler = 1;
+			return;
+		}
+		bTrue.add( ret );
+	}
+	anz = bef->listB.getEintragAnzahl();
+	for( int i = 0; i < anz; i++ )
+	{
+		KSGSLeseBefehl *b = bef->listB.get( i );
+		KSGSBefehl *ret = 0;
+		switch( b->typ )
+		{
+		case 0: // call oder operator
+			if( 1 )
+			{
+				removeKlammer( &b->befehl );
+				b->befehl.setSuchGrenzen( '(', ')' );
+				if( hatOperator( &b->befehl ) >= 0 )
+					ret = new KSGSOperatorBefehl( zObj, b, zKT, zFT, zVT, klassName, funktionName );
+				else
+					ret = new KSGSCallBefehl( zObj, b, zKT, zFT, zVT, klassName, funktionName );
+			}
+			break;
+		case 3: // var
+			ret = new KSGSVariableBefehl( zObj, b, zKT, zFT, zVT, klassName, funktionName );
+			break;
+		case 6: // if
+			ret = new KSGSIfBefehl( zObj, b, zKT, zFT, zVT, klassName, funktionName );
+			break;
+		case 7: // for
+			ret = new KSGSForBefehl( zObj, b, zKT, zFT, zVT, klassName, funktionName );
+			break;
+		case 8: // while
+			ret = new KSGSWhileBefehl( zObj, b, zKT, zFT, zVT, klassName, funktionName );
+			break;
+		case 9: // return
+			ret = new KSGSReturnBefehl( zObj, b, zKT, zFT, zVT, klassName, funktionName );
+			break;
+		case 10: // break
+			ret = new KSGSBreakBefehl( b, zKT, zFT, zVT, klassName, funktionName );
+			break;
+		case 11: // continue
+			ret = new KSGSContinueBefehl( b, zKT, zFT, zVT, klassName, funktionName );
+			break;
+		}
+		if( !ret )
+			error( 13, { b->debug.datei, Text() += b->debug.zeile, b->befehl }, zObj );
+		if( ret && ret->hatFehler() )
+			ret = ret->release();
+		if( !ret )
+		{
+			fehler = 1;
+			return;
+		}
+		bFalse.add( ret );
+	}
+}
+
+// Destruktor
+KSGSIfBefehl::~KSGSIfBefehl()
+{
+	delete bedingung;
+}
+
+// constant
+KSGSVariable *KSGSIfBefehl::ausführen( KSGScriptObj *zObj, KSGSFunktionInstanz *zFI, KSGSKlasseInstanz *zKI ) const
+{
+	KSGSVariable *b = prozessParameter( bedingung, zObj, zFI, zKI );
+	if( !b )
+		return 0;
+	if( b->getBool() )
+	{
+		int anz = bTrue.getEintragAnzahl();
+		for( int i = 0; i < anz; i++ )
+		{
+			while( zFI->getStatus() == 1 ) // pause
+				Sleep( 100 );
+			if( !zFI->getStatus() ) // return
+				break;
+			KSGSVariable *v = bTrue.z( i )->ausführen( zObj, zFI, zKI );
+			if( v )
+				v->release();
+		}
+	}
+	else
+	{
+		int anz = bFalse.getEintragAnzahl();
+		for( int i = 0; i < anz; i++ )
+		{
+			while( zFI->getStatus() == 1 ) // pause
+				Sleep( 100 );
+			if( !zFI->getStatus() ) // return
+				break;
+			KSGSVariable *v = bFalse.z( i )->ausführen( zObj, zFI, zKI );
+			if( v )
+				v->release();
+		}
+	}
+	b->release();
+	return 0;
+}
+
+// Reference Counting
+KSGSBefehl *KSGSIfBefehl::release()
+{
+	ref--;
+	if( !ref )
+		delete this;
+	return 0;
+}
+
+
+// Inhalt der KSGSForBefehl Klasse aus KSGSBefehl.h
+// Konstruktor
+KSGSForBefehl::KSGSForBefehl( KSGScriptObj *zObj, KSGSLeseBefehl *bef, KSGSCompKlassTable *zKT, KSGSCompFuncTable *zFT,
+							  KSGSCompVarTable *zVT, const char *klassName, const char *funktionName )
+	: KSGSBefehl( Typ::FOR )
+{
+	links = 0;
+	rechts = 0;
+	bedingung = 0;
+	Text klammer = bef->befehl.getText();
+	klammer.setSuchGrenzen( '(', ')' );
+	removeKlammer( &klammer );
+	if( klammer.anzahlVon( ';' ) != 2 )
+	{
+		error( 13, { bef->debug.datei, Text() += bef->debug.zeile, klammer }, zObj );
+		fehler = 1;
+		return;
+	}
+	Text *l = klammer.getTeilText( 0, klammer.positionVon( ';' ) );
+	l->setSuchGrenzen( '(', ')' );
+	removeKlammer( l );
+	KSGSLeseBefehl *b = new KSGSLeseBefehl();
+	b->debug.datei = bef->debug.datei.getText();
+	b->debug.zeile = bef->debug.zeile;
+	b->befehl = l->getText();
+	l->release();
+	if( !b->befehl.positionVon( "var" ) )
+		links = new KSGSVariableBefehl( zObj, b, zKT, zFT, zVT, klassName, funktionName );
+	else if( hatOperator( &b->befehl ) >= 0 )
+		links = new KSGSOperatorBefehl( zObj, b, zKT, zFT, zVT, klassName, funktionName );
+	else if( b->befehl.getLength() )
+		links = new KSGSCallBefehl( zObj, b, zKT, zFT, zVT, klassName, funktionName );
+	delete b;
+	if( links && links->hatFehler() )
+	{
+		fehler = 1;
+		return;
+	}
+	Text *bed = klammer.getTeilText( klammer.positionVon( ';' ) + 1, klammer.positionVon( ';', 1 ) );
+	bed->setSuchGrenzen( '(', ')' );
+	removeKlammer( bed );
+	if( bed->getLength() )
+	{
+		int bTyp = -1;
+		bool b = 0;
+		bedingung = new KSGSBefehlParameter( zObj, bed, &bef->debug, zKT, zFT, zVT, klassName, funktionName, &bTyp, &b );
+		if( !b )
+		{
+			error( 13, { bef->debug.datei, Text() += bef->debug.zeile, klammer }, zObj );
+			fehler = 1;
+			return;
+		}
+	}
+	else
+		bed->release();
+	Text *r = klammer.getTeilText( klammer.positionVon( ';', 1 ) + 1 );
+	r->setSuchGrenzen( '(', ')' );
+	removeKlammer( r );
+	b = new KSGSLeseBefehl();
+	b->debug.datei = bef->debug.datei.getText();
+	b->debug.zeile = bef->debug.zeile;
+	b->befehl = r->getText();
+	r->release();
+	if( hatOperator( &b->befehl ) >= 0 )
+		rechts = new KSGSOperatorBefehl( zObj, b, zKT, zFT, zVT, klassName, funktionName );
+	else if( b->befehl.getLength() )
+		rechts = new KSGSCallBefehl( zObj, b, zKT, zFT, zVT, klassName, funktionName );
+	delete b;
+	if( rechts && rechts->hatFehler() )
+	{
+		fehler = 1;
+		return;
+	}
+	int anz = bef->listA.getEintragAnzahl();
+	for( int i = 0; i < anz; i++ )
+	{
+		KSGSLeseBefehl *b = bef->listA.get( i );
+		KSGSBefehl *ret = 0;
+		switch( b->typ )
+		{
+		case 0: // call oder operator
+			if( 1 )
+			{
+				removeKlammer( &b->befehl );
+				b->befehl.setSuchGrenzen( '(', ')' );
+				if( hatOperator( &b->befehl ) >= 0 )
+					ret = new KSGSOperatorBefehl( zObj, b, zKT, zFT, zVT, klassName, funktionName );
+				else
+					ret = new KSGSCallBefehl( zObj, b, zKT, zFT, zVT, klassName, funktionName );
+			}
+			break;
+		case 3: // var
+			ret = new KSGSVariableBefehl( zObj, b, zKT, zFT, zVT, klassName, funktionName );
+			break;
+		case 6: // if
+			ret = new KSGSIfBefehl( zObj, b, zKT, zFT, zVT, klassName, funktionName );
+			break;
+		case 7: // for
+			ret = new KSGSForBefehl( zObj, b, zKT, zFT, zVT, klassName, funktionName );
+			break;
+		case 8: // while
+			ret = new KSGSWhileBefehl( zObj, b, zKT, zFT, zVT, klassName, funktionName );
+			break;
+		case 9: // return
+			ret = new KSGSReturnBefehl( zObj, b, zKT, zFT, zVT, klassName, funktionName );
+			break;
+		case 10: // break
+			ret = new KSGSBreakBefehl( b, zKT, zFT, zVT, klassName, funktionName );
+			break;
+		case 11: // continue
+			ret = new KSGSContinueBefehl( b, zKT, zFT, zVT, klassName, funktionName );
+			break;
+		}
+		if( !ret )
+			error( 13, { b->debug.datei, Text() += b->debug.zeile, b->befehl }, zObj );
+		if( ret && ret->hatFehler() )
+			ret = ret->release();
+		if( !ret )
+		{
+			fehler = 1;
+			return;
+		}
+		schleife.add( ret );
+	}
+}
+
+// Destruktor
+KSGSForBefehl::~KSGSForBefehl()
+{
+	if( links )
+		links->release();
+	if( rechts )
+		rechts->release();
+	delete bedingung;
+}
+
+// constant
+KSGSVariable *KSGSForBefehl::ausführen( KSGScriptObj *zObj, KSGSFunktionInstanz *zFI, KSGSKlasseInstanz *zKI ) const
+{
+	KSGSVariable *l = links ? links->ausführen( zObj, zFI, zKI ) : 0;
+	if( l )
+		l->release();
+	KSGSVariable *b = prozessParameter( bedingung, zObj, zFI, zKI );
+	if( !b )
+		return 0;
+	int anz = schleife.getEintragAnzahl();
+	while( b->getBool() )
+	{
+		for( int i = 0; i < anz; i++ )
+		{
+			while( zFI->getStatus() == 1 ) // pause
+				Sleep( 100 );
+			if( !zFI->getStatus() ) // return
+				break;
+			if( zFI->getStatus() == 2 ) // continue
+				break;
+			KSGSVariable *v = schleife.z( i )->ausführen( zObj, zFI, zKI );
+			if( v )
+				v->release();
+		}
+		if( zFI->getStatus() == 3 ) // break
+			break;
+		while( zFI->getStatus() == 1 ) // pause
+			Sleep( 100 );
+		if( !zFI->getStatus() ) // return
+			break;
+		if( !anz )
+			Sleep( 100 );
+		KSGSVariable *v = rechts ? rechts->ausführen( zObj, zFI, zKI ) : 0;
+		if( v )
+			v->release();
+		if( b )
+			b->release();
+		b = prozessParameter( bedingung, zObj, zFI, zKI );
+		if( !b )
+			return 0;
+	}
+	b->release();
+	return 0;
+}
+
+// Reference Counting
+KSGSBefehl *KSGSForBefehl::release()
+{
+	ref--;
+	if( !ref )
+		delete this;
+	return 0;
+}
+
+
+// Inhalt der KSGSWhileBefehl Klasse aus KSGSBefehl.h
+// Konstruktor
+KSGSWhileBefehl::KSGSWhileBefehl( KSGScriptObj *zObj, KSGSLeseBefehl *bef, KSGSCompKlassTable *zKT, KSGSCompFuncTable *zFT,
+								  KSGSCompVarTable *zVT, const char *klassName, const char *funktionName )
+	: KSGSBefehl( Typ::WHILE )
+{
+	bedingung = 0;
+	int bTyp = -1;
+	bool b = 0;
+	bedingung = new KSGSBefehlParameter( zObj, bef->befehl.getThis(), &bef->debug, zKT, zFT, zVT, klassName, funktionName, &bTyp, &b );
+	int anz = bef->listA.getEintragAnzahl();
+	for( int i = 0; i < anz; i++ )
+	{
+		KSGSLeseBefehl *b = bef->listA.get( i );
+		KSGSBefehl *ret = 0;
+		switch( b->typ )
+		{
+		case 0: // call oder operator
+			if( 1 )
+			{
+				removeKlammer( &b->befehl );
+				b->befehl.setSuchGrenzen( '(', ')' );
+				if( hatOperator( &b->befehl ) >= 0 )
+					ret = new KSGSOperatorBefehl( zObj, b, zKT, zFT, zVT, klassName, funktionName );
+				else
+					ret = new KSGSCallBefehl( zObj, b, zKT, zFT, zVT, klassName, funktionName );
+			}
+			break;
+		case 3: // var
+			ret = new KSGSVariableBefehl( zObj, b, zKT, zFT, zVT, klassName, funktionName );
+			break;
+		case 6: // if
+			ret = new KSGSIfBefehl( zObj, b, zKT, zFT, zVT, klassName, funktionName );
+			break;
+		case 7: // for
+			ret = new KSGSForBefehl( zObj, b, zKT, zFT, zVT, klassName, funktionName );
+			break;
+		case 8: // while
+			ret = new KSGSWhileBefehl( zObj, b, zKT, zFT, zVT, klassName, funktionName );
+			break;
+		case 9: // return
+			ret = new KSGSReturnBefehl( zObj, b, zKT, zFT, zVT, klassName, funktionName );
+			break;
+		case 10: // break
+			ret = new KSGSBreakBefehl( b, zKT, zFT, zVT, klassName, funktionName );
+			break;
+		case 11: // continue
+			ret = new KSGSContinueBefehl( b, zKT, zFT, zVT, klassName, funktionName );
+			break;
+		}
+		if( !ret )
+			error( 13, { b->debug.datei, Text() += b->debug.zeile, b->befehl }, zObj );
+		if( ret && ret->hatFehler() )
+			ret = ret->release();
+		if( !ret )
+		{
+			fehler = 1;
+			return;
+		}
+		schleife.add( ret );
+	}
+}
+
+// Destruktor
+KSGSWhileBefehl::~KSGSWhileBefehl()
+{
+	delete bedingung;
+}
+
+// constant
+KSGSVariable *KSGSWhileBefehl::ausführen( KSGScriptObj *zObj, KSGSFunktionInstanz *zFI, KSGSKlasseInstanz *zKI ) const
+{
+	KSGSVariable *b = prozessParameter( bedingung, zObj, zFI, zKI );
+	if( !b )
+		return 0;
+	int anz = schleife.getEintragAnzahl();
+	while( b->getBool() )
+	{
+		for( int i = 0; i < anz; i++ )
+		{
+			while( zFI->getStatus() == 1 ) // pause
+				Sleep( 100 );
+			if( !zFI->getStatus() ) // return
+				break;
+			if( zFI->getStatus() == 2 ) // continue
+				break;
+			KSGSVariable *v = schleife.z( i )->ausführen( zObj, zFI, zKI );
+			if( v )
+				v->release();
+		}
+		if( zFI->getStatus() == 3 ) // break
+			break;
+		while( zFI->getStatus() == 1 ) // pause
+			Sleep( 100 );
+		if( !zFI->getStatus() ) // return
+			break;
+		if( !anz )
+			Sleep( 100 );
+		if( b )
+			b->release();
+		b = prozessParameter( bedingung, zObj, zFI, zKI );
+		if( !b )
+			return 0;
+	}
+	b->release();
+	return 0;
+}
+
+// Reference Counting
+KSGSBefehl *KSGSWhileBefehl::release()
+{
+	ref--;
+	if( !ref )
+		delete this;
+	return 0;
+}
+
+
+// Inhalt der KSGSReturnBefehl Klasse aus KSGSBefehl.h
+// Konstruktor
+KSGSReturnBefehl::KSGSReturnBefehl( KSGScriptObj *zObj, KSGSLeseBefehl *bef, KSGSCompKlassTable *zKT, KSGSCompFuncTable *zFT,
+									KSGSCompVarTable *zVT, const char *klassName, const char *funktionName )
+	: KSGSBefehl( Typ::RETURN )
+{
+	param = 0;
+	if( bef->befehl.positionVon( "return" ) != 0 )
+	{
+		error( 13, { bef->debug.datei, Text() += bef->debug.zeile, bef->befehl }, zObj );
+		fehler = 1;
+		return;
+	}
+	bool b = 0;
+	param = new KSGSBefehlParameter( zObj, bef->befehl.getTeilText( 6 ), &bef->debug, zKT, zFT, zVT, klassName, funktionName, &returnTyp, &b );
+	if( !b )
+	{
+        delete param;
+        param = 0;
+	}
+}
+
+// Destruktor
+KSGSReturnBefehl::~KSGSReturnBefehl()
+{
+	delete param;
+}
+
+// constant
+KSGSVariable *KSGSReturnBefehl::ausführen( KSGScriptObj *zObj, KSGSFunktionInstanz *zFI, KSGSKlasseInstanz *zKI ) const
+{
+	KSGSVariable *v = param ? prozessParameter( param, zObj, zFI, zKI ) : 0;
+	if( v )
+		zFI->setReturnVariable( v );
+	zFI->setEnde();
+	return 0;
+}
+
+// Reference Counting
+KSGSBefehl *KSGSReturnBefehl::release()
+{
+	ref--;
+	if( !ref )
+		delete this;
+	return 0;
+}
+
+
+// Inhalt der KSGSBreakBefehl Klasse aus KSGSBefehl.h
+// Konstruktor
+KSGSBreakBefehl::KSGSBreakBefehl( KSGSLeseBefehl *bef, KSGSCompKlassTable *zKT, KSGSCompFuncTable *zFT,
+								  KSGSCompVarTable *zVT, const char *klassName, const char *funktionName )
+	: KSGSBefehl( Typ::BREAK )
+{
+}
+
+// Destruktor
+KSGSBreakBefehl::~KSGSBreakBefehl()
+{
+
+}
+
+// constant
+KSGSVariable *KSGSBreakBefehl::ausführen( KSGScriptObj *zObj, KSGSFunktionInstanz *zFI, KSGSKlasseInstanz *zKI ) const
+{
+	zFI->setBreak();
+	return 0;
+}
+
+// Reference Counting
+KSGSBefehl *KSGSBreakBefehl::release()
+{
+	ref--;
+	if( !ref )
+		delete this;
+	return 0;
+}
+
+
+// Inhalt der KSGSContinueBefehl Klasse aus KSGSBefehl.h
+// Konstruktor
+KSGSContinueBefehl::KSGSContinueBefehl( KSGSLeseBefehl *bef, KSGSCompKlassTable *zKT, KSGSCompFuncTable *zFT,
+										KSGSCompVarTable *zVT, const char *klassName, const char *funktionName )
+	: KSGSBefehl( Typ::CONTINUE )
+{
+}
+
+// Destruktor
+KSGSContinueBefehl::~KSGSContinueBefehl()
+{
+
+}
+
+// constant
+KSGSVariable *KSGSContinueBefehl::ausführen( KSGScriptObj *zObj, KSGSFunktionInstanz *zFI, KSGSKlasseInstanz *zKI ) const
+{
+	zFI->setContinue();
+	return 0;
+}
+
+// Reference Counting
+KSGSBefehl *KSGSContinueBefehl::release()
+{
+	ref--;
+	if( !ref )
+		delete this;
+	return 0;
+}
+
+
+// Inhalt der KSGSVariableBefehl Klasse aus KSGSBefehl.h
+// Konstruktor
+KSGSVariableBefehl::KSGSVariableBefehl( KSGScriptObj *zObj, KSGSLeseBefehl *bef, KSGSCompKlassTable *zKT, KSGSCompFuncTable *zFT,
+										KSGSCompVarTable *zVT, const char *klassName, const char *funktionName )
+	: KSGSBefehl( Typ::VARIABLE )
+{
+	erstell = 0;
+	if( bef->befehl.positionVon( "var" ) != 0 )
+	{
+		error( 13, { bef->debug.datei, Text() += bef->debug.zeile, bef->befehl }, zObj );
+		fehler = 1;
+		return;
+	}
+	bool b = 0;
+	erstell = new KSGSBefehlErstell( zObj, bef->befehl.getTeilText( 3 ), &bef->debug, zKT, zFT, zVT, klassName, funktionName, &b );
+	returnTyp = erstell->typId;
+	if( !b )
+	{
+		error( 13, { bef->debug.datei, Text() += bef->debug.zeile, bef->befehl }, zObj );
+		fehler = 1;
+		return;
+	}
+}
+
+// Destruktor
+KSGSVariableBefehl::~KSGSVariableBefehl()
+{
+	delete erstell;
+}
+
+// constant
+KSGSVariable *KSGSVariableBefehl::ausführen( KSGScriptObj *zObj, KSGSFunktionInstanz *zFI, KSGSKlasseInstanz *zKI ) const
+{
+	return prozessErstell( erstell, zObj, zFI, zKI );
+}
+
+// Reference Counting
+KSGSBefehl *KSGSVariableBefehl::release()
+{
+	ref--;
+	if( !ref )
+		delete this;
+	return 0;
+}

+ 296 - 0
ksgScript/Befehl/KSGSBefehl.h

@@ -0,0 +1,296 @@
+#ifndef KSGSBefehl_H
+#define KSGSBefehl_H
+
+#include <Array.h>
+#include <Text.h>
+
+using namespace Framework;
+
+namespace KSGScript
+{
+	class KSGScriptObj; // ../Main/KSGScriptObj.h
+	struct KSGSLeseBefehl; // ../Leser/KSGSLeser.h
+	struct KSGSLeseDebug; // ../Leser/KSGSLeser.h
+	struct KSGSBefehlParameter; // aus dieser Datei
+	class KSGSCompKlassTable; // ../Leser/Compile.h
+	class KSGSCompFuncTable; // ../Leser/Compile.h
+	class KSGSCompVarTable; // ../Leser/Compile.h
+	class KSGSBefehl; // aus dieser Datei
+	class KSGSFunktionInstanz; // KSGSFunktion
+	class KSGSKlasseInstanz; // KSGSKlasse.h
+	typedef KSGSKlasseInstanz KSGSVariable;
+
+	struct KSGSBefehlVariable
+	{
+		int varId;
+		int varSichtbar; // 0 = global, 1 = klasse, 2 = parameter, 3 = lokal
+		// Konstruktor
+		__declspec( dllexport ) KSGSBefehlVariable( Text *txt, KSGSCompKlassTable *zKT, KSGSCompFuncTable *zFT, KSGSCompVarTable *zVT,
+													const char *klassName, const char *funktionName, int *typId, bool *ok );
+	};
+
+	struct KSGSBefehlFunktion
+	{
+		int funcId;
+		int funkSichtbar;
+		Array< KSGSBefehlParameter* > parameter;
+		// Konstruktor
+		__declspec( dllexport ) KSGSBefehlFunktion( KSGScriptObj *zObj, Text *txt, KSGSLeseDebug *dbg, KSGSCompKlassTable *zKT, KSGSCompFuncTable *zFT, KSGSCompVarTable *zVT,
+													const char *klassName, const char *funktionName, int *typId, bool *ok );
+		// Destruktor
+		~KSGSBefehlFunktion();
+	};
+
+	struct KSGSBefehlMember
+	{
+		enum Typ
+		{
+			BEFEHL,
+			FUNKTION,
+			VARIABLE
+		};
+		Typ typ;
+		KSGSBefehl *bef;
+		KSGSBefehlFunktion *funk;
+		KSGSBefehlVariable *var;
+		// Konstruktor
+		__declspec( dllexport ) KSGSBefehlMember( KSGScriptObj *zObj, Text *txt, KSGSLeseDebug *dbg, KSGSCompKlassTable *zKT, KSGSCompFuncTable *zFT,
+												  KSGSCompVarTable *zVT, const char *klassName, const char *funktionName, int *typId, bool *ok );
+		// Destruktor
+		__declspec( dllexport ) ~KSGSBefehlMember();
+	};
+
+	struct KSGSBefehlParameter
+	{
+		enum Typ
+		{
+			WERT,
+			OBJEKT
+		};
+		Typ typ;
+		Text wert;
+		Array< KSGSBefehlMember* > objekt;
+		// Konstruktor
+		__declspec( dllexport ) KSGSBefehlParameter( KSGScriptObj *zObj, Text *txt, KSGSLeseDebug *dbg, KSGSCompKlassTable *zKT, KSGSCompFuncTable *zFT,
+													 KSGSCompVarTable *zVT, const char *klassName, const char *funktionName, int *typId, bool *ok );
+		// Destruktor
+		__declspec( dllexport ) ~KSGSBefehlParameter();
+	};
+
+	struct KSGSBefehlErstell
+	{
+		int id;
+		int typId;
+		bool konstruktor;
+		KSGSBefehlParameter *param;
+		// Konstruktor
+		__declspec( dllexport ) KSGSBefehlErstell( KSGScriptObj *zObj, Text *txt, KSGSLeseDebug *dbg, KSGSCompKlassTable *zKT, KSGSCompFuncTable *zFT,
+												   KSGSCompVarTable *zVT, const char *klassName, const char *funktionName, bool *ok );
+		// Destruktor
+		__declspec( dllexport ) ~KSGSBefehlErstell();
+	};
+
+	class KSGSBefehl
+	{
+	public:
+		enum Typ
+		{
+			CALL,
+			OPERATOR,
+			IF,
+			FOR,
+			WHILE,
+			RETURN,
+			BREAK,
+			CONTINUE,
+			VARIABLE
+		};
+
+	protected:
+		Typ typ;
+		bool fehler;
+		int returnTyp;
+		int ref;
+
+	public:
+		// Konstruktor
+		__declspec( dllexport ) KSGSBefehl( Typ typ );
+		// Destruktor
+		__declspec( dllexport ) ~KSGSBefehl();
+		// constant
+		__declspec( dllexport ) virtual KSGSVariable *ausführen( KSGScriptObj *zObj, KSGSFunktionInstanz *zFI, KSGSKlasseInstanz *zKI ) const;
+		__declspec( dllexport ) bool hatFehler() const;
+		__declspec( dllexport ) int getReturnTyp() const;
+		__declspec( dllexport ) bool istTyp( Typ t ) const;
+		// Reference Counting
+		__declspec( dllexport ) KSGSBefehl *getThis();
+		__declspec( dllexport ) virtual KSGSBefehl *release();
+		// static
+		__declspec( dllexport ) static KSGSVariable *prozessVariable( KSGSVariable *zVorObj, KSGSBefehlVariable *zVar, KSGScriptObj *zObj, KSGSFunktionInstanz *zFI, KSGSKlasseInstanz *zKI );
+		__declspec( dllexport ) static KSGSVariable *prozessFunktion( KSGSVariable *zVorObj, KSGSBefehlFunktion *zFunk, KSGScriptObj *zObj, KSGSFunktionInstanz *zFI, KSGSKlasseInstanz *zKI );
+		__declspec( dllexport ) static KSGSVariable *prozessMember( KSGSVariable *zVorObj, KSGSBefehlMember *zMem, KSGScriptObj *zObj, KSGSFunktionInstanz *zFI, KSGSKlasseInstanz *zKI );
+		__declspec( dllexport ) static KSGSVariable *prozessParameter( KSGSBefehlParameter *zParam, KSGScriptObj *zObj, KSGSFunktionInstanz *zFI, KSGSKlasseInstanz *zKI );
+		__declspec( dllexport ) static KSGSVariable *prozessErstell( KSGSBefehlErstell *zErst, KSGScriptObj *zObj, KSGSFunktionInstanz *zFI, KSGSKlasseInstanz *zKI );
+	};
+
+	class KSGSCallBefehl : public KSGSBefehl
+	{
+	private:
+		Array< KSGSBefehlMember* > objekt;
+
+	public:
+		// Konstruktor
+		__declspec( dllexport ) KSGSCallBefehl( KSGScriptObj *zObj, KSGSLeseBefehl *bef, KSGSCompKlassTable *zKT, KSGSCompFuncTable *zFT,
+												KSGSCompVarTable *zVT, const char *klassName, const char *funktionName );
+		// Destruktor
+		__declspec( dllexport ) ~KSGSCallBefehl();
+		// constant
+		__declspec( dllexport ) virtual KSGSVariable *ausführen( KSGScriptObj *zObj, KSGSFunktionInstanz *zFI, KSGSKlasseInstanz *zKI ) const override;
+		// Reference Counting
+		__declspec( dllexport ) virtual KSGSBefehl *release() override;
+	};
+
+	class KSGSOperatorBefehl : public KSGSBefehl
+	{
+	private:
+		KSGSBefehlParameter *paramL;
+		int operatorId;
+		KSGSBefehlParameter *paramR;
+
+	public:
+		// Konstruktor
+		__declspec( dllexport ) KSGSOperatorBefehl( KSGScriptObj *zObj, KSGSLeseBefehl *bef, KSGSCompKlassTable *zKT, KSGSCompFuncTable *zFT,
+													KSGSCompVarTable *zVT, const char *klassName, const char *funktionName );
+		// Destruktor
+		__declspec( dllexport ) ~KSGSOperatorBefehl();
+		// constant
+		__declspec( dllexport ) virtual KSGSVariable *ausführen( KSGScriptObj *zObj, KSGSFunktionInstanz *zFI, KSGSKlasseInstanz *zKI ) const override;
+		// Reference Counting
+		__declspec( dllexport ) virtual KSGSBefehl *release() override;
+	};
+
+	class KSGSIfBefehl : public KSGSBefehl
+	{
+	private:
+		KSGSBefehlParameter *bedingung;
+		RCArray< KSGSBefehl > bTrue;
+		RCArray< KSGSBefehl > bFalse;
+
+	public:
+		// Konstruktor
+		__declspec( dllexport ) KSGSIfBefehl( KSGScriptObj *zObj, KSGSLeseBefehl *bef, KSGSCompKlassTable *zKT, KSGSCompFuncTable *zFT,
+											  KSGSCompVarTable *zVT, const char *klassName, const char *funktionName );
+		// Destruktor
+		__declspec( dllexport ) ~KSGSIfBefehl();
+		// constant
+		__declspec( dllexport ) virtual KSGSVariable *ausführen( KSGScriptObj *zObj, KSGSFunktionInstanz *zFI, KSGSKlasseInstanz *zKI ) const override;
+		// Reference Counting
+		__declspec( dllexport ) virtual KSGSBefehl *release() override;
+	};
+
+	class KSGSForBefehl : public KSGSBefehl
+	{
+	private:
+		KSGSBefehl *links;
+		KSGSBefehlParameter *bedingung;
+		KSGSBefehl *rechts;
+		RCArray< KSGSBefehl > schleife;
+
+	public:
+		// Konstruktor
+		__declspec( dllexport ) KSGSForBefehl( KSGScriptObj *zObj, KSGSLeseBefehl *bef, KSGSCompKlassTable *zKT, KSGSCompFuncTable *zFT,
+											   KSGSCompVarTable *zVT, const char *klassName, const char *funktionName );
+		// Destruktor
+		__declspec( dllexport ) ~KSGSForBefehl();
+		// constant
+		__declspec( dllexport ) virtual KSGSVariable *ausführen( KSGScriptObj *zObj, KSGSFunktionInstanz *zFI, KSGSKlasseInstanz *zKI ) const override;
+		// Reference Counting
+		__declspec( dllexport ) virtual KSGSBefehl *release() override;
+	};
+
+	class KSGSWhileBefehl : public KSGSBefehl
+	{
+	private:
+		KSGSBefehlParameter *bedingung;
+		RCArray< KSGSBefehl > schleife;
+
+	public:
+		// Konstruktor
+		__declspec( dllexport ) KSGSWhileBefehl( KSGScriptObj *zObj, KSGSLeseBefehl *bef, KSGSCompKlassTable *zKT, KSGSCompFuncTable *zFT,
+												 KSGSCompVarTable *zVT, const char *klassName, const char *funktionName );
+		// Destruktor
+		__declspec( dllexport ) ~KSGSWhileBefehl();
+		// constant
+		__declspec( dllexport ) virtual KSGSVariable *ausführen( KSGScriptObj *zObj, KSGSFunktionInstanz *zFI, KSGSKlasseInstanz *zKI ) const override;
+		// Reference Counting
+		__declspec( dllexport ) virtual KSGSBefehl *release() override;
+	};
+
+	class KSGSReturnBefehl : public KSGSBefehl
+	{
+	private:
+		KSGSBefehlParameter *param;
+
+	public:
+		// Konstruktor
+		__declspec( dllexport ) KSGSReturnBefehl( KSGScriptObj *zObj, KSGSLeseBefehl *bef, KSGSCompKlassTable *zKT, KSGSCompFuncTable *zFT,
+												  KSGSCompVarTable *zVT, const char *klassName, const char *funktionName );
+		// Destruktor
+		__declspec( dllexport ) ~KSGSReturnBefehl();
+		// constant
+		__declspec( dllexport ) virtual KSGSVariable *ausführen( KSGScriptObj *zObj, KSGSFunktionInstanz *zFI, KSGSKlasseInstanz *zKI ) const override;
+		// Reference Counting
+		__declspec( dllexport ) virtual KSGSBefehl *release() override;
+	};
+
+	class KSGSBreakBefehl : public KSGSBefehl
+	{
+	private:
+
+	public:
+		// Konstruktor
+		__declspec( dllexport ) KSGSBreakBefehl( KSGSLeseBefehl *bef, KSGSCompKlassTable *zKT, KSGSCompFuncTable *zFT,
+												 KSGSCompVarTable *zVT, const char *klassName, const char *funktionName );
+		// Destruktor
+		__declspec( dllexport ) ~KSGSBreakBefehl();
+		// constant
+		__declspec( dllexport ) virtual KSGSVariable *ausführen( KSGScriptObj *zObj, KSGSFunktionInstanz *zFI, KSGSKlasseInstanz *zKI ) const override;
+		// Reference Counting
+		__declspec( dllexport ) virtual KSGSBefehl *release() override;
+	};
+
+	class KSGSContinueBefehl : public KSGSBefehl
+	{
+	private:
+
+	public:
+		// Konstruktor
+		__declspec( dllexport ) KSGSContinueBefehl( KSGSLeseBefehl *bef, KSGSCompKlassTable *zKT, KSGSCompFuncTable *zFT,
+													KSGSCompVarTable *zVT, const char *klassName, const char *funktionName );
+		// Destruktor
+		__declspec( dllexport ) ~KSGSContinueBefehl();
+		// constant
+		__declspec( dllexport ) virtual KSGSVariable *ausführen( KSGScriptObj *zObj, KSGSFunktionInstanz *zFI, KSGSKlasseInstanz *zKI ) const override;
+		// Reference Counting
+		__declspec( dllexport ) virtual KSGSBefehl *release() override;
+	};
+
+	class KSGSVariableBefehl : public KSGSBefehl
+	{
+	private:
+		KSGSBefehlErstell *erstell;
+
+	public:
+		// Konstruktor
+		__declspec( dllexport ) KSGSVariableBefehl( KSGScriptObj *zObj, KSGSLeseBefehl *bef, KSGSCompKlassTable *zKT, KSGSCompFuncTable *zFT,
+													KSGSCompVarTable *zVT, const char *klassName, const char *funktionName );
+		// Destruktor
+		__declspec( dllexport ) ~KSGSVariableBefehl();
+		// constant
+		__declspec( dllexport ) virtual KSGSVariable *ausführen( KSGScriptObj *zObj, KSGSFunktionInstanz *zFI, KSGSKlasseInstanz *zKI ) const override;
+		// Reference Counting
+		__declspec( dllexport ) virtual KSGSBefehl *release() override;
+	};
+}
+
+#endif

+ 319 - 0
ksgScript/Befehl/KSGSFunktion.cpp

@@ -0,0 +1,319 @@
+#include "KSGSFunktion.h"
+#include "../Leser/KSGSLeser.h"
+#include "../Main/KSGScriptObj.h"
+#include "../Klassen/KSGSThread.h"
+#include "../Error/Error.h"
+#include "../Klassen/KSGSTyp.h"
+#include <iostream>
+
+using namespace KSGScript;
+
+// Inhalt der KSGSFunktionInstanz Klasse aus KSGSFunktion.h
+// Konstruktor
+KSGSFunktionInstanz::KSGSFunktionInstanz( RCArray< KSGSBefehl > *ba, int rt, KSGScriptObj *obj, KSGSKlasseInstanz *klasse )
+    : Thread()
+{
+	lokaleVariablen = new RCArray< KSGSVariable >();
+	befehle = ba;
+	this->klasse = klasse;
+	this->obj = obj;
+	threadVar = 0;
+	returnTyp = rt;
+	retVar = 0;
+	pausiert = 0;
+	beendet = 0;
+	breakB = 0;
+	continueB = 0;
+	scrId = obj->getScriptId();
+	ref = 1;
+}
+
+// Destruktor
+KSGSFunktionInstanz::~KSGSFunktionInstanz()
+{
+	lokaleVariablen->release();
+	befehle->release();
+	if( klasse )
+	    klasse->release();
+	obj->release();
+	if( threadVar )
+		threadVar->release();
+	if( retVar )
+		retVar->release();
+}
+
+// privat
+void KSGSFunktionInstanz::lock()
+{
+    cs.lock();
+}
+
+void KSGSFunktionInstanz::unlock()
+{
+    cs.unlock();
+}
+
+// nicht constant
+void KSGSFunktionInstanz::setParameter( Array< KSGSVariableDef* > *zDef, RCArray< KSGSVariable > *vars )
+{
+	int anz = zDef->getEintragAnzahl();
+	for( int i = 0; i < anz; i++ )
+	{
+		int id = zDef->get( i )->id;
+		if( vars->z( id ) )
+		{
+			if( zDef->get( i )->typId != vars->z( id )->getTyp() )
+			{
+				KSGSVariable *var = vars->z( id )->umwandelnIn( zDef->get( i )->typId );
+				if( !var )
+					lokaleVariablen->set( KSGSVariable::erstellVariable( obj, zDef->get( i ) ), id );
+				else
+					lokaleVariablen->set( var, id );
+			}
+			else
+				lokaleVariablen->set( vars->get( id ), id );
+		}
+		else
+			lokaleVariablen->set( KSGSVariable::erstellVariable( obj, zDef->get( i ) ), id );
+	}
+	vars->release();
+}
+
+void KSGSFunktionInstanz::setReturnVariable( KSGSVariable *var )
+{
+	if( var->getTyp() != returnTyp )
+	{
+		error( 15, {}, obj );
+		KSGSVariable *tmp = var->umwandelnIn( returnTyp );
+		var->release();
+		var = tmp;
+	}
+	lock();
+	if( retVar )
+		retVar->release();
+	retVar = var;
+	unlock();
+}
+
+void KSGSFunktionInstanz::setPause( bool p )
+{
+	pausiert = p;
+}
+
+void KSGSFunktionInstanz::setContinue()
+{
+	continueB = 1;
+}
+
+void KSGSFunktionInstanz::setBreak()
+{
+	breakB = 0;
+}
+
+void KSGSFunktionInstanz::setEnde()
+{
+	beendet = 1;
+}
+
+KSGSVariable *KSGSFunktionInstanz::startFunktion()
+{
+	if( run )
+		return 0;
+	if( threadVar )
+		threadVar = (KSGSThreadKlasse*)threadVar->release();
+	if( retVar )
+		retVar = retVar->release();
+	if( returnTyp == KSGS_THREAD )
+	{
+		threadVar = new KSGSThreadKlasse( obj, getThis() );
+		start();
+		return threadVar->getThis();
+	}
+	else
+	{
+		run = 1;
+		thread();
+		warteAufFunktion( INFINITE );
+		return retVar ? retVar->getThis() : 0;
+	}
+}
+
+void KSGSFunktionInstanz::thread()
+{
+	getThis();
+	int anz = befehle->getEintragAnzahl();
+	for( int i = 0; i < anz; i++ )
+	{
+		while( pausiert && !beendet && !obj->istBeendet( scrId ) )
+			Sleep( 100 );
+		if( obj->istBeendet( scrId ) || beendet )
+			break;
+		KSGSBefehl *b = befehle->z( i );
+		if( b )
+		{
+			KSGSVariable *var = b->ausführen( obj, this, klasse );
+			if( var )
+				var->release();
+		}
+	}
+	run = 0;
+	if( threadVar )
+	{
+		threadVar->threadEnde();
+		threadVar = (KSGSThreadKlasse*)threadVar->release();
+	}
+	release();
+}
+
+int KSGSFunktionInstanz::getStatus()
+{
+	if( !isRunning() || beendet )
+		return 0;
+	if( pausiert )
+		return 1;
+	if( breakB )
+	{
+		breakB = 0;
+		return 2;
+	}
+	if( continueB )
+	{
+		continueB = 0;
+		return 3;
+	}
+	return 4;
+}
+
+void KSGSFunktionInstanz::setVariable( int id, KSGSVariable *var )
+{
+	lokaleVariablen->set( var, id );
+}
+
+// constant
+KSGSVariable *KSGSFunktionInstanz::getVariable( int id ) const
+{
+	return lokaleVariablen->get( id );
+}
+
+int KSGSFunktionInstanz::getReturnTyp() const
+{
+	return returnTyp;
+}
+
+bool KSGSFunktionInstanz::wirdFunktionAusgeführt() const
+{
+	return isRunning();
+}
+
+int KSGSFunktionInstanz::warteAufFunktion( int zeit )
+{
+	if( run )
+		return warteAufThread( zeit );
+	return 0;
+}
+
+bool KSGSFunktionInstanz::wirdAusgeführt() const
+{
+	return isRunning() && !beendet && !pausiert;
+}
+
+// Reference Counting
+KSGSFunktionInstanz *KSGSFunktionInstanz::getThis()
+{
+	ref++;
+	return this;
+}
+
+KSGSFunktionInstanz *KSGSFunktionInstanz::release()
+{
+	ref--;
+	if( !ref )
+		delete this;
+	return 0;
+}
+
+
+// Inhalt der KSGSFunktion Klasse aus KSGSFunktion.h
+// Konstruktor
+KSGSFunktion::KSGSFunktion( int id, int sichtbar, int typ )
+	: typId( typ ),
+	  sichtbar( sichtbar ),
+	  id( id ),
+	  ref( 1 )
+{
+	befehle = new RCArray< KSGSBefehl >();
+	parameter = new Array< KSGSVariableDef* >();
+	name = "";
+}
+
+// Destruktor
+KSGSFunktion::~KSGSFunktion()
+{
+	if( befehle )
+		befehle->release();
+	int anz = parameter->getEintragAnzahl();
+	for( int i = 0; i < anz; i++ )
+		delete parameter->get( i );
+	if( parameter )
+		parameter->release();
+}
+
+// nicht constant
+void KSGSFunktion::setName( const char *txt )
+{
+	name = txt;
+}
+
+void KSGSFunktion::addParameter( KSGSVariableDef *var )
+{
+	parameter->add( var );
+}
+
+void KSGSFunktion::addBefehl( KSGSBefehl *befehl )
+{
+	befehle->add( befehl );
+}
+
+KSGSFunktionInstanz *KSGSFunktion::erstellInstanz( KSGScriptObj *obj, KSGSKlasseInstanz *klasse, RCArray< KSGSVariable > *params )
+{
+	KSGSFunktionInstanz *inst = new KSGSFunktionInstanz( befehle->getThis(), typId, obj, klasse );
+	if( params )
+		inst->setParameter( parameter, params );
+	return inst;
+}
+
+// constant
+int KSGSFunktion::getId() const
+{
+	return id;
+}
+
+int KSGSFunktion::getTypId() const
+{
+	return typId;
+}
+
+int KSGSFunktion::getSichtbarkeit() const
+{
+	return sichtbar;
+}
+
+bool KSGSFunktion::hatName( const char *txt ) const
+{
+	return name.istGleich( txt );
+}
+
+// Reference Counting
+KSGSFunktion *KSGSFunktion::getThis()
+{
+	ref++;
+	return this;
+}
+
+KSGSFunktion *KSGSFunktion::release()
+{
+	ref--;
+	if( !ref )
+		delete this;
+	return 0;
+}

+ 98 - 0
ksgScript/Befehl/KSGSFunktion.h

@@ -0,0 +1,98 @@
+#ifndef KSGSFunktion_H
+#define KSGSFunktion_H
+
+#include "KSGSBefehl.h"
+#include "KSGSVariable.h"
+#include <Thread.h>
+#include <Critical.h>
+
+namespace KSGScript
+{
+	class KSGScriptObj; // ../Main/KSGScript.h
+	class KSGSKlasseInstanz; // KSGSKlasse.h
+	class KSGSThreadKlasse; // ../Klassen/KSGSThread.h
+	typedef KSGSKlasseInstanz KSGSVariable;
+
+	class KSGSFunktionInstanz : private Thread
+	{
+	protected:
+		RCArray< KSGSVariable > *lokaleVariablen;
+		RCArray< KSGSBefehl > *befehle;
+		KSGSKlasseInstanz *klasse;
+		KSGScriptObj *obj;
+		KSGSThreadKlasse *threadVar;
+		int returnTyp;
+
+		KSGSVariable *retVar;
+		Critical cs;
+		bool pausiert;
+		bool beendet;
+		bool continueB;
+		bool breakB;
+		int scrId;
+		int ref;
+
+		// privat
+		__declspec( dllexport ) virtual void lock();
+		__declspec( dllexport ) virtual void unlock();
+
+	public:
+		// Konstruktor
+		__declspec( dllexport ) KSGSFunktionInstanz( RCArray< KSGSBefehl > *ba, int rt, KSGScriptObj *obj, KSGSKlasseInstanz *klasse );
+		// Destruktor
+		__declspec( dllexport ) ~KSGSFunktionInstanz();
+		// nicht constant
+		__declspec( dllexport ) virtual void setParameter( Array< KSGSVariableDef* > *zDef, RCArray< KSGSVariable > *vars );
+		__declspec( dllexport ) virtual void setReturnVariable( KSGSVariable *var );
+		__declspec( dllexport ) virtual void setPause( bool p );
+		__declspec( dllexport ) virtual void setContinue();
+		__declspec( dllexport ) virtual void setBreak();
+		__declspec( dllexport ) virtual void setEnde();
+		__declspec( dllexport ) virtual KSGSVariable *startFunktion();
+		__declspec( dllexport ) virtual void thread();
+		__declspec( dllexport ) virtual int getStatus();
+		__declspec( dllexport ) virtual void setVariable( int id, KSGSVariable *var );
+		// constant
+		__declspec( dllexport ) virtual KSGSVariable *getVariable( int id ) const;
+		__declspec( dllexport ) virtual int getReturnTyp() const;
+		__declspec( dllexport ) virtual bool wirdFunktionAusgeführt() const;
+		__declspec( dllexport ) virtual int warteAufFunktion( int zeit );
+		__declspec( dllexport ) virtual bool wirdAusgeführt() const;
+		// Reference Counting
+		__declspec( dllexport ) virtual KSGSFunktionInstanz *getThis();
+		__declspec( dllexport ) virtual KSGSFunktionInstanz *release();
+	};
+
+	class KSGSFunktion
+	{
+	protected:
+		RCArray< KSGSBefehl > *befehle;
+		Array< KSGSVariableDef* > *parameter;
+		Text name;
+		int typId;
+		int sichtbar; // 0 = global, 1 = global in Klasse, 2 = lokal in Klasse
+		int id;
+		int ref;
+
+	public:
+		// Konstruktor
+		__declspec( dllexport ) KSGSFunktion( int id, int sichtbar, int typ );
+		// Destruktor
+		__declspec( dllexport ) ~KSGSFunktion();
+		// nicht constant
+		__declspec( dllexport ) virtual void setName( const char *txt );
+		__declspec( dllexport ) virtual void addParameter( KSGSVariableDef *var );
+		__declspec( dllexport ) virtual void addBefehl( KSGSBefehl *befehl );
+		__declspec( dllexport ) virtual KSGSFunktionInstanz *erstellInstanz( KSGScriptObj *obj, KSGSKlasseInstanz *klasse, RCArray< KSGSVariable > *params );
+		// constant
+		__declspec( dllexport ) virtual int getId() const;
+		__declspec( dllexport ) virtual int getTypId() const;
+		__declspec( dllexport ) virtual int getSichtbarkeit() const;
+		__declspec( dllexport ) virtual bool hatName( const char *txt ) const;
+		// Reference Counting
+		__declspec( dllexport ) virtual KSGSFunktion *getThis();
+		__declspec( dllexport ) virtual KSGSFunktion *release();
+	};
+}
+
+#endif

+ 502 - 0
ksgScript/Befehl/KSGSKlasse.cpp

@@ -0,0 +1,502 @@
+#include "KSGSKlasse.h"
+#include "../Error/Error.h"
+#include "../Main/KSGScriptObj.h"
+#include "../Klassen/KSGSTyp.h"
+#include "../Klassen/KSGSBool.h"
+#include "../Klassen/KSGSInt.h"
+#include "../Klassen/KSGSDouble.h"
+#include "../Klassen/KSGSText.h"
+#include "../Klassen/KSGSBild.h"
+#include "../Klassen/KSGSMausEreignis.h"
+#include "../Klassen/KSGSTastaturEreignis.h"
+#include "../Klassen/KSGSTextFeld.h"
+#include "../Klassen/KSGSKnopf.h"
+#include "../Klassen/KSGSFenster.h"
+#include "../Klassen/KSGSBildZ.h"
+#include "../Klassen/KSGSAnimation2DData.h"
+#include "../Klassen/KSGSAnimation2D.h"
+#include "../Klassen/KSGSArray.h"
+
+using namespace KSGScript;
+
+// Inhalt der KSGSKlasseInstanz Klasse aus KSGSKlasse.h
+// Konstruktor
+KSGSKlasseInstanz::KSGSKlasseInstanz( int typ, Array< KSGSVariableDef* > *zVars, RCArray< KSGSFunktion > *funcs, KSGScriptObj *zObj )
+{
+	lokaleVariablen = new RCArray< KSGSVariable >();
+	varPublic = new Array< bool >();
+	funktionen = funcs;
+	obj = zObj->getThis();
+	lokaleVariablen->add( getThis(), 0 );
+	varPublic->set( 0, 0 );
+	int anz = zVars ? zVars->getEintragAnzahl() : 0;
+	for( int i = 0; i < anz; i++ )
+	{
+		lokaleVariablen->set( KSGSVariable::erstellVariable( zObj, zVars->get( i ) ), zVars->get( i )->id + 1 );
+		varPublic->set( zVars->get( i )->sichtbar == 1, zVars->get( i )->id + 1 );
+	}
+	this->typ = typ;
+	ref = 1;
+}
+
+// Destruktor
+KSGSKlasseInstanz::~KSGSKlasseInstanz()
+{
+	lokaleVariablen->release();
+	if( funktionen )
+		funktionen->release();
+	varPublic->release();
+	obj->release();
+}
+
+// nicht constant
+KSGSVariable *KSGSKlasseInstanz::startFunktion( int id, bool zugriff, RCArray< KSGSVariable > *parameter )
+{
+	if( !funktionen || ( !zugriff && ( !funktionen->z( id ) || funktionen->z( id )->getSichtbarkeit() != 1 ) ) )
+	{
+		error( 18, {}, obj );
+		parameter->release();
+		return 0;
+	}
+	if( !funktionen->z( id ) )
+	{
+		parameter->release();
+		return 0;
+	}
+	KSGSFunktionInstanz *inst = funktionen->z( id )->erstellInstanz( obj->getThis(), (KSGSKlasseInstanz*)getThis(), parameter );
+	KSGSVariable *ret = inst->startFunktion();
+	inst->release();
+	return ret;
+}
+
+KSGSVariable *KSGSKlasseInstanz::doOperator( int id, KSGSVariable *rechts )
+{
+	error( 21, {}, obj );
+	if( rechts )
+		rechts->release();
+	return 0;
+}
+
+void KSGSKlasseInstanz::setVariable( int id, KSGSVariable *var )
+{
+	lokaleVariablen->set( var, id );
+}
+
+// constant
+KSGSVariable *KSGSKlasseInstanz::getVariable( int id, bool zugriff ) const
+{
+	if( !zugriff && ( !varPublic->hat( id ) || !varPublic->get( id ) ) )
+	{
+		error( 17, {}, obj );
+		return 0;
+	}
+	return lokaleVariablen->get( id );
+}
+
+KSGSVariable *KSGSKlasseInstanz::umwandelnIn( int typ ) const
+{
+	error( 16, {}, obj );
+	return 0;
+}
+
+int KSGSKlasseInstanz::getTyp() const
+{
+	return typ;
+}
+
+// verarbeiten
+bool KSGSKlasseInstanz::getBool() const
+{
+	if( typ == KSGS_BOOL )
+		return ( ( KSGSBoolKlasse* )this )->getVal();
+	else
+	{
+		KSGSBoolKlasse *tmp = (KSGSBoolKlasse*)umwandelnIn( KSGS_BOOL );
+		if( tmp )
+		{
+			bool ret = tmp->getVal();
+			tmp->release();
+			return ret;
+		}
+		return 0;
+	}
+}
+
+int KSGSKlasseInstanz::getInt() const
+{
+	if( typ == KSGS_INT )
+		return ( ( KSGSIntKlasse* )this )->getVal();
+	else
+	{
+		KSGSIntKlasse *tmp = (KSGSIntKlasse*)umwandelnIn( KSGS_INT );
+		if( tmp )
+		{
+			int ret = tmp->getVal();
+			tmp->release();
+			return ret;
+		}
+		return 0;
+	}
+}
+
+double KSGSKlasseInstanz::getDouble() const
+{
+	if( typ == KSGS_DOUBLE )
+		return ( ( KSGSDoubleKlasse* )this )->getVal();
+	else
+	{
+		KSGSDoubleKlasse *tmp = (KSGSDoubleKlasse*)umwandelnIn( KSGS_DOUBLE );
+		if( tmp )
+		{
+			double ret = tmp->getVal();
+			tmp->release();
+			return ret;
+		}
+		return 0;
+	}
+}
+
+Text *KSGSKlasseInstanz::getText() const
+{
+	if( typ == KSGS_TEXT )
+		return ( ( KSGSTextKlasse* )this )->getVal();
+	else
+	{
+		KSGSTextKlasse *tmp = (KSGSTextKlasse*)umwandelnIn( KSGS_TEXT );
+		if( tmp )
+		{
+			Text *ret = tmp->getVal();
+			tmp->release();
+			return ret;
+		}
+		return new Text( "" );
+	}
+}
+
+Bild *KSGSKlasseInstanz::getBild() const
+{
+	if( typ == KSGS_BILD )
+		return ( ( KSGSBildKlasse* )this )->getVal();
+	else
+	{
+		KSGSBildKlasse *tmp = (KSGSBildKlasse*)umwandelnIn( KSGS_BILD );
+		if( tmp )
+		{
+			Bild *ret = tmp->getVal();
+			tmp->release();
+			return ret;
+		}
+		return new Bild();
+	}
+}
+
+MausEreignis KSGSKlasseInstanz::getMausEreignis() const
+{
+	if( typ == KSGS_MAUSEREIGNIS )
+		return ( ( KSGSMausEreignisKlasse* )this )->getVal();
+	else
+	{
+		KSGSMausEreignisKlasse *tmp = (KSGSMausEreignisKlasse*)umwandelnIn( KSGS_MAUSEREIGNIS );
+		if( tmp )
+		{
+			MausEreignis ret = tmp->getVal();
+			tmp->release();
+			return ret;
+		}
+		return MausEreignis{ 0, 0, 0, 0, 0, 0 };
+	}
+}
+
+TastaturEreignis KSGSKlasseInstanz::getTastaturEreignis() const
+{
+	if( typ == KSGS_TASTATUREREIGNIS )
+		return ( ( KSGSTastaturEreignisKlasse* )this )->getVal();
+	else
+	{
+		KSGSTastaturEreignisKlasse *tmp = (KSGSTastaturEreignisKlasse*)umwandelnIn( KSGS_TASTATUREREIGNIS );
+		if( tmp )
+		{
+			TastaturEreignis ret = tmp->getVal();
+			tmp->release();
+			return ret;
+		}
+		return TastaturEreignis{ 0, 0, 0 };
+	}
+}
+
+TextFeld *KSGSKlasseInstanz::getTextFeld() const
+{
+	if( typ == KSGS_TEXTFELD )
+		return ( ( KSGSTextFeldKlasse* )this )->getVal();
+	else
+	{
+		KSGSTextFeldKlasse *tmp = (KSGSTextFeldKlasse*)umwandelnIn( KSGS_TEXTFELD );
+		if( tmp )
+		{
+			TextFeld *ret = tmp->getVal();
+			tmp->release();
+			return ret;
+		}
+		return new TextFeld();
+	}
+}
+
+Knopf *KSGSKlasseInstanz::getKnopf() const
+{
+	if( typ == KSGS_KNOPF )
+		return ( ( KSGSKnopfKlasse* )this )->getVal();
+	else
+	{
+		KSGSKnopfKlasse *tmp = (KSGSKnopfKlasse*)umwandelnIn( KSGS_KNOPF );
+		if( tmp )
+		{
+			Knopf *ret = tmp->getVal();
+			tmp->release();
+			return ret;
+		}
+		return new Knopf();
+	}
+}
+
+Fenster *KSGSKlasseInstanz::getFenster() const
+{
+	if( typ == KSGS_FENSTER )
+		return ( ( KSGSFensterKlasse* )this )->getVal();
+	else
+	{
+		KSGSFensterKlasse *tmp = (KSGSFensterKlasse*)umwandelnIn( KSGS_FENSTER );
+		if( tmp )
+		{
+			Fenster *ret = tmp->getVal();
+			tmp->release();
+			return ret;
+		}
+		return new Fenster();
+	}
+}
+
+BildZ *KSGSKlasseInstanz::getBildZ() const
+{
+	if( typ == KSGS_BILDO )
+		return ( ( KSGSBildZKlasse* )this )->getVal();
+	else
+	{
+		KSGSBildZKlasse *tmp = (KSGSBildZKlasse*)umwandelnIn( KSGS_BILDO );
+		if( tmp )
+		{
+			BildZ *ret = tmp->getVal();
+			tmp->release();
+			return ret;
+		}
+		return new BildZ();
+	}
+}
+
+Animation2DData *KSGSKlasseInstanz::getAnimation2DData() const
+{
+	if( typ == KSGS_ANIMATION2DDATA )
+		return ( ( KSGSAnimation2DDataKlasse* )this )->getVal();
+	else
+	{
+		KSGSAnimation2DDataKlasse *tmp = (KSGSAnimation2DDataKlasse*)umwandelnIn( KSGS_ANIMATION2DDATA );
+		if( tmp )
+		{
+			Animation2DData *ret = tmp->getVal();
+			tmp->release();
+			return ret;
+		}
+		return new Animation2DData();
+	}
+}
+
+Animation2D *KSGSKlasseInstanz::getAnimation2D() const
+{
+	if( typ == KSGS_ANIMATION2D )
+		return ( ( KSGSAnimation2DKlasse* )this )->getVal();
+	else
+	{
+		KSGSAnimation2DKlasse *tmp = (KSGSAnimation2DKlasse*)umwandelnIn( KSGS_ANIMATION2D );
+		if( tmp )
+		{
+			Animation2D *ret = tmp->getVal();
+			tmp->release();
+			return ret;
+		}
+		return new Animation2D();
+	}
+}
+
+Zeichnung *KSGSKlasseInstanz::getZeichnung() const
+{
+	switch( typ )
+	{
+	case KSGS_TEXTFELD:
+		return ((KSGSTextFeldKlasse*)this)->zVal();
+	case KSGS_KNOPF:
+		return ( ( KSGSKnopfKlasse* )this )->zVal();
+	case KSGS_FENSTER:
+		return ( ( KSGSFensterKlasse* )this )->zVal();
+	case KSGS_BILDO:
+		return ( ( KSGSBildZKlasse* )this )->zVal();
+	case KSGS_ANIMATION2D:
+		return ( ( KSGSAnimation2DKlasse* )this )->zVal();
+	}
+	return 0;
+}
+
+RCArray< KSGSVariable > *KSGSKlasseInstanz::getArray() const
+{
+	if( typ == KSGS_ARRAY )
+		return ( ( KSGSArrayKlasse* )this )->getVal();
+	else
+	{
+		KSGSArrayKlasse *tmp = (KSGSArrayKlasse*)umwandelnIn( KSGS_ARRAY );
+		if( tmp )
+		{
+			RCArray< KSGSVariable > *ret = tmp->getVal();
+			tmp->release();
+			return ret;
+		}
+		return new RCArray< KSGSVariable >();
+	}
+}
+
+// Reference Counting
+KSGSVariable *KSGSKlasseInstanz::getThis()
+{
+	ref++;
+	return this;
+}
+
+KSGSVariable *KSGSKlasseInstanz::release()
+{
+	ref--;
+	if( !ref )
+		delete this;
+	return 0;
+}
+
+// static
+KSGSVariable *KSGSKlasseInstanz::erstellVariable( KSGScriptObj *zObj, KSGSVariableDef *def )
+{
+	if( !def )
+	{
+		error( 0, {}, zObj );
+		return 0;
+	}
+	if( def->typId < KSGS_TYP_MIN )
+	{
+		error( 0, {}, zObj );
+		return 0;
+	}
+	if( def->typId <= KSGS_TYP_MAX )
+	{ // Vordefinierter Typ
+		switch( def->typId )
+		{
+		case KSGS_BOOL:
+			if( def->wert.istGleich( "true" ) )
+				return new KSGSBoolKlasse( zObj, 1 );
+			if( def->wert.istGleich( "false" ) )
+				return new KSGSBoolKlasse( zObj, 0 );
+			if( def->wert.getLength() )
+				return new KSGSBoolKlasse( zObj, ( int )def->wert != 0 );
+			return new KSGSBoolKlasse( zObj );
+		case KSGS_INT:
+			if( def->wert.getLength() )
+				return new KSGSIntKlasse( zObj, def->wert );
+			return new KSGSIntKlasse( zObj );
+		case KSGS_DOUBLE:
+			if( def->wert.getLength() )
+				return new KSGSDoubleKlasse( zObj, def->wert );
+			return new KSGSDoubleKlasse( zObj );
+		case KSGS_TEXT:
+			if( def->wert.getLength() )
+				return new KSGSTextKlasse( zObj, def->wert );
+			return new KSGSTextKlasse( zObj );
+		case KSGS_BILD:
+			return new KSGSBildKlasse( zObj );
+		case KSGS_MAUSEREIGNIS:
+			return new KSGSMausEreignisKlasse( zObj );
+		case KSGS_TASTATUREREIGNIS:
+			return new KSGSTastaturEreignisKlasse( zObj );
+		case KSGS_TEXTFELD:
+			return new KSGSTextFeldKlasse( zObj );
+		case KSGS_KNOPF:
+			return new KSGSKnopfKlasse( zObj );
+		case KSGS_FENSTER:
+			return new KSGSFensterKlasse( zObj );
+		case KSGS_BILDO:
+			return new KSGSBildZKlasse( zObj );
+		case KSGS_ANIMATION2DDATA:
+			return new KSGSAnimation2DDataKlasse( zObj );
+		case KSGS_ANIMATION2D:
+			return new KSGSAnimation2DKlasse( zObj );
+		default:
+			error( 1, {}, zObj );
+			break;
+		}
+		return 0;
+	}
+	else if( zObj ) // Im Script Definierter Typ
+		return zObj->erstellKlassenInstanz( def->typId );
+	error( 0, {}, zObj );
+	return 0;
+}
+
+
+// Inhalt der KSGSKlasse Klasse aus KSGSKlasse.h
+// Konstruktor
+KSGSKlasse::KSGSKlasse( int id )
+{
+	var = new Array< KSGSVariableDef* >();
+	funktionen = new RCArray< KSGSFunktion >();
+	this->id = id;
+	ref = 1;
+}
+
+// Destruktor
+KSGSKlasse::~KSGSKlasse()
+{
+	int anz = var->getEintragAnzahl();
+	for( int i = 0; i < anz; i++ )
+		delete var->get( i );
+	var->release();
+	funktionen->release();
+}
+
+// nicht constant
+void KSGSKlasse::addVariable( KSGSVariableDef *var )
+{
+	this->var->add( var );
+}
+
+void KSGSKlasse::addFunktion( KSGSFunktion *func )
+{
+	funktionen->add( func );
+}
+
+KSGSKlasseInstanz *KSGSKlasse::erstellInstanz( KSGScriptObj *zObj )
+{
+	return new KSGSKlasseInstanz( id, var, funktionen->getThis(), zObj );
+}
+
+// constant
+int KSGSKlasse::getId() const
+{
+	return id;
+}
+
+// Reference Counting
+KSGSKlasse *KSGSKlasse::getThis()
+{
+	ref++;
+	return this;
+}
+
+KSGSKlasse *KSGSKlasse::release()
+{
+	ref--;
+	if( !ref )
+		delete this;
+	return 0;
+}

+ 85 - 0
ksgScript/Befehl/KSGSKlasse.h

@@ -0,0 +1,85 @@
+#ifndef KSGSKlasse_H
+#define KSGSKlasse_H
+
+#include <Knopf.h>
+#include <Fenster.h>
+#include <Bild.h>
+#include <Animation.h>
+#include "KSGSFunktion.h"
+
+namespace KSGScript
+{
+	class KSGSKlasse; // aus dieser Datei
+
+	class KSGSKlasseInstanz
+	{
+	protected:
+		RCArray< KSGSVariable > *lokaleVariablen;
+		RCArray< KSGSFunktion > *funktionen;
+		Array< bool > *varPublic;
+		KSGScriptObj *obj;
+		int typ;
+		int ref;
+
+	public:
+		// Konstruktor
+		__declspec( dllexport ) KSGSKlasseInstanz( int typ, Array< KSGSVariableDef* > *zVars, RCArray< KSGSFunktion > *funcs, KSGScriptObj *zObj );
+		// Destruktor
+		__declspec( dllexport ) ~KSGSKlasseInstanz();
+		// nicht constant
+		__declspec( dllexport ) virtual KSGSVariable *startFunktion( int id, bool zugriff, RCArray< KSGSVariable > *parameter );
+		__declspec( dllexport ) virtual KSGSVariable *doOperator( int id, KSGSVariable *rechts );
+		__declspec( dllexport ) virtual void setVariable( int id, KSGSVariable *var );
+		// constant
+		__declspec( dllexport ) virtual KSGSVariable *getVariable( int id, bool zugriff ) const;
+		__declspec( dllexport ) virtual KSGSVariable *umwandelnIn( int typ ) const;
+		__declspec( dllexport ) virtual int getTyp() const;
+		// verarbeiten
+		__declspec( dllexport ) virtual bool getBool() const;
+		__declspec( dllexport ) virtual int getInt() const;
+		__declspec( dllexport ) virtual double getDouble() const;
+		__declspec( dllexport ) virtual Text *getText() const;
+		__declspec( dllexport ) virtual Bild *getBild() const;
+		__declspec( dllexport ) virtual MausEreignis getMausEreignis() const;
+		__declspec( dllexport ) virtual TastaturEreignis getTastaturEreignis() const;
+		__declspec( dllexport ) virtual TextFeld *getTextFeld() const;
+		__declspec( dllexport ) virtual Knopf *getKnopf() const;
+		__declspec( dllexport ) virtual Fenster *getFenster() const;
+		__declspec( dllexport ) virtual BildZ *getBildZ() const;
+		__declspec( dllexport ) virtual Animation2DData *getAnimation2DData() const;
+		__declspec( dllexport ) virtual Animation2D *getAnimation2D() const;
+		__declspec( dllexport ) virtual Zeichnung *getZeichnung() const;
+		__declspec( dllexport ) virtual RCArray< KSGSVariable > *getArray() const;
+		// Reference Counting
+		__declspec( dllexport ) virtual KSGSVariable *getThis();
+		__declspec( dllexport ) virtual KSGSVariable *release();
+		// static
+		__declspec( dllexport ) static KSGSVariable *erstellVariable( KSGScriptObj *zObj, KSGSVariableDef *def );
+	};
+
+	class KSGSKlasse
+	{
+	private:
+		Array< KSGSVariableDef* > *var;
+		RCArray< KSGSFunktion > *funktionen;
+		int id;
+		int ref;
+
+	public:
+		// Konstruktor
+		__declspec( dllexport ) KSGSKlasse( int id );
+		// Destruktor
+		__declspec( dllexport ) ~KSGSKlasse();
+		// nicht constant
+		__declspec( dllexport ) void addVariable( KSGSVariableDef *var );
+		__declspec( dllexport ) void addFunktion( KSGSFunktion *func );
+		__declspec( dllexport ) KSGSKlasseInstanz *erstellInstanz( KSGScriptObj *zObj );
+		// constant
+		__declspec( dllexport ) int getId() const;
+		// Reference Counting
+		__declspec( dllexport ) KSGSKlasse *getThis();
+		__declspec( dllexport ) KSGSKlasse *release();
+	};
+}
+
+#endif

+ 19 - 0
ksgScript/Befehl/KSGSVariable.h

@@ -0,0 +1,19 @@
+#ifndef KSGSVariable_H
+#define KSGSVariable_H
+
+#include <Text.h>
+
+using namespace Framework;
+
+namespace KSGScript
+{
+	struct KSGSVariableDef
+	{
+		int typId;
+		int id;
+		int sichtbar; // 0 = global, 1 = global in klasse, 2 = lokal in klasse, 3 = lokal in Funktion
+		Text wert;
+	};
+}
+
+#endif

+ 137 - 0
ksgScript/Error/Error.cpp

@@ -0,0 +1,137 @@
+#include "Error.h"
+#include "../Main/KSGScriptObj.h"
+#include <iostream>
+
+void KSGScript::error( int num, std::initializer_list< char* > msg, KSGScript::KSGScriptObj *zObj )
+{
+    Text logMsg;
+ 	switch( num )
+	{
+	case 0:
+        logMsg = "Warnung: Fehler beim erstellen einer Variable.";
+		break;
+	case 1:
+        logMsg = "Warnung: Eine Variable dieses Typs kann nicht erstellt werden.";
+		break;
+	case 2:
+        logMsg = "Warnung: Eine Variable mit unbekanntem Typ kann nicht erstellt werden.";
+		break;
+	case 3:
+        logMsg = "Warnung: NULL Zeiger beim ausführen eines Operators.";
+		break;
+	case 4:
+        logMsg = "Error: Die KSGScript Datei '";
+        logMsg += msg.begin()[ 0 ];
+        logMsg += "' konnte nicht geöffnet werden.";
+		break;
+	case 5:
+        logMsg = "Error: Die Datei '";
+        logMsg += msg.begin()[ 0 ];
+        logMsg += "' konnte nicht geladen werden. Unbekanntes Wort in Zeile '";
+        logMsg += msg.begin()[ 1 ];
+        logMsg += "'";
+		break;
+	case 6:
+        logMsg = "Error: Eine '";
+        logMsg += msg.begin()[ 0 ];
+        logMsg += "' aus der Datei '";
+        logMsg += msg.begin()[ 1 ];
+        logMsg += "' konnte nicht gelesen werden.";
+		break;
+	case 7:
+        logMsg = "Error: Compile Fehler in Datei '";
+        logMsg += msg.begin()[ 0 ];
+        logMsg += "' zeile '";
+        logMsg += msg.begin()[ 1 ];
+        logMsg += "' der Datentyp '";
+        logMsg += msg.begin()[ 2 ];
+        logMsg += "' ist bereits definiert.";
+		break;
+	case 8:
+        logMsg = "Error: Compile Fehler in Datei '";
+        logMsg += msg.begin()[ 0 ];
+        logMsg += "' zeile '";
+        logMsg += msg.begin()[ 1 ];
+        logMsg += "' die Funktion '";
+        logMsg += msg.begin()[ 2 ];
+        logMsg += "' ist bereits definiert.";
+		break;
+	case 9:
+        logMsg = "Error: Compile Fehler in Datei '";
+        logMsg += msg.begin()[ 0 ];
+        logMsg += "' zeile '";
+        logMsg += msg.begin()[ 1 ];
+        logMsg += "' die Variable '";
+        logMsg += msg.begin()[ 2 ];
+        logMsg += "' ist bereits definiert.";
+		break;
+	case 10:
+        logMsg = "Error: Unbekannter Fehler beim Compile Vorgang.";
+		break;
+	case 11:
+        logMsg = "Error: Compile Fehler in Datei '";
+        logMsg += msg.begin()[ 0 ];
+        logMsg += "' zeile '";
+        logMsg += msg.begin()[ 1 ];
+        logMsg += "' der Typ '";
+        logMsg += msg.begin()[ 2 ];
+        logMsg += "' der Variable '";
+        logMsg += msg.begin()[ 3 ];
+        logMsg += "' ist nicht definiert.";
+        break;
+	case 12:
+        logMsg = "Error: Compile Fehler in Datei '";
+        logMsg += msg.begin()[ 0 ];
+        logMsg += "' zeile '";
+        logMsg += msg.begin()[ 1 ];
+        logMsg += "' der Typ '";
+        logMsg += msg.begin()[ 2 ];
+        logMsg += "' der Funktion '";
+        logMsg += msg.begin()[ 3 ];
+        logMsg += "' ist nicht definiert.";
+		break;
+	case 13:
+        logMsg = "Error: Compile Fehler in Datei '";
+        logMsg += msg.begin()[ 0 ];
+        logMsg += "' zeile '";
+        logMsg += msg.begin()[ 1 ];
+        logMsg += "' der Befehl '";
+        logMsg += msg.begin()[ 2 ];
+        logMsg += "' konnte nicht ausgeweret werden.";
+		break;
+	case 14:
+        logMsg = "Warnung: Compile Warnung in Datei '";
+        logMsg += msg.begin()[ 0 ];
+        logMsg += "' zeile '";
+        logMsg += msg.begin()[ 1 ];
+        logMsg += "' die Anzahl der Argumente stimmt nicht mit der Funktion überein.";
+		break;
+	case 15:
+        logMsg = "Warnung: Der rückgabewert stimmt nicht mit dem Funktionstyp überein.";
+		break;
+	case 16:
+        logMsg = "Warnung: Fehler beim konvertieren einer Variable.";
+		break;
+	case 17:
+        logMsg = "Warnung: Zugriffsfehler auf private Variable.";
+		break;
+	case 18:
+        logMsg = "Warnung: Zugriffsfehler auf private Funktion.";
+		break;
+	case 19:
+        logMsg = "Warnung: Funktion konnte nicht gefunden werden.";
+		break;
+	case 20:
+        logMsg = "Warnung: Es wurden nicht alle Parameter für die Funktion angegeben.";
+		break;
+	case 21:
+        logMsg = "Warnung: Der Operator konnte nicht gefunden werden.";
+		break;
+	case 22:
+        logMsg = "Warnung: Ein Befehl konnte nicht richtig ausgeführt werden.";
+		break;
+	}
+    if( zObj )
+        zObj->logNachricht( logMsg );
+    std::cout << "KSGS " << (char*)logMsg << "\n";
+}

+ 32 - 0
ksgScript/Error/Error.h

@@ -0,0 +1,32 @@
+#include <initializer_list>
+
+namespace KSGScript
+{
+    class KSGScriptObj; // KSGScriptObj.h
+
+#define KSGS_WARNING_CreateVar 0
+#define KSGS_WARNING_CreateVarTyp 1
+#define KSGS_WARNING_CreateVarUnknownTyp 2
+#define KSGS_WARNING_OperatorNullPointer 3
+#define KSGS_ERROR_FileOpen 4
+#define KSGS_ERROR_FileParseWord 5
+#define KSGS_ERROR_FileParseX 6
+#define KSGS_ERROR_TypRedef 7
+#define KSGS_ERROR_FunktionRedef 8
+#define KSGS_ERROR_VariableRedef 9
+#define KSGS_ERROR_Compile 10
+#define KSGS_ERROR_CompileVarTyp 11
+#define KSGS_ERROR_CompileFunkTyp 12
+#define KSGS_ERROR_CompileOrder 13
+#define KSGS_WARNING_CompileArgumentCount 14
+#define KSGS_WARNING_CompileFuncReturnDiff 15
+#define KSGS_WARNING_ConvertVar 16
+#define KSGS_WARNING_NoAccessToPrivateVar 17
+#define KSGS_WARNING_NoAccessToPrivateFunk 18
+#define KSGS_WARNING_FunkNotFound 19
+#define KSGS_WARNING_FunkNotAllParams 20
+#define KSGS_WARNING_OperatorUndefined 21
+#define KSGS_WARNING_WrongExecutionOfOrder 22
+
+	__declspec( dllexport ) void error( int num, std::initializer_list< char* > msg, KSGScript::KSGScriptObj *zObj );
+}

+ 69 - 0
ksgScript/Funktionen/KSGSRückruf.cpp

@@ -0,0 +1,69 @@
+#include "KSGSRückruf.h"
+#include "../Klassen/KSGSTyp.h"
+#include "../Main/KSGScriptObj.h"
+#include "../Befehl/KSGSKlasse.h"
+
+using namespace KSGScript;
+
+// Inhalt der KSGSRückrufFInstanz Klasse aus KSGSRückruf.h
+// Konstruktor
+KSGSRückrufInstanz::KSGSRückrufInstanz( KSGScriptObj *obj )
+	: KSGSFunktionInstanz(new RCArray< KSGSBefehl >(), KSGS_VOID, obj, 0 )
+{
+	parameter = 0;
+}
+
+// Destruktor
+KSGSRückrufInstanz::~KSGSRückrufInstanz()
+{
+	if( parameter )
+		parameter->release();
+}
+
+// nicht constant
+void KSGSRückrufInstanz::setParameter( Array< KSGSVariableDef* > *zDef, RCArray< KSGSVariable > *vars )
+{
+	if( parameter )
+		parameter->release();
+	parameter = vars;
+}
+
+KSGSVariable *KSGSRückrufInstanz::startFunktion()
+{
+	return obj->rückruf( parameter ? parameter->getThis() : new RCArray< KSGSVariable >() );
+}
+
+// Reference Counting
+KSGSFunktionInstanz *KSGSRückrufInstanz::release()
+{
+	ref--;
+	if( !ref )
+		delete this;
+	return 0;
+}
+
+
+// Inhalt der KSGSRückrufFunktion Klasse aus KSGSRückruf.h
+// Konstruktor
+KSGSRückrufFunktion::KSGSRückrufFunktion()
+	: KSGSFunktion( 0, 0, KSGS_VOID )
+{
+}
+
+// nicht constant
+KSGSFunktionInstanz *KSGSRückrufFunktion::erstellInstanz( KSGScriptObj *obj, KSGSKlasseInstanz *klasse, RCArray< KSGSVariable > *params )
+{
+	KSGSRückrufInstanz *inst = new KSGSRückrufInstanz( obj );
+	if( params )
+		inst->setParameter( 0, params );
+	return inst;
+}
+
+// Reference Counting
+KSGSFunktion *KSGSRückrufFunktion::release()
+{
+	ref--;
+	if( !ref )
+		delete this;
+	return 0;
+}

+ 32 - 0
ksgScript/Funktionen/KSGSRückruf.h

@@ -0,0 +1,32 @@
+#include "../Befehl/KSGSFunktion.h"
+
+namespace KSGScript
+{
+	class KSGSRückrufInstanz : public KSGSFunktionInstanz
+	{
+	private:
+		RCArray< KSGSVariable > *parameter;
+
+	public:
+		// Konstruktor
+		__declspec( dllexport ) KSGSRückrufInstanz( KSGScriptObj *obj );
+		// Destruktor
+		__declspec( dllexport ) ~KSGSRückrufInstanz();
+		// nicht constant
+		__declspec( dllexport ) virtual void setParameter( Array< KSGSVariableDef* > *zDef, RCArray< KSGSVariable > *vars );
+		__declspec( dllexport ) virtual KSGSVariable *startFunktion();
+		// Reference Counting
+		__declspec( dllexport ) virtual KSGSFunktionInstanz *release();
+	};
+
+	class KSGSRückrufFunktion : public KSGSFunktion
+	{
+	public:
+		// Konstruktor
+		__declspec( dllexport ) KSGSRückrufFunktion();
+		// nicht constant
+		__declspec( dllexport ) virtual KSGSFunktionInstanz *erstellInstanz( KSGScriptObj *obj, KSGSKlasseInstanz *klasse, RCArray< KSGSVariable > *params );
+		// Reference Counting
+		__declspec( dllexport ) virtual KSGSFunktion *release();
+	};
+}

+ 370 - 0
ksgScript/Include/KSGSStandart.h

@@ -0,0 +1,370 @@
+#include <initializer_list>
+
+#define lesen( x )
+#define var
+#define func
+
+#define Rückruf( ... ) {}
+
+class Array
+{
+public:
+	void anhängen( ... );
+	void einfügen( int i, ... );
+	void set( int i, ... );
+	void setPosition( int i, int p );
+	void lösche( int i );
+	void tausche( int a, int b );
+	void leeren();
+	int getEintragAnzahl();
+	std::initializer_list get( int i );
+	bool hat( int i );
+};
+
+class Thread
+{
+public:
+	void pause();
+	void fortsetzen();
+	void ende();
+	bool läuft();
+	int warteAufThread( int zeit );
+};
+
+class Text
+{
+public:
+	Text();
+	Text( char *txt );
+	Text( int txt );
+	Text( double txt );
+	Text( bool txt );
+	void setSuchGrenzen( int, int );
+	void setText( Text t );
+	void anhängen( Text t );
+	void einfügen( int p, Text t );
+	void ersetzen( int beg, int end, Text t );
+	void löschen( int beg, int end );
+	int getLänge();
+	bool hat( Text t );
+	bool istGleich( Text t );
+	int anzahlVon( Text t );
+	int positionVon( Text t, int n );
+	Text getTeilText( int beg, int end );
+	Text operator+=( char* );
+};
+
+class Bild
+{
+public:
+	void neuBild( int br, int hö, int f );
+	void setAlpha( int a );
+	void releaseAlpha();
+	void alphaPixel( int x, int y, int f );
+	void setPixel( int x, int y, int f );
+	void alphaRegion( int x, int y, int br, int hö, int f );
+	void füllRegion( int x, int y, int br, int hö, int f );
+	void drawLinieAlpha( int xBeg, int yBeg, int xEnd, int yEnd, int f );
+	void drawLinie( int xBeg, int yBeg, int xEnd, int yEnd, int f );
+	void alphaBild( int x, int y, int br, int hö, Bild b );
+	void drawBild( int x, int y, int br, int hö, Bild b );
+	void alphaBild90( int x, int y, int br, int hö, Bild b );
+	void drawBild90( int x, int y, int br, int hö, Bild b );
+	void alphaBild180( int x, int y, int br, int hö, Bild b );
+	void drawBild180( int x, int y, int br, int hö, Bild b );
+	void alphaBild270( int x, int y, int br, int hö, Bild b );
+	void drawBild270( int x, int y, int br, int hö, Bild b );
+	bool setDrawOptions( int x, int y, int br, int hö );
+	bool setDrawOptionsErzwingen( int x, int y, int br, int hö );
+	bool addScrollOffset( int xScroll, int yScroll );
+	void releaseDrawOptions();
+	int getBreite();
+	int getHöhe();
+	int getPixel( int x, int y );
+};
+
+class MausEreignis
+{
+public:
+	int id;
+	int mx;
+	int my;
+	int rmx;
+	int rmy;
+	bool verarbeitet;
+	void setId( int id );
+	void setMx( int mx );
+	void setMy( int my );
+	void setRmx( int rmx );
+	void setRmy( int rmy );
+	void setVerarbeitet( bool verarbeitet );
+};
+
+class TastaturEreignis
+{
+public:
+	int id;
+	int taste;
+	bool verarbeitet;
+	void setId( int id );
+	void setTaste( int taste );
+	void setVerarbeitet( bool verarbeitet );
+};
+
+class TextFeld
+{
+public:
+	void setText( Text t );
+	void addZeile( Text t );
+	void setAuswahl( int beg, int end );
+	void setHintergrundBild( Bild b );
+	void setHintergrundFarbe( int f );
+	void setSchriftGröße( int gr );
+	void setSchriftFarbe( int f );
+	void setAFStärke( int s );
+	void setAFFarbe( int f );
+	void setLRBreite( int br );
+	void setLRFarbe( int f );
+	void setShowChar( int c );
+	void setVKlickScroll( int vks );
+	void setVScrollPosI( int sp );
+	void setVScrollZuZeile( int sl );
+	void updateVScroll();
+	void setStyle( int s );
+	void addStyle( int s );
+	void löscheStyle( int s );
+	bool tick( double z );
+	void setMausEreignis( Text fName );
+	void setTastaturEreignis( Text fName );
+	void doMausEreignis( MausEreignis me );
+	void doTastaturEreignis( TastaturEreignis te );
+	void render( Bild b );
+	Text getText();
+	Bild getHintergrundBild();
+	int getHintergrundFarbe();
+	int getSchriftGröße();
+	int getSchriftFarbe();
+	int getAFStärke();
+	int getAFFarbe();
+	int getLRBreite();
+	int getLRFarbe();
+	int getShowChar();
+	bool hatStyle( int s );
+	bool hatStyleNicht( int s );
+	TextFeld dublizieren();
+	void setToolTipText( Text t );
+	void setPosition( int x, int y );
+	void setGröße( int br, int hö );
+	int getBreite();
+	int getHöhe();
+	int getX();
+	int getY();
+	Text getToolTipText();
+	void setGrößeNachText();
+    void setTextNachGröße();
+};
+
+class Knopf
+{
+public:
+	void setText( Text t );
+	void setHintergrundBild( Bild b );
+	void setHintergrundFarbe( int f );
+	void setSchriftGröße( int gr );
+	void setSchriftFarbe( int f );
+	void setAFStärke( int s );
+	void setAFFarbe( int f );
+	void setLRBreite( int br );
+	void setLRFarbe( int f );
+	void setKlickFarbe( int f );
+	void setKlickBild( Bild b );
+	void setKBStärke( int s );
+	void setKBFarbe( int f );
+	void setStyle( int s );
+	void addStyle( int s );
+	void löscheStyle( int s );
+	bool tick( double z );
+	void setMausEreignis( Text fName );
+	void doMausEreignis( MausEreignis me );
+	void render( Bild b );
+	Text getText();
+	Bild getHintergrundBild();
+	int getHintergrundFarbe();
+	int getSchriftGröße();
+	int getSchriftFarbe();
+	int getAFStärke();
+	int getAFFarbe();
+	int getLRBreite();
+	int getLRFarbe();
+	int getKlickFarbe();
+	Bild getKlickBild();
+	int getKBFarbe();
+	int getKBStärke();
+	bool hatStyle( int s );
+	bool hatStyleNicht( int s );
+	Knopf dublizieren();
+	Text setToolTipText( Text t );
+	void setPosition( int x, int y );
+	void setGröße( int br, int hö );
+	int getBreite();
+	int getHöhe();
+	int getX();
+	int getY();
+	Text getToolTipText();
+};
+
+class Fenster
+{
+public:
+	void setRFarbe( int f );
+	void setRBreite( int br );
+	void setTitel( Text t );
+	void setTSFarbe( int f );
+	void setTSGröße( int gr );
+	void setTBgFarbe( int f );
+	void setTAfFarbe( int f );
+	void setTAfStärke( int s );
+	void setTBgBild( Bild b );
+	void setTRFarbe( int f );
+	void setTRBreite( int br );
+	void setKBgFarbe( int f );
+	void setKBgBild( Bild b );
+	void setKAfFarbe( int f );
+	void setKAfStärke( int s );
+	void setSBgFarbe( int f );
+	void setSBgBild( Bild b );
+	void setSAfFarbe( int f );
+	void setSAfStärke( int s );
+	void setSKAfFarbe( int f );
+	void setSKAfStärke( int s );
+	void setMin( int minBr, int minHö );
+	void setMax( int maxBr, int maxHö );
+	void setKMin( int minBr, int minHö );
+	void setKMax( int maxBr, int maxHö );
+	void setHSBMax( int maxSBr );
+	void setVSBMax( int maxHö );
+	void setHSBScroll( int sp );
+	void setVSBScroll( int sp );
+	void setStyle( int s );
+	void addStyle( int s );
+	void removeStyle( int s );
+	void addMember( .../* Zeichnung */ );
+	void removeMember( .../* Zeichnung */ );
+	bool tick( double z );
+	void setMausEreignis( Text fName );
+	void setTastaturEreignis( Text fName );
+	void doMausEreignis( MausEreignis me );
+	void doTastaturEreignis( TastaturEreignis te );
+	void render( Bild b );
+	int getRFarbe();
+	int getRBreite();
+	Text getTitel();
+	int getTSFarbe();
+	int getTSGröße();
+	int getTBgFarbe();
+	int getTAfFarbe();
+	int getTAfStärke();
+	Bild getTBgBild();
+	int getTRFarbe();
+	int getTRBreite();
+	int getKBgFarbe();
+	Bild getKBgBild();
+	int getKAfFarbe();
+	int getKAfStärke();
+	int getSBgFarbe();
+	Bild getSBgBild();
+	int getSAfFarbe();
+	int getSAfStärke();
+	int getSKAfFarbe();
+	int getSKAfStärke();
+	int getMinBreite();
+	int getMinHöhe();
+	int getMaxBreite();
+	int getMaxHöhe();
+	int getKMinBreite();
+	int getKMinHöhe();
+	int getKMaxBreite();
+	int getKMaxHöhe();
+	bool hatStyle( int s );
+	bool hatStyleNicht( int s );
+	Fenster dublizieren();
+	void setToolTipText( Text t );
+	void setPosition( int x, int y );
+	void setGröße( int br, int hö );
+	int getBreite();
+	int getHöhe();
+	int getX();
+	int getY();
+	Text getToolTipText();
+};
+
+class BildZ
+{
+public:
+	void setBild( Bild b );
+	void setRFarbe( int f );
+	void setRBreite( int br );
+	void setStyle( int s );
+	void addStyle( int s );
+	void löscheStyle( int s );
+	bool tick( double z );
+	void setMausEreignis( Text fName );
+	void doMausEreignis( MausEreignis me );
+	void render( Bild b );
+	Bild getBild();
+	bool hatStyle( int s );
+	bool hatStyleNicht( int s );
+	BildZ dublizieren();
+	void setToolTipText( Text t );
+	void setPosition( int x, int y );
+	void setGröße( int br, int hö );
+	int getBreite();
+	int getHöhe();
+	int getX();
+	int getY();
+	Text getToolTipText();
+};
+
+class Animation2DData
+{
+public:
+	void ladeAnimation( Text pf );
+	void setFPS( int fps );
+	void setWiederhohlend( bool w );
+	void setTransparent( bool t );
+	void reset();
+	Bild getBild( int n );
+	int getBildAnzahl();
+	int getFPS();
+	bool istWiederhohlend();
+	bool istTransparent();
+};
+
+class Animation2D
+{
+public:
+	void setRahmen( bool r );
+	void setRahmenBreite( int br );
+	void setRahmenFarbe( int f );
+	void setAnimationData( Animation2DData d );
+	void setAlphaMaske( int am );
+	void setAPS( int aps );
+	void setSichtbar( bool s );
+	bool tick( double z );
+	void render( Bild b );
+	Animation2DData getAnimationData();
+	bool istSichtbar();
+	int getJetzt();
+	int getAlphaMaske();
+	bool hatRahmen();
+	int getRahmenBreite();
+	int getRahmenFarbe();
+	void setToolTipText( Text t );
+	void setPosition( int x, int y );
+	void setGröße( int br, int hö );
+	int getBreite();
+	int getHöhe();
+	int getX();
+	int getY();
+	Text getToolTipText();
+};

+ 124 - 0
ksgScript/Include/KSGScript.h

@@ -0,0 +1,124 @@
+#ifndef KSGScriptObj_H
+#define KSGScriptObj_H
+
+#include <Array.h>
+#include <Text.h>
+#include <Zeichnung.h>
+#include "../Klassen/KSGSTyp.h"
+
+namespace Framework
+{
+	class Bild;
+	class TextFeld;
+	class Knopf;
+	class Fenster;
+	class BildZ;
+	class Animation2DData;
+	class Animation2D;
+	class Schrift;
+	class Text;
+    class TextFeld;
+}
+
+namespace KSGScript
+{
+	struct KSGSVariableDef
+	{
+		int typId;
+		int id;
+		int sichtbar; // 0 = global, 1 = global in klasse, 2 = lokal in klasse, 3 = lokal in Funktion
+		Framework::Text wert;
+	};
+
+	/*
+	* Vordefinition der KSGS Variable Klasse.
+	* Virtuelle Vordefinition der Klasse KSGSKlasseInstanz aus ../Befehl/KSGSKlasse.h
+	*/
+
+	class KSGSVariable
+	{
+	public:
+		// nicht constant
+		virtual KSGSVariable *startFunktion( int id, bool zugriff, Framework::RCArray< KSGSVariable > *parameter ) = 0;
+		virtual KSGSVariable *doOperator( int id, KSGSVariable *rechts ) = 0;
+		virtual void setVariable( int id, KSGSVariable *var ) = 0;
+		// constant
+		virtual KSGSVariable *getVariable( int id, bool zugriff ) const = 0;
+		virtual KSGSVariable *umwandelnIn( int typ ) const = 0;
+		virtual int getTyp() const = 0;
+		// verarbeiten
+		virtual bool getBool() const = 0;
+		virtual int getInt() const = 0;
+		virtual double getDouble() const = 0;
+		virtual Framework::Text *getText() const = 0;
+		virtual Framework::Bild *getBild() const = 0;
+		virtual Framework::MausEreignis getMausEreignis() const = 0;
+		virtual Framework::TastaturEreignis getTastaturEreignis() const = 0;
+		virtual Framework::TextFeld *getTextFeld() const = 0;
+		virtual Framework::Knopf *getKnopf() const = 0;
+		virtual Framework::Fenster *getFenster() const = 0;
+		virtual Framework::BildZ *getBildZ() const = 0;
+		virtual Framework::Animation2DData *getAnimation2DData() const = 0;
+		virtual Framework::Animation2D *getAnimation2D() const = 0;
+		virtual Framework::Zeichnung *getZeichnung() const = 0;
+		// Reference Counting
+		virtual KSGSVariable *getThis() = 0;
+		virtual KSGSVariable *release() = 0;
+	};
+
+
+	/*
+	* Vordefinition der KSGS Zeichnung Klasse.
+	* Virtuelle Vordefinition der Klasse KSGScriptObj aus ../Main/KSGScriptObj.h
+	*/
+
+	class KSGScriptObj : public Framework::Zeichnung
+	{
+	public:
+		// nicht constant
+		virtual void lock();
+		virtual void unlock();
+		virtual void setScriptDatei( const char *pfad ) = 0;
+		virtual void setScriptDatei( Framework::Text *pfad ) = 0;
+		virtual bool neuLaden() = 0;
+		virtual void zurücksetzen() = 0;
+		virtual void setRückrufParam( void *p ) = 0;
+		virtual void setRückrufFunktion( void( *funktion )( void *, Framework::RCArray< KSGSVariable > *, KSGSVariable ** ) ) = 0;
+		virtual void setSchriftZ( Framework::Schrift *s ) = 0;
+		virtual void setBildschirmZ( Framework::Bildschirm *s ) = 0;
+		virtual void doMausEreignis( Framework::MausEreignis &me ) = 0;
+		virtual void doTastaturEreignis( Framework::TastaturEreignis &te ) = 0;
+		virtual bool tick( double zeit ) = 0;
+		virtual void render( Framework::Bild &zRObj ) = 0;
+		virtual KSGSVariable *startFunktion( int id, Framework::RCArray< KSGSVariable > *parameter ) = 0;
+		virtual KSGSVariable *erstellKlassenInstanz( int id ) = 0;
+		virtual void setVariable( int id, KSGSVariable *var ) = 0;
+		virtual Framework::Text *convertPfad( char *pf ) = 0;
+        virtual void setLog( Framework::TextFeld *log ) = 0;
+        virtual void logNachricht( char *n ) = 0;
+		// constant
+		virtual KSGSVariable *rückruf( Framework::RCArray< KSGSVariable > *parameter ) const = 0;
+		virtual Framework::Text *getScriptDateiPfad() const = 0;
+		virtual Framework::Text *zScriptDateiPfad() const = 0;
+		virtual Framework::Schrift *getSchrift() const = 0;
+		virtual Framework::Schrift *zSchrift() const = 0;
+		virtual Framework::Bildschirm *getBildschirm() const = 0;
+		virtual Framework::Bildschirm *zBildschirm() const = 0;
+		virtual int getScriptId() const = 0;
+		virtual bool istBeendet( int scrId ) const = 0;
+		virtual int getFunktionId( const char *name ) const = 0;
+		virtual KSGSVariable *getVariable( int id ) const = 0;
+		// Reference Counting
+		virtual KSGScriptObj *getThis() = 0;
+		virtual KSGScriptObj *release() = 0;
+	};
+	// DLL Einstieg
+	typedef KSGScriptObj *( *KSGSGetZeichnung )( );
+	typedef KSGSVariable *( *KSGSGetVariable )( KSGScriptObj *zObj, KSGSVariableDef *def );
+	typedef void ( *KSGSSetBild )( KSGSVariable *zBv, Framework::Bild *b );
+}
+#define KSGS_START_FUNKTION "GetNewKSGScriptObj"
+#define KSGS_VARIABLE_FUNKTION "GetNewKSGSVariable"
+#define KSGS_SET_BILD_FUNKTION "SetKSGSBildVariable"
+
+#endif

+ 203 - 0
ksgScript/Klassen/KSGSAnimation2D.cpp

@@ -0,0 +1,203 @@
+#include "KSGSAnimation2D.h"
+#include "KSGSTyp.h"
+#include "../Error/Error.h"
+#include "../Main/KSGScriptObj.h"
+#include "KSGSMausEreignis.h"
+#include "KSGSInt.h"
+#include "KSGSBool.h"
+#include "KSGSAnimation2DData.h"
+#include <ToolTip.h>
+#include "KSGSText.h"
+
+using namespace KSGScript;
+
+// Inhalt der KSGSAnimation2DKlasse aus KSGSAnimaion2D
+// Konstruktor
+KSGSAnimation2DKlasse::KSGSAnimation2DKlasse( KSGScriptObj *zObj, Animation2D *std )
+	: KSGSKlasseInstanz( KSGS_ANIMATION2D, 0, 0, zObj )
+{
+	val = std;
+}
+
+// Destruktor
+KSGSAnimation2DKlasse::~KSGSAnimation2DKlasse()
+{
+	val->release();
+}
+
+// nicht constant
+KSGSVariable *KSGSAnimation2DKlasse::startFunktion( int id, bool access, RCArray< KSGSVariable > *parameter )
+{
+	KSGSVariable *ret = 0;
+	switch( id )
+	{
+	case 0: // void setRahmen( bool )
+		if( parameter->getEintragAnzahl() < 1 )
+			error( 20, {}, obj );
+		val->setRahmen( parameter->z( 0 ) ? parameter->z( 0 )->getBool() : 0 );
+		break;
+	case 1: // void setRahmenBreite( int )
+		if( parameter->getEintragAnzahl() < 1 )
+			error( 20, {}, obj );
+		val->setRahmenBreite( parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0 );
+		break;
+	case 2: // void setRahmenFarbe( int )
+		if( parameter->getEintragAnzahl() < 1 )
+			error( 20, {}, obj );
+		val->setRahmenFarbe( parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0 );
+		break;
+	case 3: // void setAnimationData( Animation2DData )
+		if( parameter->getEintragAnzahl() < 1 )
+			error( 20, {}, obj );
+		val->setAnimationDataZ( parameter->z( 0 ) ? parameter->z( 0 )->getAnimation2DData() : 0 );
+		break;
+	case 4: // void setAlphaMaske( int )
+		if( parameter->getEintragAnzahl() < 1 )
+			error( 20, {}, obj );
+		val->setAlphaMaske( parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0 );
+		break;
+	case 5: // void setAPS( int )
+		if( parameter->getEintragAnzahl() < 1 )
+			error( 20, {}, obj );
+		val->setAPS( parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0 );
+		break;
+	case 6: // void setSichtbar( bool )
+		if( parameter->getEintragAnzahl() < 1 )
+			error( 20, {}, obj );
+		val->setSichtbar( parameter->z( 0 ) ? parameter->z( 0 )->getBool() : 0 );
+		break;
+	case 7: // bool tick( double )
+		if( parameter->getEintragAnzahl() < 1 )
+			error( 20, {}, obj );
+		ret = new KSGSBoolKlasse( obj, val->tick( parameter->z( 0 ) ? parameter->z( 0 )->getDouble() : 0 ) );
+		break;
+	case 8: // void render( int, int, Bild )
+		if( 1 )
+		{
+			if( parameter->getEintragAnzahl() < 1 )
+				error( 20, {}, obj );
+			Bild *b = parameter->z( 0 ) ? parameter->z( 0 )->getBild() : 0;
+			if( b )
+			{
+				val->render( *b );
+				b->release();
+			}
+		}
+		break;
+	case 9: // Animation2DData getAnimationData()
+		if( val->zAnimationData() )
+		    ret = new KSGSAnimation2DDataKlasse( obj, val->getAnimationData() );
+		break;
+	case 10: // bool istSichtbar()
+		ret = new KSGSBoolKlasse( obj, val->istSichtbar() );
+		break;
+	case 11: // int getJetzt()
+		ret = new KSGSIntKlasse( obj, val->getJetzt() );
+		break;
+	case 12: // int getAlphaMaske()
+		ret = new KSGSIntKlasse( obj, val->getAlphaMaske() );
+		break;
+	case 13: // bool hatRahmen()
+		ret = new KSGSBoolKlasse( obj, val->hatRahmen() );
+		break;
+	case 14: // int getRahmenBreite()
+		ret = new KSGSIntKlasse( obj, val->getRahmenBreite() );
+		break;
+	case 15: // int getRahmenFarbe()
+		ret = new KSGSIntKlasse( obj, val->getRahmenFarbe() );
+		break;
+	case 16: // void setToolTipText( Text )
+		if( 1 )
+		{
+			if( parameter->getEintragAnzahl() < 1 )
+				error( 20, {}, obj );
+			Text *txt = parameter->z( 0 ) ? parameter->z( 0 )->getText() : 0;
+			val->setToolTipText( txt ? *txt : 0, obj->zBildschirm() );
+			if( txt )
+				txt->release();
+		}
+		break;
+	case 17: // void setPosition( int, int )
+		if( parameter->getEintragAnzahl() < 2 )
+			error( 20, {}, obj );
+		val->setPosition( parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0,
+						  parameter->z( 1 ) ? parameter->z( 1 )->getInt() : 0 );
+		break;
+	case 18: // void setGröße( int, int )
+		if( parameter->getEintragAnzahl() < 2 )
+			error( 20, {}, obj );
+		val->setSize( parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0,
+					   parameter->z( 1 ) ? parameter->z( 1 )->getInt() : 0 );
+		break;
+	case 19: // int getBreite()
+		ret = new KSGSIntKlasse( obj, val->getBreite() );
+		break;
+	case 20: // int getHöhe()
+		ret = new KSGSIntKlasse( obj, val->getHeight() );
+		break;
+	case 21: // int getX()
+		ret = new KSGSIntKlasse( obj, val->getX() );
+		break;
+	case 22: // int getY()
+		ret = new KSGSIntKlasse( obj, val->getY() );
+		break;
+	case 23: // Text getToolTipText()
+		if( 1 )
+		{
+			Text *txt = val->zToolTip() ? val->zToolTip()->zText() : 0;
+			ret = new KSGSTextKlasse( obj, txt ? *txt : "" );
+		}
+		break;
+	default: // unbekannt
+		error( 19, {}, obj );
+		break;
+	}
+	parameter->release();
+	return ret;
+}
+
+KSGSVariable *KSGSAnimation2DKlasse::doOperator( int id, KSGSVariable *rechts )
+{
+	if( !rechts )
+	{
+		error( 3, {}, obj );
+		return 0;
+	}
+	KSGSVariable *ret = 0;
+	switch( id )
+	{
+	case KSGS_O_SET:
+		if( 1 )
+		{
+			val->release();
+			val = rechts->getAnimation2D();
+			ret = getThis();
+		}
+		break;
+	}
+	if( !ret )
+		error( 21, {}, obj );
+	if( rechts )
+		rechts->release();
+	return ret;
+}
+
+// constant
+Animation2D *KSGSAnimation2DKlasse::getVal() const
+{
+	return val->getThis();
+}
+
+Animation2D *KSGSAnimation2DKlasse::zVal() const
+{
+	return val;
+}
+
+// Reference Counting
+KSGSVariable *KSGSAnimation2DKlasse::release()
+{
+	ref--;
+	if( !ref )
+		delete this;
+	return 0;
+}

+ 31 - 0
ksgScript/Klassen/KSGSAnimation2D.h

@@ -0,0 +1,31 @@
+#ifndef KSGSAnimation2D_H
+#define KSGSAnimation2D_H
+
+#include "../Befehl/KSGSKlasse.h"
+#include <Animation.h>
+#include <MausEreignis.h>
+
+namespace KSGScript
+{
+	class KSGSAnimation2DKlasse : public KSGSKlasseInstanz
+	{
+	private:
+		Animation2D *val;
+
+	public:
+		// Konstruktor
+		__declspec( dllexport ) KSGSAnimation2DKlasse( KSGScriptObj *zObj, Animation2D *std = new Animation2D() );
+		// Destruktor
+		__declspec( dllexport ) ~KSGSAnimation2DKlasse();
+		// nicht constant
+		__declspec( dllexport ) virtual KSGSVariable *startFunktion( int id, bool access, RCArray< KSGSVariable > *parameter ) override;
+		__declspec( dllexport ) virtual KSGSVariable *doOperator( int id, KSGSVariable *rechts ) override;
+		// constant
+		__declspec( dllexport ) virtual Animation2D *getVal() const;
+		__declspec( dllexport ) virtual Animation2D *zVal() const;
+		// Reference Counting
+		__declspec( dllexport ) virtual KSGSVariable *release() override;
+	};
+}
+
+#endif

+ 147 - 0
ksgScript/Klassen/KSGSAnimation2DData.cpp

@@ -0,0 +1,147 @@
+#include "KSGSAnimation2DData.h"
+#include "KSGSTyp.h"
+#include "../Error/Error.h"
+#include "../Main/KSGScriptObj.h"
+#include <DateiSystem.h>
+#include <InitDatei.h>
+#include "KSGSBild.h"
+#include "KSGSInt.h"
+#include "KSGSBool.h"
+
+using namespace KSGScript;
+
+// Inhalt der KSGSAnimation2DDataKlasse Klasse aus KSGSAnimation2DData.h
+// Konstruktor
+KSGSAnimation2DDataKlasse::KSGSAnimation2DDataKlasse( KSGScriptObj *zObj, Animation2DData *std )
+	: KSGSKlasseInstanz( KSGS_ANIMATION2DDATA, 0, 0, zObj )
+{
+	val = std;
+}
+
+// Destruktor
+KSGSAnimation2DDataKlasse::~KSGSAnimation2DDataKlasse()
+{
+	val->release();
+}
+
+// nicht constant
+KSGSVariable *KSGSAnimation2DDataKlasse::startFunktion( int id, bool access, RCArray< KSGSVariable > *parameter )
+{
+	KSGSVariable *ret = 0;
+	switch( id )
+	{
+	case 0: // void ladeAnimation( Text )
+		if( 1 )
+		{
+			if( parameter->getEintragAnzahl() < 1 )
+				error( 20, {}, obj );
+			Text *pf = parameter->z( 0 ) ? parameter->z( 0 )->getText() : 0;
+			Text *tmp = obj->convertPfad( *pf );
+			pf->release();
+			pf = tmp;
+			if( pf )
+			{
+				if( pf->hat( ".ltdb" ) && pf->positionVon( ".ltdb", pf->anzahlVon( ".ltdb" ) - 1 ) == pf->getLength() - 5 )
+				{
+					LTDBDatei *dat = new LTDBDatei();
+					dat->setDatei( pf );
+					dat->leseDaten( 0 );
+					val->ladeAnimation( dat );
+				}
+				else
+				{
+					InitDatei *dat = new InitDatei( pf );
+					dat->laden();
+					val->ladeAnimation( dat );
+				}
+			}
+		}
+		break;
+	case 1: // void setFPS( int )
+		if( parameter->getEintragAnzahl() < 1 )
+			error( 20, {}, obj );
+		val->setFPS( parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0 );
+		break;
+	case 2: // void setWiederhohlend( bool )
+		if( parameter->getEintragAnzahl() < 1 )
+			error( 20, {}, obj );
+		val->setWiederhohlend( parameter->z( 0 ) ? parameter->z( 0 )->getBool() : 0 );
+		break;
+	case 3: // void setTransparent( bool )
+		if( parameter->getEintragAnzahl() < 1 )
+			error( 20, {}, obj );
+		val->setTransparent( parameter->z( 0 ) ? parameter->z( 0 )->getBool() : 0 );
+		break;
+	case 4: // void reset()
+		val->reset();
+		break;
+	case 5: // Bild getBild( int )
+		if( parameter->getEintragAnzahl() < 1 )
+			error( 20, {}, obj );
+		ret = new KSGSBildKlasse( obj, val->getBild( parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0 ) );
+		break;
+	case 6: // int getBildAnzahl()
+		ret = new KSGSIntKlasse( obj, val->getBildAnzahl() );
+		break;
+	case 7: // int getFPS()
+		ret = new KSGSIntKlasse( obj, val->getFPS() );
+		break;
+	case 8: // bool istWiederhohlend()
+		ret = new KSGSBoolKlasse( obj, val->istWiederhohlend() );
+		break;
+	case 9: // bool istTransparent()
+		ret = new KSGSBoolKlasse( obj, val->istTransparent() );
+		break;
+	default: // unbekannt
+		error( 19, {}, obj );
+		break;
+	}
+	parameter->release();
+	return ret;
+}
+
+KSGSVariable *KSGSAnimation2DDataKlasse::doOperator( int id, KSGSVariable *rechts )
+{
+	if( !rechts )
+	{
+		error( 3, {}, obj );
+		return 0;
+	}
+	KSGSVariable *ret = 0;
+	switch( id )
+	{
+	case KSGS_O_SET:
+		if( 1 )
+		{
+			val->release();
+			val = rechts->getAnimation2DData();
+			ret = getThis();
+		}
+		break;
+	}
+	if( !ret )
+		error( 21, {}, obj );
+	if( rechts )
+		rechts->release();
+	return ret;
+}
+
+// constant
+Animation2DData *KSGSAnimation2DDataKlasse::getVal() const
+{
+	return val->getThis();
+}
+
+Animation2DData *KSGSAnimation2DDataKlasse::zVal() const
+{
+	return val;
+}
+
+// Reference Counting
+KSGSVariable *KSGSAnimation2DDataKlasse::release()
+{
+	ref--;
+	if( !ref )
+		delete this;
+	return 0;
+}

+ 30 - 0
ksgScript/Klassen/KSGSAnimation2DData.h

@@ -0,0 +1,30 @@
+#ifndef KSGSAnimation2DData_H
+#define KSGSAnimation2DData_H
+
+#include "../Befehl/KSGSKlasse.h"
+#include <Animation.h>
+
+namespace KSGScript
+{
+	class KSGSAnimation2DDataKlasse : public KSGSKlasseInstanz
+	{
+	private:
+		Animation2DData *val;
+
+	public:
+		// Konstruktor
+		__declspec( dllexport ) KSGSAnimation2DDataKlasse( KSGScriptObj *zObj, Animation2DData *std = new Animation2DData() );
+		// Destruktor
+		__declspec( dllexport ) ~KSGSAnimation2DDataKlasse();
+		// nicht constant
+		__declspec( dllexport ) virtual KSGSVariable *startFunktion( int id, bool access, RCArray< KSGSVariable > *parameter ) override;
+		__declspec( dllexport ) virtual KSGSVariable *doOperator( int id, KSGSVariable *rechts ) override;
+		// constant
+		__declspec( dllexport ) virtual Animation2DData *getVal() const;
+		__declspec( dllexport ) virtual Animation2DData *zVal() const;
+		// Reference Counting
+		__declspec( dllexport ) virtual KSGSVariable *release() override;
+	};
+}
+
+#endif

+ 131 - 0
ksgScript/Klassen/KSGSArray.cpp

@@ -0,0 +1,131 @@
+#include "KSGSArray.h"
+#include "../Klassen/KSGSTyp.h"
+#include "../Error/Error.h"
+#include "../Main/KSGScriptObj.h"
+#include "../Klassen/KSGSInt.h"
+#include "../Klassen/KSGSBool.h"
+
+using namespace KSGScript;
+
+// Inhalt der KSGSArrayKlasse Klasse aus KSGSArray.h
+// Konstruktor
+KSGSArrayKlasse::KSGSArrayKlasse( KSGScriptObj *zObj, RCArray< KSGSVariable > *std )
+	: KSGSKlasseInstanz( KSGS_ARRAY, 0, 0, zObj )
+{
+	val = std;
+}
+
+// Destruktor
+KSGSArrayKlasse::~KSGSArrayKlasse()
+{
+	val->release();
+}
+
+// nicht constant
+KSGSVariable *KSGSArrayKlasse::startFunktion( int id, bool access, RCArray< KSGSVariable > *parameter )
+{
+	KSGSVariable *ret = 0;
+	switch( id )
+	{
+	case 0: // void anhängen( ... )
+		if( parameter->getEintragAnzahl() < 1 )
+			error( 20, {}, obj );
+		val->add( parameter->get( 0 ) );
+		break;
+	case 1: // void einfügen( int, ... )
+		if( parameter->getEintragAnzahl() < 2 )
+			error( 20, {}, obj );
+		if( parameter->z( 0 ) )
+			val->add( parameter->get( 1 ), parameter->z( 0 )->getInt() );
+		break;
+	case 2: // void set( int, ... )
+		if( parameter->getEintragAnzahl() < 2 )
+			error( 20, {}, obj );
+		if( parameter->z( 0 ) )
+			val->set( parameter->get( 1 ), parameter->z( 0 )->getInt() );
+		break;
+	case 3: // void setPosition( int, int )
+		if( parameter->getEintragAnzahl() < 2 )
+			error( 20, {}, obj );
+		if( parameter->z( 0 ) && parameter->z( 1 ) )
+			val->setPosition( parameter->z( 0 )->getInt(), parameter->z( 1 )->getInt() );
+		break;
+	case 4: // void lösche( int )
+		if( parameter->getEintragAnzahl() < 1 )
+			error( 20, {}, obj );
+		if( parameter->z( 0 ) )
+			val->remove( parameter->z( 0 )->getInt() );
+		break;
+	case 5: // void tausche( int, int )
+		if( parameter->getEintragAnzahl() < 2 )
+			error( 20, {}, obj );
+		if( parameter->z( 0 ) && parameter->z( 1 ) )
+			val->tausch( parameter->z( 0 )->getInt(), parameter->z( 1 )->getInt() );
+		break;
+	case 6: // void leeren()
+		val->leeren();
+		break;
+	case 7: // int getEintragAnzahl()
+		ret = new KSGSIntKlasse( obj, val->getEintragAnzahl() );
+		break;
+	case 8: // ... get( int )
+		if( parameter->getEintragAnzahl() < 1 )
+			error( 20, {}, obj );
+		if( parameter->z( 0 ) )
+		    ret = val->get( parameter->z( 0 )->getInt() );
+		break;
+	case 9: // bool hat( int )
+		if( parameter->getEintragAnzahl() < 1 )
+			error( 20, {}, obj );
+		if( parameter->z( 0 ) )
+			ret = new KSGSBoolKlasse( obj, val->z( parameter->z( 0 )->getInt() ) != 0 );
+		break;
+	}
+	parameter->release();
+	return ret;
+}
+
+KSGSVariable *KSGSArrayKlasse::doOperator( int id, KSGSVariable *rechts )
+{
+	if( !rechts )
+	{
+		error( 3, {}, obj );
+		return 0;
+	}
+	KSGSVariable *ret = 0;
+	switch( id )
+	{
+	case KSGS_O_SET:
+		if( 1 )
+		{
+			val->release();
+			val = rechts->getArray();
+			ret = getThis();
+		}
+		break;
+	}
+	if( !ret )
+		error( 21, {}, obj );
+	rechts->release();
+	return ret;
+}
+
+// constant
+RCArray< KSGSVariable > *KSGSArrayKlasse::getVal() const
+{
+	return val->getThis();
+}
+
+RCArray< KSGSVariable > *KSGSArrayKlasse::zVal() const
+{
+	return val;
+}
+
+// Reference Counting
+KSGSVariable *KSGSArrayKlasse::release()
+{
+	ref--;
+	if( !ref )
+		delete this;
+	return 0;
+}

+ 30 - 0
ksgScript/Klassen/KSGSArray.h

@@ -0,0 +1,30 @@
+#ifndef KSGSArray_H
+#define KSGSArray_H
+
+#include "../Befehl/KSGSKlasse.h"
+#include <Array.h>
+
+namespace KSGScript
+{
+	class KSGSArrayKlasse : public KSGSKlasseInstanz
+	{
+	private:
+		RCArray< KSGSVariable > *val;
+
+	public:
+		// Konstruktor
+		__declspec( dllexport ) KSGSArrayKlasse( KSGScriptObj *zObj, RCArray< KSGSVariable > *std = new RCArray< KSGSVariable >() );
+		// Destruktor
+		__declspec( dllexport ) ~KSGSArrayKlasse();
+		// nicht constant
+		__declspec( dllexport ) virtual KSGSVariable *startFunktion( int id, bool access, RCArray< KSGSVariable > *parameter ) override;
+		__declspec( dllexport ) virtual KSGSVariable *doOperator( int id, KSGSVariable *rechts ) override;
+		// constant
+		__declspec( dllexport ) virtual RCArray< KSGSVariable > *getVal() const;
+		__declspec( dllexport ) virtual RCArray< KSGSVariable > *zVal() const;
+		// Reference Counting
+		__declspec( dllexport ) virtual KSGSVariable *release() override;
+	};
+}
+
+#endif

+ 327 - 0
ksgScript/Klassen/KSGSBild.cpp

@@ -0,0 +1,327 @@
+#include "KSGSBild.h"
+#include "KSGSTyp.h"
+#include "../Error/Error.h"
+#include <Punkt.h>
+#include "KSGSBool.h"
+#include "KSGSInt.h"
+
+using namespace KSGScript;
+
+// Inhalt der KSGSBildKlasse Klasse aus KSGSBild.h
+// Konstruktor
+KSGSBildKlasse::KSGSBildKlasse( KSGScriptObj *zObj, Bild *std )
+	: KSGSKlasseInstanz( KSGS_BILD, 0, 0, zObj )
+{
+	val = std;
+}
+
+// Destruktor
+KSGSBildKlasse::~KSGSBildKlasse()
+{
+	val->release();
+}
+
+// nicht constant
+void KSGSBildKlasse::set( Bild *b )
+{
+	if( val )
+		val->release();
+	val = b;
+}
+
+KSGSVariable *KSGSBildKlasse::startFunktion( int id, bool access, RCArray< KSGSVariable > *parameter )
+{
+	KSGSVariable *ret = 0;
+	switch( id )
+	{
+	case 0: // void neuBild( int, int, int )
+		if( parameter->getEintragAnzahl() < 3 )
+			error( 20, {}, obj );
+		val->neuBild( parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0,
+					  parameter->z( 1 ) ? parameter->z( 1 )->getInt() : 0,
+					  parameter->z( 2 ) ? parameter->z( 2 )->getInt() : 0 );
+		break;
+	case 1: // void setAlpha( int )
+		if( parameter->getEintragAnzahl() < 1 )
+			error( 20, {}, obj );
+		val->setAlpha( (unsigned char)( parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0 ) );
+		break;
+	case 2: // void releaseAlpha()
+		val->releaseAlpha();
+		break;
+	case 3: // void alphaPixel( int, int, int )
+		if( parameter->getEintragAnzahl() < 3 )
+			error( 20, {}, obj );
+		val->alphaPixelDP( parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0,
+						   parameter->z( 1 ) ? parameter->z( 1 )->getInt() : 0,
+						   parameter->z( 2 ) ? parameter->z( 2 )->getInt() : 0 );
+		break;
+	case 4: // void setPixel( int, int, int )
+		if( parameter->getEintragAnzahl() < 3 )
+			error( 20, {}, obj );
+		val->setPixelDP( parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0,
+						 parameter->z( 1 ) ? parameter->z( 1 )->getInt() : 0,
+						 parameter->z( 2 ) ? parameter->z( 2 )->getInt() : 0 );
+		break;
+	case 5: // void alphaRegion( int, int, int, int, int )
+		if( parameter->getEintragAnzahl() < 5 )
+			error( 20, {}, obj );
+		val->alphaRegion( parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0,
+						  parameter->z( 1 ) ? parameter->z( 1 )->getInt() : 0,
+						  parameter->z( 2 ) ? parameter->z( 2 )->getInt() : 0,
+						  parameter->z( 3 ) ? parameter->z( 3 )->getInt() : 0,
+						  parameter->z( 4 ) ? parameter->z( 4 )->getInt() : 0 );
+		break;
+	case 6: // void füllRegion( int, int, int, int, int )
+		if( parameter->getEintragAnzahl() < 5 )
+			error( 20, {}, obj );
+		val->fillRegion( parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0,
+						 parameter->z( 1 ) ? parameter->z( 1 )->getInt() : 0,
+						 parameter->z( 2 ) ? parameter->z( 2 )->getInt() : 0,
+						 parameter->z( 3 ) ? parameter->z( 3 )->getInt() : 0,
+						 parameter->z( 4 ) ? parameter->z( 4 )->getInt() : 0 );
+		break;
+	case 7: // void drawLinieAlpha( int, int, int, int, int )
+		if( parameter->getEintragAnzahl() < 5 )
+			error( 20, {}, obj );
+		val->drawLinieAlpha( Punkt( parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0,
+									parameter->z( 1 ) ? parameter->z( 1 )->getInt() : 0 ),
+							 Punkt( parameter->z( 2 ) ? parameter->z( 2 )->getInt() : 0,
+									parameter->z( 3 ) ? parameter->z( 3 )->getInt() : 0 ),
+							 parameter->z( 4 ) ? parameter->z( 4 )->getInt() : 0 );
+		break;
+	case 8: // void drawLinie( int, int, int, int, int )
+		if( parameter->getEintragAnzahl() < 5 )
+			error( 20, {}, obj );
+		val->drawLinie( Punkt( parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0,
+							   parameter->z( 1 ) ? parameter->z( 1 )->getInt() : 0 ),
+						Punkt( parameter->z( 2 ) ? parameter->z( 2 )->getInt() : 0,
+							   parameter->z( 3 ) ? parameter->z( 3 )->getInt() : 0 ),
+						parameter->z( 4 ) ? parameter->z( 4 )->getInt() : 0 );
+		break;
+	case 9: // void alphaBild( int, int, int, int, Bild )
+		if( 1 )
+		{
+			if( parameter->getEintragAnzahl() < 5 )
+				error( 20, {}, obj );
+			Bild *tmp = parameter->z( 4 ) ? parameter->z( 4 )->getBild() : new Bild();
+			if( tmp )
+			{
+				val->alphaBild( parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0,
+								parameter->z( 1 ) ? parameter->z( 1 )->getInt() : 0,
+								parameter->z( 2 ) ? parameter->z( 2 )->getInt() : 0,
+								parameter->z( 3 ) ? parameter->z( 3 )->getInt() : 0,
+								*tmp );
+				tmp->release();
+			}
+		}
+		break;
+	case 10: // void drawBild( int, int, int, int, Bild )
+		if( 1 )
+		{
+			if( parameter->getEintragAnzahl() < 5 )
+				error( 20, {}, obj );
+			Bild *tmp = parameter->z( 4 ) ? parameter->z( 4 )->getBild() : new Bild();
+			if( tmp )
+			{
+				val->drawBild( parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0,
+							   parameter->z( 1 ) ? parameter->z( 1 )->getInt() : 0,
+							   parameter->z( 2 ) ? parameter->z( 2 )->getInt() : 0,
+							   parameter->z( 3 ) ? parameter->z( 3 )->getInt() : 0,
+							   *tmp );
+				tmp->release();
+			}
+		}
+		break;
+	case 11: // void alphaBild90( int, int, int, int, Bild )
+		if( 1 )
+		{
+			if( parameter->getEintragAnzahl() < 5 )
+				error( 20, {}, obj );
+			Bild *tmp = parameter->z( 4 ) ? parameter->z( 4 )->getBild() : new Bild();
+			if( tmp )
+			{
+				val->alphaBild90( parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0,
+								  parameter->z( 1 ) ? parameter->z( 1 )->getInt() : 0,
+								  parameter->z( 2 ) ? parameter->z( 2 )->getInt() : 0,
+								  parameter->z( 3 ) ? parameter->z( 3 )->getInt() : 0,
+								  *tmp );
+				tmp->release();
+			}
+		}
+		break;
+	case 12: // void drawBild90( int, int, int, int, Bild )
+		if( 1 )
+		{
+			if( parameter->getEintragAnzahl() < 5 )
+				error( 20, {}, obj );
+			Bild *tmp = parameter->z( 4 ) ? parameter->z( 4 )->getBild() : new Bild();
+			if( tmp )
+			{
+				val->drawBild90( parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0,
+								 parameter->z( 1 ) ? parameter->z( 1 )->getInt() : 0,
+								 parameter->z( 2 ) ? parameter->z( 2 )->getInt() : 0,
+								 parameter->z( 3 ) ? parameter->z( 3 )->getInt() : 0,
+								 *tmp );
+				tmp->release();
+			}
+		}
+		break;
+	case 13: // void alphaBild180( int, int, int, int, Bild )
+		if( 1 )
+		{
+			if( parameter->getEintragAnzahl() < 5 )
+				error( 20, {}, obj );
+			Bild *tmp = parameter->z( 4 ) ? parameter->z( 4 )->getBild() : new Bild();
+			if( tmp )
+			{
+				val->alphaBild180( parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0,
+								   parameter->z( 1 ) ? parameter->z( 1 )->getInt() : 0,
+								   parameter->z( 2 ) ? parameter->z( 2 )->getInt() : 0,
+								   parameter->z( 3 ) ? parameter->z( 3 )->getInt() : 0,
+								   *tmp );
+				tmp->release();
+			}
+		}
+		break;
+	case 14: // void drawBild180( int, int, int, int, Bild )
+		if( 1 )
+		{
+			if( parameter->getEintragAnzahl() < 5 )
+				error( 20, {}, obj );
+			Bild *tmp = parameter->z( 4 ) ? parameter->z( 4 )->getBild() : new Bild();
+			if( tmp )
+			{
+				val->drawBild180( parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0,
+								  parameter->z( 1 ) ? parameter->z( 1 )->getInt() : 0,
+								  parameter->z( 2 ) ? parameter->z( 2 )->getInt() : 0,
+								  parameter->z( 3 ) ? parameter->z( 3 )->getInt() : 0,
+								  *tmp );
+				tmp->release();
+			}
+		}
+		break;
+	case 15: // void alphaBild270( int, int, int, int, Bild )
+		if( 1 )
+		{
+			if( parameter->getEintragAnzahl() < 5 )
+				error( 20, {}, obj );
+			Bild *tmp = parameter->z( 4 ) ? parameter->z( 4 )->getBild() : new Bild();
+			if( tmp )
+			{
+				val->alphaBild270( parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0,
+								   parameter->z( 1 ) ? parameter->z( 1 )->getInt() : 0,
+								   parameter->z( 2 ) ? parameter->z( 2 )->getInt() : 0,
+								   parameter->z( 3 ) ? parameter->z( 3 )->getInt() : 0,
+								   *tmp );
+				tmp->release();
+			}
+		}
+		break;
+	case 16: // void drawBild270( int, int, int, int, Bild )
+		if( 1 )
+		{
+			if( parameter->getEintragAnzahl() < 5 )
+				error( 20, {}, obj );
+			Bild *tmp = parameter->z( 4 ) ? parameter->z( 4 )->getBild() : new Bild();
+			if( tmp )
+			{
+				val->drawBild270( parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0,
+								  parameter->z( 1 ) ? parameter->z( 1 )->getInt() : 0,
+								  parameter->z( 2 ) ? parameter->z( 2 )->getInt() : 0,
+								  parameter->z( 3 ) ? parameter->z( 3 )->getInt() : 0,
+								  *tmp );
+				tmp->release();
+			}
+		}
+		break;
+	case 17: // bool setDrawOptions( int, int, int, int )
+		if( parameter->getEintragAnzahl() < 4 )
+			error( 20, {}, obj );
+		ret = new KSGSBoolKlasse( obj, val->setDrawOptions( parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0,
+															parameter->z( 1 ) ? parameter->z( 1 )->getInt() : 0,
+															parameter->z( 2 ) ? parameter->z( 2 )->getInt() : 0,
+															parameter->z( 3 ) ? parameter->z( 3 )->getInt() : 0 ) );
+		break;
+	case 18: // bool setDrawOptionsErzwingen( int, int, int, int )
+		if( parameter->getEintragAnzahl() < 4 )
+			error( 20, {}, obj );
+		ret = new KSGSBoolKlasse( obj, val->setDrawOptionsErzwingen( parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0,
+																	 parameter->z( 1 ) ? parameter->z( 1 )->getInt() : 0,
+																	 parameter->z( 2 ) ? parameter->z( 2 )->getInt() : 0,
+																	 parameter->z( 3 ) ? parameter->z( 3 )->getInt() : 0 ) );
+		break;
+	case 19: // void releaseDrawOptions()
+		val->releaseDrawOptions();
+		break;
+	case 20: // int getBreite()
+		ret = new KSGSIntKlasse( obj, val->getBreite() );
+		break;
+	case 21: // int getHöhe()
+		ret = new KSGSIntKlasse( obj, val->getHeight() );
+		break;
+	case 22: // int getPixel( int, int )
+		if( parameter->getEintragAnzahl() < 2 )
+			error( 20, {}, obj );
+		ret = new KSGSIntKlasse( obj, val->getPixel( parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0,
+													 parameter->z( 1 ) ? parameter->z( 1 )->getInt() : 0 ) );
+		break;
+	case 23: // void addScrollOffset( int, int )
+		if( parameter->getEintragAnzahl() < 2 )
+			error( 20, {}, obj );
+		val->addScrollOffset( parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0,
+							  parameter->z( 1 ) ? parameter->z( 1 )->getInt() : 0 );
+		break;
+	default: // unbekannt
+		error( 19, {}, obj );
+		break;
+	}
+	parameter->release();
+	return ret;
+}
+
+KSGSVariable *KSGSBildKlasse::doOperator( int id, KSGSVariable *rechts )
+{
+	if( !rechts )
+	{
+		error( 3, {}, obj );
+		return 0;
+	}
+	KSGSVariable *ret = 0;
+	switch( id )
+	{
+	case KSGS_O_SET:
+		if( 1 )
+		{
+			val->release();
+			val = rechts->getBild();
+			ret = getThis();
+		}
+		break;
+	}
+	if( !ret )
+		error( 21, {}, obj );
+	if( rechts )
+		rechts->release();
+	return ret;
+}
+
+// constant
+Bild *KSGSBildKlasse::getVal() const
+{
+	return val->getThis();
+}
+
+Bild *KSGSBildKlasse::zVal() const
+{
+	return val;
+}
+
+// Reference Counting
+KSGSVariable *KSGSBildKlasse::release()
+{
+	ref--;
+	if( !ref )
+		delete this;
+	return 0;
+}

+ 31 - 0
ksgScript/Klassen/KSGSBild.h

@@ -0,0 +1,31 @@
+#ifndef KSGSBild_H
+#define KSGSBild_H
+
+#include "../Befehl/KSGSKlasse.h"
+#include <Bild.h>
+
+namespace KSGScript
+{
+	class KSGSBildKlasse : public KSGSKlasseInstanz
+	{
+	private:
+		Bild *val;
+
+	public:
+		// Konstruktor
+		__declspec( dllexport ) KSGSBildKlasse( KSGScriptObj *zObj, Bild *std = new Bild() );
+		// Destruktor
+		__declspec( dllexport ) ~KSGSBildKlasse();
+		// nicht constant
+		__declspec( dllexport ) void set( Bild *b );
+		__declspec( dllexport ) virtual KSGSVariable *startFunktion( int id, bool access, RCArray< KSGSVariable > *parameter ) override;
+		__declspec( dllexport ) virtual KSGSVariable *doOperator( int id, KSGSVariable *rechts ) override;
+		// constant
+		__declspec( dllexport ) virtual Bild *getVal() const;
+		__declspec( dllexport ) virtual Bild *zVal() const;
+		// Reference Counting
+		__declspec( dllexport ) virtual KSGSVariable *release() override;
+	};
+}
+
+#endif

+ 240 - 0
ksgScript/Klassen/KSGSBildZ.cpp

@@ -0,0 +1,240 @@
+#include "KSGSBildZ.h"
+#include "KSGSMausEreignis.h"
+#include "../Main/KSGScriptObj.h"
+#include "../Error/Error.h"
+#include "KSGSTyp.h"
+#include "KSGSBool.h"
+#include "KSGSBild.h"
+#include <ToolTip.h>
+#include "KSGSText.h"
+#include "KSGSInt.h"
+
+using namespace KSGScript;
+
+// Inhalt der KSGSBildZKlasse Klasse aus KSGSBildZ.h
+// Konstruktor
+KSGSBildZKlasse::KSGSBildZKlasse( KSGScriptObj *zObj, BildZ *std )
+	: KSGSKlasseInstanz( KSGS_BILDO, 0, 0, zObj )
+{
+	val = std;
+	val->setMausEreignisParameter( this );
+	val->setMausEreignis( ksgsBildZME );
+	mausF = -1;
+}
+
+// Destruktor
+KSGSBildZKlasse::~KSGSBildZKlasse()
+{
+	val->release();
+}
+
+// nicht constant
+KSGSVariable *KSGSBildZKlasse::startFunktion( int id, bool access, RCArray< KSGSVariable > *parameter )
+{
+	KSGSVariable *ret = 0;
+	switch( id )
+	{
+	case 0: // void setBild( Bild )
+		if( parameter->getEintragAnzahl() < 1 )
+			error( 20, {}, obj );
+		val->setBild( parameter->z( 0 ) ? parameter->z( 0 )->getBild() : 0 );
+		break;
+	case 1: // void setRFarbe( int )
+		if( parameter->getEintragAnzahl() < 1 )
+			error( 20, {}, obj );
+		val->setLinienRahmenFarbe( parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0 );
+		break;
+	case 2: // void setRBreite( int )
+		if( parameter->getEintragAnzahl() < 1 )
+			error( 20, {}, obj );
+		val->setLinienRahmenBreite( parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0 );
+		break;
+	case 3: // void setStyle( int )
+		if( parameter->getEintragAnzahl() < 1 )
+			error( 20, {}, obj );
+		val->setStyle( parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0 );
+		break;
+	case 4: // void addStyle( int )
+		if( parameter->getEintragAnzahl() < 1 )
+			error( 20, {}, obj );
+		val->addStyle( parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0 );
+		break;
+	case 5: // void löscheStyle( int )
+		if( parameter->getEintragAnzahl() < 1 )
+			error( 20, {}, obj );
+		val->setStyle( parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0, 0 );
+		break;
+	case 6: // bool tick( double )
+		if( parameter->getEintragAnzahl() < 1 )
+			error( 20, {}, obj );
+		ret = new KSGSBoolKlasse( obj, val->tick( parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0 ) );
+		break;
+	case 7: // void setMausEreignis( Text )
+		if( 1 )
+		{
+			if( parameter->getEintragAnzahl() < 1 )
+				error( 20, {}, obj );
+			Text *n = parameter->z( 0 ) ? parameter->z( 0 )->getText() : 0;
+			if( n )
+			{
+				mausF = obj->getFunktionId( *n );
+				n->release();
+			}
+			else
+				mausF = -1;
+		}
+		break;
+	case 8: // void doMausEreignis( MausEreignis )
+		if( 1 )
+		{
+			if( parameter->getEintragAnzahl() < 1 )
+				error( 20, {}, obj );
+			MausEreignis me = parameter->z( 0 ) ? parameter->z( 0 )->getMausEreignis() : MausEreignis{ 0, 0, 0, 0, 0, 0 };
+			val->doMausEreignis( me );
+		}
+		break;
+	case 9: // void render( int, int, Bild )
+		if( 1 )
+		{
+			if( parameter->getEintragAnzahl() < 1 )
+				error( 20, {}, obj );
+			Bild *b = parameter->z( 0 ) ? parameter->z( 0 )->getBild() : 0;
+			if( b )
+			{
+				val->render( *b );
+				b->release();
+			}
+		}
+		break;
+	case 10: // Bild getBild()
+		ret = new KSGSBildKlasse( obj, val->getBild() );
+		break;
+	case 11: // bool hatStyle( int )
+		ret = new KSGSBoolKlasse( obj, val->hatStyle( parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0 ) );
+		break;
+	case 12: // bool hatStyleNicht( int )
+		ret = new KSGSBoolKlasse( obj, val->hatStyleNicht( parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0 ) );
+		break;
+	case 13: // BildZ dublizieren()
+		ret = new KSGSBildZKlasse( obj, (BildZ*)val->dublizieren() );
+		break;
+	case 14: // void setToolTipText( Text )
+		if( 1 )
+		{
+			if( parameter->getEintragAnzahl() < 1 )
+				error( 20, {}, obj );
+			Text *txt = parameter->z( 0 ) ? parameter->z( 0 )->getText() : 0;
+			val->setToolTipText( txt ? *txt : 0, obj->zBildschirm() );
+			if( txt )
+				txt->release();
+		}
+		break;
+	case 15: // void setPosition( int, int )
+		if( parameter->getEintragAnzahl() < 2 )
+			error( 20, {}, obj );
+		val->setPosition( parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0,
+						  parameter->z( 1 ) ? parameter->z( 1 )->getInt() : 0 );
+		break;
+	case 16: // void setGröße( int, int )
+		if( parameter->getEintragAnzahl() < 2 )
+			error( 20, {}, obj );
+		val->setSize( parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0,
+					   parameter->z( 1 ) ? parameter->z( 1 )->getInt() : 0 );
+		break;
+	case 17: // int getBreite()
+		ret = new KSGSIntKlasse( obj, val->getBreite() );
+		break;
+	case 18: // int getHöhe()
+		ret = new KSGSIntKlasse( obj, val->getHeight() );
+		break;
+	case 19: // int getX()
+		ret = new KSGSIntKlasse( obj, val->getX() );
+		break;
+	case 20: // int getY()
+		ret = new KSGSIntKlasse( obj, val->getY() );
+		break;
+	case 21: // Text getToolTipText()
+		if( 1 )
+		{
+			Text *txt = val->zToolTip() ? val->zToolTip()->zText() : 0;
+			ret = new KSGSTextKlasse( obj, txt ? *txt : "" );
+		}
+		break;
+	default: // unbekannt
+		error( 19, {}, obj );
+		break;
+	}
+	parameter->release();
+	return ret;
+}
+
+KSGSVariable *KSGSBildZKlasse::doOperator( int id, KSGSVariable *rechts )
+{
+	if( !rechts )
+	{
+		error( 3, {}, obj );
+		return 0;
+	}
+	KSGSVariable *ret = 0;
+	switch( id )
+	{
+	case KSGS_O_SET:
+		if( 1 )
+		{
+			val->release();
+			val = rechts->getBildZ();
+			ret = getThis();
+		}
+		break;
+	}
+	if( !ret )
+		error( 21, {}, obj );
+	if( rechts )
+		rechts->release();
+	return ret;
+}
+
+bool KSGSBildZKlasse::doMausEreignis( MausEreignis &me )
+{
+	if( mausF < 0 )
+		return 1;
+	RCArray< KSGSVariable > *parameter = new RCArray< KSGSVariable >();
+	parameter->add( new KSGSMausEreignisKlasse( obj, me ) );
+	KSGSVariable *ret = obj->startFunktion( mausF, parameter );
+	if( ret )
+	{
+		bool r = ret->getBool();
+		ret->release();
+		return r;
+	}
+	return 1;
+}
+
+// constant
+BildZ *KSGSBildZKlasse::getVal() const
+{
+	return val->getThis();
+}
+
+BildZ *KSGSBildZKlasse::zVal() const
+{
+	return val;
+}
+
+// Reference Counting
+KSGSVariable *KSGSBildZKlasse::release()
+{
+	ref--;
+	if( !ref )
+		delete this;
+	return 0;
+}
+
+
+// Ereignisse
+bool KSGScript::ksgsBildZME( void *var, void *obj, MausEreignis me )
+{
+	if( !var )
+		return 1;
+	return ( (KSGSBildZKlasse*)var )->doMausEreignis( me );
+}

+ 36 - 0
ksgScript/Klassen/KSGSBildZ.h

@@ -0,0 +1,36 @@
+#ifndef KSGSBildZ_H
+#define KSGSBildZ_H
+
+#include "../Befehl/KSGSKlasse.h"
+#include <Bild.h>
+#include <MausEreignis.h>
+
+namespace KSGScript
+{
+	class KSGSBildZKlasse : public KSGSKlasseInstanz
+	{
+	private:
+		BildZ *val;
+		int mausF;
+
+	public:
+		// Konstruktor
+		__declspec( dllexport ) KSGSBildZKlasse( KSGScriptObj *zObj, BildZ *std = new BildZ() );
+		// Destruktor
+		__declspec( dllexport ) ~KSGSBildZKlasse();
+		// nicht constant
+		__declspec( dllexport ) virtual KSGSVariable *startFunktion( int id, bool access, RCArray< KSGSVariable > *parameter ) override;
+		__declspec( dllexport ) virtual KSGSVariable *doOperator( int id, KSGSVariable *rechts ) override;
+		__declspec( dllexport ) virtual bool doMausEreignis( MausEreignis &me );
+		// constant
+		__declspec( dllexport ) virtual BildZ *getVal() const;
+		__declspec( dllexport ) virtual BildZ *zVal() const;
+		// Reference Counting
+		__declspec( dllexport ) virtual KSGSVariable *release() override;
+	};
+
+	// Ereignisse
+	__declspec( dllexport ) bool ksgsBildZME( void *var, void *obj, MausEreignis me );
+}
+
+#endif

+ 145 - 0
ksgScript/Klassen/KSGSBool.cpp

@@ -0,0 +1,145 @@
+#include "KSGSBool.h"
+#include "KSGSTyp.h"
+#include "../Error/Error.h"
+#include "KSGSInt.h"
+#include "KSGSDouble.h"
+#include "KSGSText.h"
+
+using namespace KSGScript;
+
+// Inhalt der KSGSBoolKlasse Klasse aus KSGSBool.h
+// Konstruktor
+KSGSBoolKlasse::KSGSBoolKlasse( KSGScriptObj *zObj, bool std )
+	: KSGSKlasseInstanz( KSGS_BOOL, 0, 0, zObj )
+{
+	val = std;
+}
+
+// Destruktor
+KSGSBoolKlasse::~KSGSBoolKlasse()
+{
+
+}
+
+// nicht constant
+KSGSVariable *KSGSBoolKlasse::doOperator( int id, KSGSVariable *rechts )
+{
+	if( !rechts && id != KSGS_O_NICHT && id != KSGS_O_MINUS1 && id != KSGS_O_PLUS1 )
+	{
+		if( rechts )
+			rechts->release();
+		error( 3, {}, obj );
+		return 0;
+	}
+	KSGSVariable *ret = 0;
+	switch( id )
+	{
+	case KSGS_O_SET:
+		val = rechts->getBool();
+		ret = getThis();
+		break;
+	case KSGS_O_PLUSSET:
+		val = ( val + rechts->getBool() ) != 0;
+		ret = getThis();
+		break;
+	case KSGS_O_MINUSSET:
+		val = ( val - rechts->getBool() ) != 0;
+		ret = getThis();
+		break;
+	case KSGS_O_MAHLSET:
+		val = ( val * rechts->getBool() ) != 0;
+		ret = getThis();
+		break;
+	case KSGS_O_UNDSET:
+		val &= rechts->getBool();
+		ret = getThis();
+		break;
+	case KSGS_O_ODERSET:
+		val |= rechts->getBool();
+		ret = getThis();
+		break;
+	case KSGS_O_GLEICH:
+		ret = new KSGSBoolKlasse( obj, val == rechts->getBool() );
+		break;
+	case KSGS_O_KLEINERGLEICH:
+		ret = new KSGSBoolKlasse( obj, val <= rechts->getBool() );
+		break;
+	case KSGS_O_GRÖßERGLEICH:
+		ret = new KSGSBoolKlasse( obj, val >= rechts->getBool() );
+		break;
+	case KSGS_O_UNGLEICH:
+		ret = new KSGSBoolKlasse( obj, val != rechts->getBool() );
+		break;
+	case KSGS_O_KLEINER:
+		ret = new KSGSBoolKlasse( obj, val < rechts->getBool() );
+		break;
+	case KSGS_O_GRÖßER:
+		ret = new KSGSBoolKlasse( obj, val > rechts->getBool() );
+		break;
+	case KSGS_O_ODER:
+		ret = new KSGSBoolKlasse( obj, val || rechts->getBool() );
+		break;
+	case KSGS_O_UND:
+		ret = new KSGSBoolKlasse( obj, val && rechts->getBool() );
+		break;
+	case KSGS_O_BITODER:
+		ret = new KSGSBoolKlasse( obj, val | rechts->getBool() );
+		break;
+	case KSGS_O_BITUND:
+		ret = new KSGSBoolKlasse( obj, val & rechts->getBool() );
+		break;
+	case KSGS_O_PLUS:
+		ret = new KSGSBoolKlasse( obj, ( val + rechts->getBool() ) != 0 );
+		break;
+	case KSGS_O_MINUS:
+		ret = new KSGSBoolKlasse( obj, ( val - rechts->getBool() ) != 0 );
+		break;
+	case KSGS_O_MAHL:
+		ret = new KSGSBoolKlasse( obj, ( val * rechts->getBool() ) != 0 );
+		break;
+	case KSGS_O_PLUS1:
+		ret = new KSGSBoolKlasse( obj, val++ != 0 );
+		break;
+	case KSGS_O_MINUS1:
+		ret = new KSGSBoolKlasse( obj, ( val - 1 ) != 0 );
+		break;
+	case KSGS_O_NICHT:
+		ret = new KSGSBoolKlasse( obj, !val );
+		break;
+	}
+	if( !ret )
+		error( 21, {}, obj );
+	if( rechts )
+		rechts->release();
+	return ret;
+}
+
+// constant
+bool KSGSBoolKlasse::getVal() const
+{
+	return val;
+}
+
+KSGSVariable *KSGSBoolKlasse::umwandelnIn( int typ ) const
+{
+	switch( typ )
+	{
+	case KSGS_INT:
+		return new KSGSIntKlasse( obj, val );
+	case KSGS_DOUBLE:
+		return new KSGSDoubleKlasse( obj, val );
+	case KSGS_TEXT:
+		return new KSGSTextKlasse( obj, Text() += (int)val );
+	}
+	error( 16, {}, obj );
+	return 0;
+}
+
+// Reference Counting
+KSGSVariable *KSGSBoolKlasse::release()
+{
+	ref--;
+	if( !ref )
+		delete this;
+	return 0;
+}

+ 28 - 0
ksgScript/Klassen/KSGSBool.h

@@ -0,0 +1,28 @@
+#ifndef KSGSBool_H
+#define KSGSBool_H
+
+#include "../Befehl/KSGSKlasse.h"
+
+namespace KSGScript
+{
+	class KSGSBoolKlasse : public KSGSKlasseInstanz
+	{
+	private:
+		bool val;
+
+	public:
+		// Konstruktor
+		__declspec( dllexport ) KSGSBoolKlasse( KSGScriptObj *zObj, bool std = 0 );
+		// Destruktor
+		__declspec( dllexport ) ~KSGSBoolKlasse();
+		// nicht constant
+		__declspec( dllexport ) virtual KSGSVariable *doOperator( int id, KSGSVariable *rechts ) override;
+		// constant
+		__declspec( dllexport ) virtual bool getVal() const;
+		__declspec( dllexport ) virtual KSGSVariable *umwandelnIn( int typ ) const override;
+		// Reference Counting
+		__declspec( dllexport ) virtual KSGSVariable *release() override;
+	};
+}
+
+#endif

+ 169 - 0
ksgScript/Klassen/KSGSDouble.cpp

@@ -0,0 +1,169 @@
+#include "KSGSDouble.h"
+#include "KSGSTyp.h"
+#include "../Error/Error.h"
+#include "KSGSBool.h"
+#include "KSGSInt.h"
+#include "KSGSText.h"
+
+using namespace KSGScript;
+
+// Inhalt der KSGSDoubleKlasse Klasse aus KSGSDouble.h
+// Konstruktor
+KSGSDoubleKlasse::KSGSDoubleKlasse( KSGScriptObj *zObj, double std )
+	: KSGSKlasseInstanz( KSGS_DOUBLE, 0, 0, zObj )
+{
+	val = std;
+}
+
+// Destruktor
+KSGSDoubleKlasse::~KSGSDoubleKlasse()
+{
+
+}
+
+// nicht constant
+void KSGSDoubleKlasse::set( double d )
+{
+	val = d;
+}
+
+KSGSVariable *KSGSDoubleKlasse::doOperator( int id, KSGSVariable *rechts )
+{
+	if( !rechts && id != KSGS_O_NICHT && id != KSGS_O_MINUS1 && id != KSGS_O_PLUS1 && id != KSGS_O_BITNICHT )
+	{
+		if( rechts )
+			rechts->release();
+		error( 3, {}, obj );
+		return 0;
+	}
+	KSGSVariable *ret = 0;
+	switch( id )
+	{
+	case KSGS_O_SET:
+		val = rechts->getDouble();
+		ret = getThis();
+		break;
+	case KSGS_O_PLUSSET:
+		val += rechts->getDouble();
+		ret = getThis();
+		break;
+	case KSGS_O_MINUSSET:
+		val -= rechts->getDouble();
+		ret = getThis();
+		break;
+	case KSGS_O_MAHLSET:
+		val *= rechts->getDouble();
+		ret = getThis();
+		break;
+	case KSGS_O_GETEILTSET:
+		val /= rechts->getDouble();
+		ret = getThis();
+		break;
+	case KSGS_O_UNDSET:
+		val = (int)val & rechts->getInt();
+		ret = getThis();
+		break;
+	case KSGS_O_ODERSET:
+		val = (int)val | rechts->getInt();
+		ret = getThis();
+		break;
+	case KSGS_O_GLEICH:
+		ret = new KSGSBoolKlasse( obj, val == rechts->getDouble() );
+		break;
+	case KSGS_O_KLEINERGLEICH:
+		ret = new KSGSBoolKlasse( obj, val <= rechts->getDouble() );
+		break;
+	case KSGS_O_GRÖßERGLEICH:
+		ret = new KSGSBoolKlasse( obj, val >= rechts->getDouble() );
+		break;
+	case KSGS_O_UNGLEICH:
+		ret = new KSGSBoolKlasse( obj, val != rechts->getDouble() );
+		break;
+	case KSGS_O_KLEINER:
+		ret = new KSGSBoolKlasse( obj, val < rechts->getDouble() );
+		break;
+	case KSGS_O_GRÖßER:
+		ret = new KSGSBoolKlasse( obj, val > rechts->getDouble() );
+		break;
+	case KSGS_O_ODER:
+		ret = new KSGSBoolKlasse( obj, val || rechts->getDouble() );
+		break;
+	case KSGS_O_UND:
+		ret = new KSGSBoolKlasse( obj, val && rechts->getDouble() );
+		break;
+	case KSGS_O_BITODER:
+		ret = new KSGSDoubleKlasse( obj, (int)val | rechts->getInt() );
+		break;
+	case KSGS_O_BITUND:
+		ret = new KSGSDoubleKlasse( obj, (int)val & rechts->getInt() );
+		break;
+	case KSGS_O_PLUS:
+		ret = new KSGSDoubleKlasse( obj, val + rechts->getDouble() );
+		break;
+	case KSGS_O_MINUS:
+		ret = new KSGSDoubleKlasse( obj, val - rechts->getDouble() );
+		break;
+	case KSGS_O_MAHL:
+		ret = new KSGSDoubleKlasse( obj, val * rechts->getDouble() );
+		break;
+	case KSGS_O_GETEILT:
+		ret = new KSGSDoubleKlasse( obj, val / rechts->getDouble() );
+		break;
+	case KSGS_O_REST:
+		ret = new KSGSDoubleKlasse( obj, (int)val % rechts->getInt() );
+		break;
+	case KSGS_O_PLUS1:
+		ret = new KSGSDoubleKlasse( obj, val++ );
+		break;
+	case KSGS_O_MINUS1:
+		ret = new KSGSDoubleKlasse( obj, val-- );
+		break;
+	case KSGS_O_NICHT:
+		ret = new KSGSDoubleKlasse( obj, !val );
+		break;
+	case KSGS_O_BITNICHT:
+		ret = new KSGSDoubleKlasse( obj, ~(int)val );
+		break;
+	case KSGS_O_NACHLINKS:
+		ret = new KSGSDoubleKlasse( obj, (int)val << rechts->getInt() );
+		break;
+	case KSGS_O_NACHRECHTS:
+		ret = new KSGSDoubleKlasse( obj, (int)val >> rechts->getInt() );
+		break;
+	}
+	if( !ret )
+		error( 21, {}, obj );
+	if( rechts )
+		rechts->release();
+	return ret;
+}
+
+// constant
+double KSGSDoubleKlasse::getVal() const
+{
+	return val;
+}
+
+KSGSVariable *KSGSDoubleKlasse::umwandelnIn( int typ ) const
+{
+	switch( typ )
+	{
+	case KSGS_BOOL:
+		return new KSGSBoolKlasse( obj, val != 0 );
+	case KSGS_INT:
+		return new KSGSIntKlasse( obj, (int)val );
+	case KSGS_TEXT:
+		return new KSGSTextKlasse( obj, Text() += val );
+	}
+	error( 16, {}, obj );
+	return 0;
+}
+
+// Reference Counting
+KSGSVariable *KSGSDoubleKlasse::release()
+{
+	ref--;
+	if( !ref )
+		delete this;
+	return 0;
+}

+ 29 - 0
ksgScript/Klassen/KSGSDouble.h

@@ -0,0 +1,29 @@
+#ifndef KSGSDouble_H
+#define KSGSDouble_H
+
+#include "../Befehl/KSGSKlasse.h"
+
+namespace KSGScript
+{
+	class KSGSDoubleKlasse : public KSGSKlasseInstanz
+	{
+	private:
+		double val;
+
+	public:
+		// Konstruktor
+		__declspec( dllexport ) KSGSDoubleKlasse( KSGScriptObj *zObj, double std = 0 );
+		// Destruktor
+		__declspec( dllexport ) ~KSGSDoubleKlasse();
+		// nicht constant
+		__declspec( dllexport ) void set( double d );
+		__declspec( dllexport ) virtual KSGSVariable *doOperator( int id, KSGSVariable *rechts ) override;
+		// constant
+		__declspec( dllexport ) virtual double getVal() const;
+		__declspec( dllexport ) virtual KSGSVariable *umwandelnIn( int typ ) const override;
+		// Reference Counting
+		__declspec( dllexport ) virtual KSGSVariable *release() override;
+	};
+}
+
+#endif

+ 536 - 0
ksgScript/Klassen/KSGSFenster.cpp

@@ -0,0 +1,536 @@
+#include "KSGSFenster.h"
+#include "KSGSTyp.h"
+#include "../Error/Error.h"
+#include "../Main/KSGScriptObj.h"
+#include "KSGSMausEreignis.h"
+#include "KSGSTastaturEreignis.h"
+#include "KSGSBool.h"
+#include "KSGSText.h"
+#include "KSGSInt.h"
+#include "KSGSBild.h"
+#include <Punkt.h>
+#include <ToolTip.h>
+
+using namespace KSGScript;
+
+// Inahlt der KSGSFensterKlasse Klasse aus KSGSFenster.h
+// Konstruktor
+KSGSFensterKlasse::KSGSFensterKlasse( KSGScriptObj *zObj, Fenster *std )
+	: KSGSKlasseInstanz( KSGS_FENSTER, 0, 0, zObj )
+{
+	val = std;
+	val->setMausEreignisParameter( this );
+	val->setMausEreignis( ksgsFensterME );
+	val->setTastaturEreignisParameter( this );
+	val->setTastaturEreignis( ksgsFensterTE );
+	if( zObj->zSchrift() )
+		val->setTSchriftZ( zObj->getSchrift() );
+	mausF = -1;
+	tastaturF = -1;
+}
+
+// Destruktor
+KSGSFensterKlasse::~KSGSFensterKlasse()
+{
+	val->release();
+}
+
+// nicht constant
+KSGSVariable *KSGSFensterKlasse::startFunktion( int id, bool access, RCArray< KSGSVariable > *parameter )
+{
+	KSGSVariable *ret = 0;
+	switch( id )
+	{
+	case 0: // void setRFarbe( int )
+		if( parameter->getEintragAnzahl() < 1 )
+			error( 20, {}, obj );
+		val->setRFarbe( parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0 );
+		break;
+	case 1: // void setRBreite( int )
+		if( parameter->getEintragAnzahl() < 1 )
+			error( 20, {}, obj );
+		val->setRBreite( parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0 );
+		break;
+	case 2: // void setTitel( Text )
+		if( parameter->getEintragAnzahl() < 1 )
+			error( 20, {}, obj );
+		val->setTitel( parameter->z( 0 ) ? parameter->z( 0 )->getText() : new Text() );
+		break;
+	case 3: // void setTSFarbe( int )
+		if( parameter->getEintragAnzahl() < 1 )
+			error( 20, {}, obj );
+		val->setTSFarbe( parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0 );
+		break;
+	case 4: // void setTSGröße( int )
+		if( parameter->getEintragAnzahl() < 1 )
+			error( 20, {}, obj );
+		val->setTSSize( parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0 );
+		break;
+	case 5: // void setTBgFarbe( int )
+		if( parameter->getEintragAnzahl() < 1 )
+			error( 20, {}, obj );
+		val->setTBgFarbe( parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0 );
+		break;
+	case 6: // void setTAfFarbe( int )
+		if( parameter->getEintragAnzahl() < 1 )
+			error( 20, {}, obj );
+		val->setTAfFarbe( parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0 );
+		break;
+	case 7: // void setTAfStärke( int )
+		if( parameter->getEintragAnzahl() < 1 )
+			error( 20, {}, obj );
+		val->setTAfStrength( parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0 );
+		break;
+	case 8: // void setTBgBild( Bild )
+		if( parameter->getEintragAnzahl() < 1 )
+			error( 20, {}, obj );
+		val->setTBgBild( parameter->z( 0 ) ? parameter->z( 0 )->getBild() : 0 );
+		break;
+	case 9: // void setTRFarbe( int )
+		if( parameter->getEintragAnzahl() < 1 )
+			error( 20, {}, obj );
+		val->setTRFarbe( parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0 );
+		break;
+	case 10: // void setTRBreite( int )
+		if( parameter->getEintragAnzahl() < 1 )
+			error( 20, {}, obj );
+		val->setTRBreite( parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0 );
+		break;
+	case 11: // void setKBgFarbe( int )
+		if( parameter->getEintragAnzahl() < 1 )
+			error( 20, {}, obj );
+		val->setKBgFarbe( parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0 );
+		break;
+	case 12: // void setKBgBild( Bild )
+		if( parameter->getEintragAnzahl() < 1 )
+			error( 20, {}, obj );
+		val->setKBgBild( parameter->z( 0 ) ? parameter->z( 0 )->getBild() : 0 );
+		break;
+	case 13: // void setKAfFarbe( int )
+		if( parameter->getEintragAnzahl() < 1 )
+			error( 20, {}, obj );
+		val->setKAfFarbe( parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0 );
+		break;
+	case 14: // void setKAfStärke( int )
+		if( parameter->getEintragAnzahl() < 1 )
+			error( 20, {}, obj );
+		val->setKAfStrength( parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0 );
+		break;
+	case 15: // void setSBgFarbe( int )
+		if( parameter->getEintragAnzahl() < 1 )
+			error( 20, {}, obj );
+		val->setSBgFarbe( parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0 );
+		break;
+	case 16: // void setSBgBild( Bild )
+		if( parameter->getEintragAnzahl() < 1 )
+			error( 20, {}, obj );
+		val->setSBgBild( parameter->z( 0 ) ? parameter->z( 0 )->getBild() : 0 );
+		break;
+	case 17: // void setSAfFarbe( int )
+		if( parameter->getEintragAnzahl() < 1 )
+			error( 20, {}, obj );
+		val->setSAfFarbe( parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0 );
+		break;
+	case 18: // void setSAfStärke( int )
+		if( parameter->getEintragAnzahl() < 1 )
+			error( 20, {}, obj );
+		val->setSAfStrength( parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0 );
+		break;
+	case 19: // void setSKAfFarbe( int )
+		if( parameter->getEintragAnzahl() < 1 )
+			error( 20, {}, obj );
+		val->setSKAfFarbe( parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0 );
+		break;
+	case 20: // void setSKAfStärke( int )
+		if( parameter->getEintragAnzahl() < 1 )
+			error( 20, {}, obj );
+		val->setSKAfStrength( parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0 );
+		break;
+	case 21: // void setMin( int, int )
+		if( parameter->getEintragAnzahl() < 2 )
+			error( 20, {}, obj );
+		val->setMin( parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0,
+					 parameter->z( 1 ) ? parameter->z( 1 )->getInt() : 0 );
+		break;
+	case 22: // void setMax( int, int )
+		if( parameter->getEintragAnzahl() < 2 )
+			error( 20, {}, obj );
+		val->setMax( parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0,
+					 parameter->z( 1 ) ? parameter->z( 1 )->getInt() : 0 );
+		break;
+	case 23: // void setKMin( int, int )
+		if( parameter->getEintragAnzahl() < 2 )
+			error( 20, {}, obj );
+		val->setKMin( parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0,
+					  parameter->z( 1 ) ? parameter->z( 1 )->getInt() : 0 );
+		break;
+	case 24: // void setKMax( int, int )
+		if( parameter->getEintragAnzahl() < 2 )
+			error( 20, {}, obj );
+		val->setKMax( parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0,
+					  parameter->z( 1 ) ? parameter->z( 1 )->getInt() : 0 );
+		break;
+	case 25: // void setHSBMax( int )
+		if( parameter->getEintragAnzahl() < 1 )
+			error( 20, {}, obj );
+		val->setHSBMax( parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0 );
+		break;
+	case 26: // void setVSBMax( int )
+		if( parameter->getEintragAnzahl() < 1 )
+			error( 20, {}, obj );
+		val->setVSBMax( parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0 );
+		break;
+	case 27: // void setHSBScroll( int )
+		if( parameter->getEintragAnzahl() < 1 )
+			error( 20, {}, obj );
+		val->setHSBScroll( parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0 );
+		break;
+	case 28: // void setVSBScroll( int )
+		if( parameter->getEintragAnzahl() < 1 )
+			error( 20, {}, obj );
+		val->setVSBScroll( parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0 );
+		break;
+	case 29: // void setStyle( int )
+		if( parameter->getEintragAnzahl() < 1 )
+			error( 20, {}, obj );
+		val->setStyle( parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0 );
+		break;
+	case 30: // void addStyle( int )
+		if( parameter->getEintragAnzahl() < 1 )
+			error( 20, {}, obj );
+		val->addStyle( parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0 );
+		break;
+	case 31: // void removeStyle( int )
+		if( parameter->getEintragAnzahl() < 1 )
+			error( 20, {}, obj );
+		val->removeStyle( parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0 );
+		break;
+	case 32: // void addMember( Zeichnung )
+		if( 1 )
+		{
+			if( parameter->getEintragAnzahl() < 1 )
+				error( 20, {}, obj );
+            Zeichnung *obj = parameter->z( 0 ) ? parameter->z( 0 )->getZeichnung() : 0;
+			if( obj )
+				val->addMember( obj );
+		}
+		break;
+	case 33: // void removeMember( Zeichnung )
+		if( 1 )
+		{
+			if( parameter->getEintragAnzahl() < 1 )
+				error( 20, {}, obj );
+            Zeichnung *obj = parameter->z( 0 ) ? parameter->z( 0 )->getZeichnung() : 0;
+			if( obj )
+				val->removeMember( obj );
+		}
+		break;
+	case 34: // bool tick( double )
+		if( parameter->getEintragAnzahl() < 1 )
+			error( 20, {}, obj );
+		ret = new KSGSBoolKlasse( obj, val->tick( parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0 ) );
+		break;
+	case 35: // void setMausEreignis( Text )
+		if( 1 )
+		{
+			if( parameter->getEintragAnzahl() < 1 )
+				error( 20, {}, obj );
+			Text *n = parameter->z( 0 ) ? parameter->z( 0 )->getText() : 0;
+			if( n )
+			{
+				mausF = obj->getFunktionId( *n );
+				n->release();
+			}
+			else
+				mausF = -1;
+		}
+		break;
+	case 36: // void setTastaturEreignis( Text )
+		if( 1 )
+		{
+			if( parameter->getEintragAnzahl() < 1 )
+				error( 20, {}, obj );
+			Text *n = parameter->z( 0 ) ? parameter->z( 0 )->getText() : 0;
+			if( n )
+			{
+				tastaturF = obj->getFunktionId( *n );
+				n->release();
+			}
+			else
+				tastaturF = -1;
+		}
+		break;
+	case 37: // void doMausEreignis( MausEreignis )
+		if( 1 )
+		{
+			if( parameter->getEintragAnzahl() < 1 )
+				error( 20, {}, obj );
+			MausEreignis me = parameter->z( 0 ) ? parameter->z( 0 )->getMausEreignis() : MausEreignis{ 0, 0, 0, 0, 0, 0 };
+			val->doMausEreignis( me );
+		}
+		break;
+	case 38: // void doTastaturEreignis( TastaturEreignis )
+		if( 1 )
+		{
+			if( parameter->getEintragAnzahl() < 1 )
+				error( 20, {}, obj );
+			TastaturEreignis te = parameter->z( 0 ) ? parameter->z( 0 )->getTastaturEreignis() : TastaturEreignis{ 0, 0, 0 };
+			val->doTastaturEreignis( te );
+		}
+		break;
+	case 39: // void render( int, int, Bild )
+		if( 1 )
+		{
+			if( parameter->getEintragAnzahl() < 1 )
+				error( 20, {}, obj );
+			Bild *b = parameter->z( 0 ) ? parameter->z( 0 )->getBild() : 0;
+			if( b )
+			{
+				val->render( *b );
+				b->release();
+			}
+		}
+		break;
+	case 40: // int getRFarbe()
+		ret = new KSGSIntKlasse( obj, val->getRFarbe() );
+		break;
+	case 41: // int getRBreite()
+		ret = new KSGSIntKlasse( obj, val->getRBreite() );
+		break;
+	case 42: // Tect getTitel()
+		ret = new KSGSTextKlasse( obj, val->zTitel() ? val->zTitel()->getText() : "" );
+		break;
+	case 43: // int getTSFarbe()
+		ret = new KSGSIntKlasse( obj, val->getTSFarbe() );
+		break;
+	case 44: // int getTSGröße()
+		ret = new KSGSIntKlasse( obj, val->getTSSize() );
+		break;
+	case 45: // int getTBgFarbe()
+		ret = new KSGSIntKlasse( obj, val->getTBgFarbe() );
+		break;
+	case 46: // int getTAfFarbe()
+		ret = new KSGSIntKlasse( obj, val->getTAfFarbe() );
+		break;
+	case 47: // int getTAfStärke()
+		ret = new KSGSIntKlasse( obj, val->getTAfStrength() );
+		break;
+	case 48: // Bild getTBgBild()
+		ret = new KSGSBildKlasse( obj, val->getTBgBild() );
+		break;
+	case 49: // int getTRFarbe()
+		ret = new KSGSIntKlasse( obj, val->getTRFarbe() );
+		break;
+	case 50: // int getTRBreite()
+		ret = new KSGSIntKlasse( obj, val->getTRBreite() );
+		break;
+	case 51: // int getKBgFarbe()
+		ret = new KSGSIntKlasse( obj, val->getKBgFarbe() );
+		break;
+	case 52: // Bild getKBgBild()
+		ret = new KSGSBildKlasse( obj, val->getKBgBild() );
+		break;
+	case 53: // int getKAfFarbe()
+		ret = new KSGSIntKlasse( obj, val->getKAfFarbe() );
+		break;
+	case 54: // int getKAfStärke()
+		ret = new KSGSIntKlasse( obj, val->getKAfStrength() );
+		break;
+	case 55: // int getSBgFarbe()
+		ret = new KSGSIntKlasse( obj, val->getSBgFarbe() );
+		break;
+	case 56: // Bild getSBgBild()
+		ret = new KSGSBildKlasse( obj, val->getSBgBild() );
+		break;
+	case 57: // int getSAfFarbe()
+		ret = new KSGSIntKlasse( obj, val->getSAfFarbe() );
+		break;
+	case 58: // int getSAfStärke()
+		ret = new KSGSIntKlasse( obj, val->getSAfStrength() );
+		break;
+	case 59: // int getSKAfFarbe()
+		ret = new KSGSIntKlasse( obj, val->getSKAfFarbe() );
+		break;
+	case 60: // int getSKAfStärke()
+		ret = new KSGSIntKlasse( obj, val->getSKAfStrength() );
+		break;
+	case 61: // int getMinBreite()
+		ret = new KSGSIntKlasse( obj, val->getMin().x );
+		break;
+	case 62: // int getMinHöhe()
+		ret = new KSGSIntKlasse( obj, val->getMin().y );
+		break;
+	case 63: // int getMaxBreite()
+		ret = new KSGSIntKlasse( obj, val->getMax().x );
+		break;
+	case 64: // int getMaxHöhe()
+		ret = new KSGSIntKlasse( obj, val->getMax().y );
+		break;
+	case 65: // int getKMinBreite()
+		ret = new KSGSIntKlasse( obj, val->getKMin().x );
+		break;
+	case 66: // int getKMinHöhe()
+		ret = new KSGSIntKlasse( obj, val->getKMin().y );
+		break;
+	case 67: // int getKMaxBreite()
+		ret = new KSGSIntKlasse( obj, val->getKMax().x );
+		break;
+	case 68: // int getKMaxHöhe()
+		ret = new KSGSIntKlasse( obj, val->getKMax().y );
+		break;
+	case 69: // bool hatStyle( int )
+		if( parameter->getEintragAnzahl() < 1 )
+			error( 20, {}, obj );
+		ret = new KSGSBoolKlasse( obj, val->hatStyle( parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0 ) );
+		break;
+	case 70: // bool hatStyleNicht( int )
+		if( parameter->getEintragAnzahl() < 1 )
+			error( 20, {}, obj );
+		ret = new KSGSBoolKlasse( obj, val->hatStyleNicht( parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0 ) );
+		break;
+	case 71: // Fenster dublizieren()
+		ret = new KSGSFensterKlasse( obj, (Fenster*)val->dublizieren() );
+		break;
+	case 72: // void setToolTipText( Text )
+		if( 1 )
+		{
+			if( parameter->getEintragAnzahl() < 1 )
+				error( 20, {}, obj );
+			Text *txt = parameter->z( 0 ) ? parameter->z( 0 )->getText() : 0;
+			val->setToolTipText( txt ? *txt : 0, obj->zBildschirm() );
+			if( txt )
+				txt->release();
+		}
+		break;
+	case 73: // void setPosition( int, int )
+		if( parameter->getEintragAnzahl() < 2 )
+			error( 20, {}, obj );
+		val->setPosition( parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0,
+						  parameter->z( 1 ) ? parameter->z( 1 )->getInt() : 0 );
+		break;
+	case 74: // void setGröße( int, int )
+		if( parameter->getEintragAnzahl() < 2 )
+			error( 20, {}, obj );
+		val->setSize( parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0,
+					   parameter->z( 1 ) ? parameter->z( 1 )->getInt() : 0 );
+		break;
+	case 75: // int getBreite()
+		ret = new KSGSIntKlasse( obj, val->getBreite() );
+		break;
+	case 76: // int getHöhe()
+		ret = new KSGSIntKlasse( obj, val->getHeight() );
+		break;
+	case 77: // int getX()
+		ret = new KSGSIntKlasse( obj, val->getX() );
+		break;
+	case 78: // int getY()
+		ret = new KSGSIntKlasse( obj, val->getY() );
+		break;
+	case 79: // Text getToolTipText()
+		if( 1 )
+		{
+			Text *txt = val->zToolTip() ? val->zToolTip()->zText() : 0;
+			ret = new KSGSTextKlasse( obj, txt ? *txt : "" );
+		}
+		break;
+	default: // unbekannt
+		error( 19, {}, obj );
+		break;
+	}
+	parameter->release();
+	return ret;
+}
+
+KSGSVariable *KSGSFensterKlasse::doOperator( int id, KSGSVariable *rechts )
+{
+	if( !rechts )
+	{
+		error( 3, {}, obj );
+		return 0;
+	}
+	KSGSVariable *ret = 0;
+	switch( id )
+	{
+	case KSGS_O_SET:
+		if( 1 )
+		{
+			val->release();
+			val = rechts->getFenster();
+			ret = getThis();
+		}
+		break;
+	}
+	if( !ret )
+		error( 21, {}, obj );
+	if( rechts )
+		rechts->release();
+	return ret;
+}
+
+bool KSGSFensterKlasse::doMausEreignis( MausEreignis &me )
+{
+	if( mausF < 0 )
+		return 1;
+	RCArray< KSGSVariable > *parameter = new RCArray< KSGSVariable >();
+	parameter->add( new KSGSMausEreignisKlasse( obj, me ) );
+	KSGSVariable *ret = obj->startFunktion( mausF, parameter );
+	if( ret )
+	{
+		bool r = ret->getBool();
+		ret->release();
+		return r;
+	}
+	return 1;
+}
+
+bool KSGSFensterKlasse::doTastaturEreignis( TastaturEreignis &te )
+{
+	if( tastaturF < 0 )
+		return 1;
+	RCArray< KSGSVariable > *parameter = new RCArray< KSGSVariable >();
+	parameter->add( new KSGSTastaturEreignisKlasse( obj, te ) );
+	KSGSVariable *ret = obj->startFunktion( tastaturF, parameter );
+	if( ret )
+	{
+		bool r = ret->getBool();
+		ret->release();
+		return r;
+	}
+	return 1;
+}
+
+// constant
+Fenster *KSGSFensterKlasse::getVal() const
+{
+	return val->getThis();
+}
+
+Fenster *KSGSFensterKlasse::zVal() const
+{
+	return val;
+}
+
+// Reference Counting
+KSGSVariable *KSGSFensterKlasse::release()
+{
+	ref--;
+	if( !ref )
+		delete this;
+	return 0;
+}
+
+
+// Ereignisse
+bool KSGScript::ksgsFensterME( void *var, void *obj, MausEreignis me )
+{
+	if( !var )
+		return 1;
+	return ( (KSGSFensterKlasse*)var )->doMausEreignis( me );
+}
+
+bool KSGScript::ksgsFensterTE( void *var, void *obj, TastaturEreignis te )
+{
+	if( !var )
+		return 1;
+	return ( (KSGSFensterKlasse*)var )->doTastaturEreignis( te );
+}

+ 38 - 0
ksgScript/Klassen/KSGSFenster.h

@@ -0,0 +1,38 @@
+#ifndef KSGSFenster_H
+#define KSGSFenster_H
+
+#include "../Befehl/KSGSKlasse.h"
+#include <Fenster.h>
+
+namespace KSGScript
+{
+	class KSGSFensterKlasse : public KSGSKlasseInstanz
+	{
+	private:
+		Fenster *val;
+		int mausF;
+		int tastaturF;
+
+	public:
+		// Konstruktor
+		__declspec( dllexport ) KSGSFensterKlasse( KSGScriptObj *zObj, Fenster *std = new Fenster() );
+		// Destruktor
+		__declspec( dllexport ) ~KSGSFensterKlasse();
+		// nicht constant
+		__declspec( dllexport ) virtual KSGSVariable *startFunktion( int id, bool access, RCArray< KSGSVariable > *parameter ) override;
+		__declspec( dllexport ) virtual KSGSVariable *doOperator( int id, KSGSVariable *rechts ) override;
+		__declspec( dllexport ) virtual bool doMausEreignis( MausEreignis &me );
+		__declspec( dllexport ) virtual bool doTastaturEreignis( TastaturEreignis &te );
+		// constant
+		__declspec( dllexport ) virtual Fenster *getVal() const;
+		__declspec( dllexport ) virtual Fenster *zVal() const;
+		// Reference Counting
+		__declspec( dllexport ) virtual KSGSVariable *release() override;
+	};
+
+	// Ereignisse
+	__declspec( dllexport ) bool ksgsFensterME( void *var, void *obj, MausEreignis me );
+	__declspec( dllexport ) bool ksgsFensterTE( void *var, void *obj, TastaturEreignis te );
+}
+
+#endif

+ 169 - 0
ksgScript/Klassen/KSGSInt.cpp

@@ -0,0 +1,169 @@
+#include "KSGSInt.h"
+#include "KSGSTyp.h"
+#include "../Error/Error.h"
+#include "KSGSBool.h"
+#include "KSGSDouble.h"
+#include "KSGSText.h"
+
+using namespace KSGScript;
+
+// Inhalt der KSGSIntKlasse Klasse aus KSGSInt.h
+// Konstruktor
+KSGSIntKlasse::KSGSIntKlasse( KSGScriptObj *zObj, int std )
+	: KSGSKlasseInstanz( KSGS_INT, 0, 0, zObj )
+{
+	val = std;
+}
+
+// Destruktor
+KSGSIntKlasse::~KSGSIntKlasse()
+{
+
+}
+
+// nicht constant
+void KSGSIntKlasse::set( int i )
+{
+	val = i;
+}
+
+KSGSVariable *KSGSIntKlasse::doOperator( int id, KSGSVariable *rechts )
+{
+	if( !rechts && id != KSGS_O_NICHT && id != KSGS_O_MINUS1 && id != KSGS_O_PLUS1 && id != KSGS_O_BITNICHT )
+	{
+		if( rechts )
+			rechts->release();
+		error( 3, {}, obj );
+		return 0;
+	}
+	KSGSVariable *ret = 0;
+	switch( id )
+	{
+	case KSGS_O_SET:
+		val = rechts->getInt();
+		ret = getThis();
+		break;
+	case KSGS_O_PLUSSET:
+		val += rechts->getInt();
+		ret = getThis();
+		break;
+	case KSGS_O_MINUSSET:
+		val -= rechts->getInt();
+		ret = getThis();
+		break;
+	case KSGS_O_MAHLSET:
+		val = (int)( val * rechts->getDouble() );
+		ret = getThis();
+		break;
+	case KSGS_O_GETEILTSET:
+		val = (int)( val / rechts->getDouble() );
+		ret = getThis();
+		break;
+	case KSGS_O_UNDSET:
+		val &= rechts->getInt();
+		ret = getThis();
+		break;
+	case KSGS_O_ODERSET:
+		val |= rechts->getInt();
+		ret = getThis();
+		break;
+	case KSGS_O_GLEICH:
+		ret = new KSGSBoolKlasse( obj, val == rechts->getDouble() );
+		break;
+	case KSGS_O_KLEINERGLEICH:
+		ret = new KSGSBoolKlasse( obj, val <= rechts->getDouble() );
+		break;
+	case KSGS_O_GRÖßERGLEICH:
+		ret = new KSGSBoolKlasse( obj, val >= rechts->getDouble() );
+		break;
+	case KSGS_O_UNGLEICH:
+		ret = new KSGSBoolKlasse( obj, val != rechts->getDouble() );
+		break;
+	case KSGS_O_KLEINER:
+		ret = new KSGSBoolKlasse( obj, val < rechts->getDouble() );
+		break;
+	case KSGS_O_GRÖßER:
+		ret = new KSGSBoolKlasse( obj, val > rechts->getDouble() );
+		break;
+	case KSGS_O_ODER:
+		ret = new KSGSBoolKlasse( obj, val || rechts->getDouble() );
+		break;
+	case KSGS_O_UND:
+		ret = new KSGSBoolKlasse( obj, val && rechts->getDouble() );
+		break;
+	case KSGS_O_BITODER:
+		ret = new KSGSIntKlasse( obj, val | rechts->getInt() );
+		break;
+	case KSGS_O_BITUND:
+		ret = new KSGSIntKlasse( obj, val & rechts->getInt() );
+		break;
+	case KSGS_O_PLUS:
+		ret = new KSGSIntKlasse( obj, val + rechts->getInt() );
+		break;
+	case KSGS_O_MINUS:
+		ret = new KSGSIntKlasse( obj, val - rechts->getInt() );
+		break;
+	case KSGS_O_MAHL:
+		ret = new KSGSIntKlasse( obj, (int)( val * rechts->getDouble() ) );
+		break;
+	case KSGS_O_GETEILT:
+		ret = new KSGSIntKlasse( obj, (int)( val / rechts->getDouble() ) );
+		break;
+	case KSGS_O_REST:
+		ret = new KSGSIntKlasse( obj, val % rechts->getInt() );
+		break;
+	case KSGS_O_PLUS1:
+		ret = new KSGSIntKlasse( obj, val++ );
+		break;
+	case KSGS_O_MINUS1:
+		ret = new KSGSIntKlasse( obj, val-- );
+		break;
+	case KSGS_O_NICHT:
+		ret = new KSGSIntKlasse( obj, !val );
+		break;
+	case KSGS_O_BITNICHT:
+		ret = new KSGSIntKlasse( obj, ~val );
+		break;
+	case KSGS_O_NACHLINKS:
+		ret = new KSGSIntKlasse( obj, val << rechts->getInt() );
+		break;
+	case KSGS_O_NACHRECHTS:
+		ret = new KSGSIntKlasse( obj, val >> rechts->getInt() );
+		break;
+	}
+	if( !ret )
+		error( 21, {}, obj );
+	if( rechts )
+		rechts->release();
+	return ret;
+}
+
+// constant
+int KSGSIntKlasse::getVal() const
+{
+	return val;
+}
+
+KSGSVariable *KSGSIntKlasse::umwandelnIn( int typ ) const
+{
+	switch( typ )
+	{
+	case KSGS_BOOL:
+		return new KSGSBoolKlasse( obj, val != 0 );
+	case KSGS_DOUBLE:
+		return new KSGSDoubleKlasse( obj, val );
+	case KSGS_TEXT:
+		return new KSGSTextKlasse( obj, Text() += val );
+	}
+	error( 16, {}, obj );
+	return 0;
+}
+
+// Reference Counting
+KSGSVariable *KSGSIntKlasse::release()
+{
+	ref--;
+	if( !ref )
+		delete this;
+	return 0;
+}

+ 29 - 0
ksgScript/Klassen/KSGSInt.h

@@ -0,0 +1,29 @@
+#ifndef KSGSInt_H
+#define KSGSInt_H
+
+#include "../Befehl/KSGSKlasse.h"
+
+namespace KSGScript
+{
+	class KSGSIntKlasse : public KSGSKlasseInstanz
+	{
+	private:
+		int val;
+
+	public:
+		// Konstruktor
+		__declspec( dllexport ) KSGSIntKlasse( KSGScriptObj *zObj, int std = 0 );
+		// Destruktor
+		__declspec( dllexport ) ~KSGSIntKlasse();
+		// nicht constant
+		__declspec( dllexport ) void set( int i );
+		__declspec( dllexport ) virtual KSGSVariable *doOperator( int id, KSGSVariable *rechts ) override;
+		// constant
+		__declspec( dllexport ) virtual int getVal() const;
+		__declspec( dllexport ) virtual KSGSVariable *umwandelnIn( int typ ) const override;
+		// Reference Counting
+		__declspec( dllexport ) virtual KSGSVariable *release() override;
+	};
+}
+
+#endif

+ 332 - 0
ksgScript/Klassen/KSGSKnopf.cpp

@@ -0,0 +1,332 @@
+#include "KSGSKnopf.h"
+#include "KSGSTyp.h"
+#include "../Error/Error.h"
+#include "../Main/KSGScriptObj.h"
+#include "KSGSMausEreignis.h"
+#include "KSGSText.h"
+#include "KSGSInt.h"
+#include "KSGSBool.h"
+#include "KSGSBild.h"
+#include <ToolTip.h>
+
+using namespace KSGScript;
+
+// Inhalt der KSGSKnopfKlasse Klasse aus KSGSKnopf.h
+// Konstruktor
+KSGSKnopfKlasse::KSGSKnopfKlasse( KSGScriptObj *zObj, Knopf *std )
+	: KSGSKlasseInstanz( KSGS_KNOPF, 0, 0, zObj )
+{
+	mausF = -1;
+	val = std;
+	val->setMausEreignisParameter( this );
+	val->setMausEreignis( ksgsKnopfME );
+	if( zObj->zSchrift() )
+		val->setSchriftZ( zObj->getSchrift() );
+}
+
+// Destruktor
+KSGSKnopfKlasse::~KSGSKnopfKlasse()
+{
+	val->release();
+}
+
+// nicht constant
+KSGSVariable *KSGSKnopfKlasse::startFunktion( int id, bool access, RCArray< KSGSVariable > *parameter )
+{
+	KSGSVariable *ret = 0;
+	switch( id )
+	{
+	case 0: // void setText( Text )
+		if( parameter->getEintragAnzahl() < 1 )
+			error( 20, {}, obj );
+		val->setText( parameter->z( 0 ) ? parameter->z( 0 )->getText() : new Text() );
+		break;
+	case 1: // void setHintergrundBild( Bild )
+		if( parameter->getEintragAnzahl() < 1 )
+			error( 20, {}, obj );
+		val->setHintergrundBildZ( parameter->z( 0 ) ? parameter->z( 0 )->getBild() : 0 );
+		break;
+	case 2: // void setHintergrundFarbe( int )
+		if( parameter->getEintragAnzahl() < 1 )
+			error( 20, {}, obj );
+		val->setHintergrundFarbe( parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0 );
+		break;
+	case 3: // void setSchriftGröße( int )
+		if( parameter->getEintragAnzahl() < 1 )
+			error( 20, {}, obj );
+		val->setSchriftSize( parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0 );
+		break;
+	case 4: // void setSchriftFarbe( int )
+		if( parameter->getEintragAnzahl() < 1 )
+			error( 20, {}, obj );
+		val->setSchriftFarbe( parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0 );
+		break;
+	case 5: // void setAFStärke( int )
+		if( parameter->getEintragAnzahl() < 1 )
+			error( 20, {}, obj );
+		val->setAlphaFeldStrength( parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0 );
+		break;
+	case 6: // void setAFFarbe( int )
+		if( parameter->getEintragAnzahl() < 1 )
+			error( 20, {}, obj );
+		val->setAlphaFeldFarbe( parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0 );
+		break;
+	case 7: // void setLRBreite( int )
+		if( parameter->getEintragAnzahl() < 1 )
+			error( 20, {}, obj );
+		val->setLinienRahmenBreite( parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0 );
+		break;
+	case 8: // void setLRFarbe( int )
+		if( parameter->getEintragAnzahl() < 1 )
+			error( 20, {}, obj );
+		val->setLinienRahmenFarbe( parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0 );
+		break;
+	case 9: // void setKlickFarbe( int )
+		if( parameter->getEintragAnzahl() < 1 )
+			error( 20, {}, obj );
+		val->setKlickFarbe( parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0 );
+		break;
+	case 10: // void setKlickBild( Bild )
+		if( parameter->getEintragAnzahl() < 1 )
+			error( 20, {}, obj );
+		val->setKlickBildZ( parameter->z( 0 ) ? parameter->z( 0 )->getBild() : 0 );
+		break;
+	case 11: // void setKBStärke( int )
+		if( parameter->getEintragAnzahl() < 1 )
+			error( 20, {}, obj );
+		val->setKBStrength( parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0 );
+		break;
+	case 12: // void setKBFarbe( int )
+		if( parameter->getEintragAnzahl() < 1 )
+			error( 20, {}, obj );
+		val->setKBFarbe( parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0 );
+		break;
+	case 13: // void setStyle( int )
+		if( parameter->getEintragAnzahl() < 1 )
+			error( 20, {}, obj );
+		val->setStyle( parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0 );
+		break;
+	case 14: // void addStyle( int )
+		if( parameter->getEintragAnzahl() < 1 )
+			error( 20, {}, obj );
+		val->addStyle( parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0 );
+		break;
+	case 15: // void löscheStyle( int )
+		if( parameter->getEintragAnzahl() < 1 )
+			error( 20, {}, obj );
+		val->removeStyle( parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0 );
+		break;
+	case 16: // bool tick( double )
+		if( parameter->getEintragAnzahl() < 1 )
+			error( 20, {}, obj );
+		ret = new KSGSBoolKlasse( obj, val->tick( parameter->z( 0 ) ? parameter->z( 0 )->getDouble() : 0 ) );
+		break;
+	case 17: // void setMausEreignis( Text )
+		if( 1 )
+		{
+			if( parameter->getEintragAnzahl() < 1 )
+				error( 20, {}, obj );
+			Text *n = parameter->z( 0 ) ? parameter->z( 0 )->getText() : 0;
+			if( n )
+			{
+				mausF = obj->getFunktionId( *n );
+				n->release();
+			}
+			else
+				mausF = -1;
+		}
+		break;
+	case 18: // void doMausEreignis( MausEreignis )
+		if( 1 )
+		{
+			if( parameter->getEintragAnzahl() < 1 )
+				error( 20, {}, obj );
+			MausEreignis me = parameter->z( 0 ) ? parameter->z( 0 )->getMausEreignis() : MausEreignis{ 0, 0, 0, 0, 0, 0 };
+			val->doMausEreignis( me );
+		}
+		break;
+	case 19: // void render( int, int, Bild )if( 1 )
+	{
+		if( parameter->getEintragAnzahl() < 1 )
+			error( 20, {}, obj );
+		Bild *b = parameter->z( 0 ) ? parameter->z( 0 )->getBild() : 0;
+		if( b )
+		{
+			val->render( *b );
+			b->release();
+		}
+	}
+		break;
+	case 20: // Text getText()
+		if( 1 )
+		{
+			Text *txt = val->getText();
+			ret = new KSGSTextKlasse( obj, *txt );
+			txt->release();
+		}
+		break;
+	case 21: // Bild getHintergrundBild()
+		ret = new KSGSBildKlasse( obj, val->getHintergrundBild() );
+		break;
+	case 22: // int getHintergrundFarbe()
+		ret = new KSGSIntKlasse( obj, val->getHintergrundFarbe() );
+		break;
+	case 23: // int getSchriftGröße()
+		ret = new KSGSIntKlasse( obj, val->getSchriftSize() );
+		break;
+	case 24: // int getSchriftFarbe()
+		ret = new KSGSIntKlasse( obj, val->getSchriftFarbe() );
+		break;
+	case 25: // int getAFStärke()
+		ret = new KSGSIntKlasse( obj, val->getAlphaFeldStrength() );
+		break;
+	case 26: // int getAFFarbe()
+		ret = new KSGSIntKlasse( obj, val->getAlphaFeldFarbe() );
+		break;
+	case 27: // int getLRBreite()
+		ret = new KSGSIntKlasse( obj, val->getLinienRahmenBreite() );
+		break;
+	case 28: // int getLRFarbe()
+		ret = new KSGSIntKlasse( obj, val->getLinienRahmenFarbe() );
+		break;
+	case 29: // int getKlickFarbe()
+		ret = new KSGSIntKlasse( obj, val->getKlickFarbe() );
+		break;
+	case 30: // Bild getKlickBild()
+		ret = new KSGSBildKlasse( obj, val->getKlickBild() );
+		break;
+	case 31: // int getKBFarbe()
+		ret = new KSGSIntKlasse( obj, val->getKBFarbe() );
+		break;
+	case 32: // int getKBStärke()
+		ret = new KSGSIntKlasse( obj, val->getKBStrength() );
+		break;
+	case 33: // bool hatStyle( int )
+		ret = new KSGSBoolKlasse( obj, val->hatStyle( parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0 ) );
+		break;
+	case 34: // bool hatStyleNicht( int )
+		ret = new KSGSBoolKlasse( obj, val->hatStyleNicht( parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0 ) );
+		break;
+	case 35: // Knopf dublizieren()
+		ret = new KSGSKnopfKlasse( obj, (Knopf*)val->dublizieren() );
+		break;
+	case 36: // void setToolTipText( Text )
+		if( 1 )
+		{
+			if( parameter->getEintragAnzahl() < 1 )
+				error( 20, {}, obj );
+			Text *txt = parameter->z( 0 ) ? parameter->z( 0 )->getText() : 0;
+			val->setToolTipText( txt ? *txt : 0, obj->zBildschirm() );
+			if( txt )
+				txt->release();
+		}
+		break;
+	case 37: // void setPosition( int, int )
+		if( parameter->getEintragAnzahl() < 2 )
+			error( 20, {}, obj );
+		val->setPosition( parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0,
+						  parameter->z( 1 ) ? parameter->z( 1 )->getInt() : 0 );
+		break;
+	case 38: // void setGröße( int, int )
+		if( parameter->getEintragAnzahl() < 2 )
+			error( 20, {}, obj );
+		val->setSize( parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0,
+					   parameter->z( 1 ) ? parameter->z( 1 )->getInt() : 0 );
+		break;
+	case 39: // int getBreite()
+		ret = new KSGSIntKlasse( obj, val->getBreite() );
+		break;
+	case 40: // int getHöhe()
+		ret = new KSGSIntKlasse( obj, val->getHeight() );
+		break;
+	case 41: // int getX()
+		ret = new KSGSIntKlasse( obj, val->getX() );
+		break;
+	case 42: // int getY()
+		ret = new KSGSIntKlasse( obj, val->getY() );
+		break;
+	case 43: // Text getToolTipText()
+		if( 1 )
+		{
+			Text *txt = val->zToolTip() ? val->zToolTip()->zText() : 0;
+			ret = new KSGSTextKlasse( obj, txt ? *txt : "" );
+		}
+		break;
+	default: // unbekannt
+		error( 19, {}, obj );
+		break;
+	}
+	parameter->release();
+	return ret;
+}
+
+KSGSVariable *KSGSKnopfKlasse::doOperator( int id, KSGSVariable *rechts )
+{
+	if( !rechts )
+	{
+		error( 3, {}, obj );
+		return 0;
+	}
+	KSGSVariable *ret = 0;
+	switch( id )
+	{
+	case KSGS_O_SET:
+		if( 1 )
+		{
+			val->release();
+			val = rechts->getKnopf();
+			ret = getThis();
+		}
+		break;
+	}
+	if( !ret )
+		error( 21, {}, obj );
+	if( rechts )
+		rechts->release();
+	return ret;
+}
+
+bool KSGSKnopfKlasse::doMausEreignis( MausEreignis &me )
+{
+	if( mausF < 0 )
+		return 1;
+	RCArray< KSGSVariable > *parameter = new RCArray< KSGSVariable >();
+	parameter->add( new KSGSMausEreignisKlasse( obj, me ) );
+	KSGSVariable *ret = obj->startFunktion( mausF, parameter );
+	if( ret )
+	{
+		bool r = ret->getBool();
+		ret->release();
+		return r;
+	}
+	return 1;
+}
+
+// constant
+Knopf *KSGSKnopfKlasse::getVal() const
+{
+	return val->getThis();
+}
+
+Knopf *KSGSKnopfKlasse::zVal() const
+{
+	return val;
+}
+
+// Reference Counting
+KSGSVariable *KSGSKnopfKlasse::release()
+{
+	ref--;
+	if( !ref )
+		delete this;
+	return 0;
+}
+
+
+// Ereignisse
+bool KSGScript::ksgsKnopfME( void *var, void *obj, MausEreignis me )
+{
+	if( !var )
+		return 1;
+	return ( (KSGSKnopfKlasse*)var )->doMausEreignis( me );
+}

+ 35 - 0
ksgScript/Klassen/KSGSKnopf.h

@@ -0,0 +1,35 @@
+#ifndef KSGSKnopf_H
+#define KSGSKnopf_H
+
+#include "../Befehl/KSGSKlasse.h"
+#include <Knopf.h>
+
+namespace KSGScript
+{
+	class KSGSKnopfKlasse : public KSGSKlasseInstanz
+	{
+	private:
+		Knopf *val;
+		int mausF;
+
+	public:
+		// Konstruktor
+		__declspec( dllexport ) KSGSKnopfKlasse( KSGScriptObj *zObj, Knopf *std = new Knopf() );
+		// Destruktor
+		__declspec( dllexport ) ~KSGSKnopfKlasse();
+		// nicht constant
+		__declspec( dllexport ) virtual KSGSVariable *startFunktion( int id, bool access, RCArray< KSGSVariable > *parameter ) override;
+		__declspec( dllexport ) virtual KSGSVariable *doOperator( int id, KSGSVariable *rechts ) override;
+		__declspec( dllexport ) virtual bool doMausEreignis( MausEreignis &me );
+		// constant
+		__declspec( dllexport ) virtual Knopf *getVal() const;
+		__declspec( dllexport ) virtual Knopf *zVal() const;
+		// Reference Counting
+		__declspec( dllexport ) virtual KSGSVariable *release() override;
+	};
+
+	// Ereignisse
+	__declspec( dllexport ) bool ksgsKnopfME( void *var, void *obj, MausEreignis me );
+}
+
+#endif

+ 138 - 0
ksgScript/Klassen/KSGSMausEreignis.cpp

@@ -0,0 +1,138 @@
+#include "KSGSMausEreignis.h"
+#include "KSGSTyp.h"
+#include "../Error/Error.h"
+#include "KSGSInt.h"
+#include "KSGSBool.h"
+
+using namespace KSGScript;
+
+// Inhalt der KSGSMausEreignisKlasse Klasse aus KSGSMausEreignis.h
+// Konstruktor
+KSGSMausEreignisKlasse::KSGSMausEreignisKlasse( KSGScriptObj *zObj, MausEreignis std )
+	: KSGSKlasseInstanz( KSGS_MAUSEREIGNIS, 0, 0, zObj )
+{
+	val = std;
+}
+
+// Destruktor
+KSGSMausEreignisKlasse::~KSGSMausEreignisKlasse()
+{
+}
+
+// nicht constant
+KSGSVariable *KSGSMausEreignisKlasse::startFunktion( int id, bool access, RCArray< KSGSVariable > *parameter )
+{
+	KSGSVariable *ret = 0;
+	switch( id )
+	{
+	case 0: // void setId( int id )
+		if( parameter->getEintragAnzahl() < 1 )
+			error( 20, {}, obj );
+		val.id = parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0;
+		break;
+	case 1: // void setMx( int mx )
+		if( parameter->getEintragAnzahl() < 1 )
+			error( 20, {}, obj );
+		val.mx = parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0;
+		break;
+	case 2: // void setMy( int my )
+		if( parameter->getEintragAnzahl() < 1 )
+			error( 20, {}, obj );
+		val.my = parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0;
+		break;
+	case 3: // void setRmx( int rmx )
+		if( parameter->getEintragAnzahl() < 1 )
+			error( 20, {}, obj );
+		val.rmx = parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0;
+		break;
+	case 4: // void setRmy( int rmy )
+		if( parameter->getEintragAnzahl() < 1 )
+			error( 20, {}, obj );
+		val.rmy = parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0;
+		break;
+	case 5: // void setVerarbeitet( bool verarbeitet )
+		if( parameter->getEintragAnzahl() < 1 )
+			error( 20, {}, obj );
+		val.verarbeitet = parameter->z( 0 ) ? parameter->z( 0 )->getBool() : 0;
+		break;
+	default: // unbekannt
+		error( 19, {}, obj );
+		break;
+	}
+	parameter->release();
+	return ret;
+}
+
+void KSGSMausEreignisKlasse::set( MausEreignis &me )
+{
+	val = me;
+}
+
+KSGSVariable *KSGSMausEreignisKlasse::doOperator( int id, KSGSVariable *rechts )
+{
+	if( !rechts )
+	{
+		error( 3, {}, obj );
+		return 0;
+	}
+	KSGSVariable *ret = 0;
+	switch( id )
+	{
+	case KSGS_O_SET:
+		if( 1 )
+		{
+			val = rechts->getMausEreignis();
+			ret = getThis();
+		}
+		break;
+	}
+	if( !ret )
+		error( 21, {}, obj );
+	if( rechts )
+		rechts->release();
+	return ret;
+}
+
+// constant
+KSGSVariable *KSGSMausEreignisKlasse::getVariable( int id, bool zugriff ) const
+{
+	KSGSVariable *ret = 0;
+	switch( id )
+	{
+	case 0: // int id
+		ret = new KSGSIntKlasse( obj, val.id );
+		break;
+	case 1: // int mx
+		ret = new KSGSIntKlasse( obj, val.mx );
+		break;
+	case 2: // int my
+		ret = new KSGSIntKlasse( obj, val.my );
+		break;
+	case 3: // int rmx
+		ret = new KSGSIntKlasse( obj, val.rmx );
+		break;
+	case 4: // int rmy
+		ret = new KSGSIntKlasse( obj, val.rmy );
+		break;
+	case 5: // bool verarbeitet
+		ret = new KSGSBoolKlasse( obj, val.verarbeitet );
+		break;
+	}
+	if( !ret )
+		error( 17, {}, obj );
+	return ret;
+}
+
+MausEreignis KSGSMausEreignisKlasse::getVal() const
+{
+	return val;
+}
+
+// Reference Counting
+KSGSVariable *KSGSMausEreignisKlasse::release()
+{
+	ref--;
+	if( !ref )
+		delete this;
+	return 0;
+}

+ 31 - 0
ksgScript/Klassen/KSGSMausEreignis.h

@@ -0,0 +1,31 @@
+#ifndef KSGSMausEreignis_H
+#define KSGSMausEreignis_H
+
+#include "../Befehl/KSGSKlasse.h"
+#include <MausEreignis.h>
+
+namespace KSGScript
+{
+	class KSGSMausEreignisKlasse : public KSGSKlasseInstanz
+	{
+	private:
+		MausEreignis val;
+
+	public:
+		// Konstruktor
+		__declspec( dllexport ) KSGSMausEreignisKlasse( KSGScriptObj *zObj, MausEreignis std = { 0, 0, 0, 0, 0, 0 } );
+		// Destruktor
+		__declspec( dllexport ) ~KSGSMausEreignisKlasse();
+		// nicht constant
+		__declspec( dllexport ) void set( MausEreignis &me );
+		__declspec( dllexport ) virtual KSGSVariable *startFunktion( int id, bool access, RCArray< KSGSVariable > *parameter ) override;
+		__declspec( dllexport ) virtual KSGSVariable *doOperator( int id, KSGSVariable *rechts ) override;
+		// constant
+		__declspec( dllexport ) virtual KSGSVariable *getVariable( int id, bool zugriff ) const override;
+		__declspec( dllexport ) virtual MausEreignis getVal() const;
+		// Reference Counting
+		__declspec( dllexport ) virtual KSGSVariable *release() override;
+	};
+}
+
+#endif

+ 114 - 0
ksgScript/Klassen/KSGSTastaturEreignis.cpp

@@ -0,0 +1,114 @@
+#include "KSGSTastaturEreignis.h"
+#include "KSGSTyp.h"
+#include "KSGSInt.h"
+#include "KSGSBool.h"
+#include "../Error/Error.h"
+
+using namespace KSGScript;
+
+// Inhalt der KSGSTastaturEreigninKlasse Klasse aus KSGSTastaturEreignis.h
+// Konstruktor
+KSGSTastaturEreignisKlasse::KSGSTastaturEreignisKlasse( KSGScriptObj *zObj, TastaturEreignis std )
+	: KSGSKlasseInstanz( KSGS_TASTATUREREIGNIS, 0, 0, zObj )
+{
+	val = std;
+}
+
+// Destruktor
+KSGSTastaturEreignisKlasse::~KSGSTastaturEreignisKlasse()
+{
+}
+
+// nicht constant
+KSGSVariable *KSGSTastaturEreignisKlasse::startFunktion( int id, bool access, RCArray< KSGSVariable > *parameter )
+{
+	KSGSVariable *ret = 0;
+	switch( id )
+	{
+	case 0: // void setId( int id )
+		if( parameter->getEintragAnzahl() < 1 )
+			error( 20, {}, obj );
+		val.id = parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0;
+		break;
+	case 1: // void setTaste( int taste )
+		if( parameter->getEintragAnzahl() < 1 )
+			error( 20, {}, obj );
+		val.taste = parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0;
+		break;
+	case 2: // void setVerarbeitet( bool verarbeitet )
+		if( parameter->getEintragAnzahl() < 1 )
+			error( 20, {}, obj );
+		val.verarbeitet = parameter->z( 0 ) ? parameter->z( 0 )->getBool() : 0;
+		break;
+	default: // unbekannt
+		error( 19, {}, obj );
+		break;
+	}
+	parameter->release();
+	return ret;
+}
+
+void KSGSTastaturEreignisKlasse::set( TastaturEreignis &te )
+{
+	val = te;
+}
+
+KSGSVariable *KSGSTastaturEreignisKlasse::doOperator( int id, KSGSVariable *rechts )
+{
+	if( !rechts )
+	{
+		error( 3, {}, obj );
+		return 0;
+	}
+	KSGSVariable *ret = 0;
+	switch( id )
+	{
+	case KSGS_O_SET:
+		if( 1 )
+		{
+			val = rechts->getTastaturEreignis();
+			ret = getThis();
+		}
+		break;
+	}
+	if( !ret )
+		error( 21, {}, obj );
+	if( rechts )
+		rechts->release();
+	return ret;
+}
+
+// constant
+KSGSVariable *KSGSTastaturEreignisKlasse::getVariable( int id, bool zugriff ) const
+{
+	KSGSVariable *ret = 0;
+	switch( id )
+	{
+	case 0: // int id
+		ret = new KSGSIntKlasse( obj, val.id );
+		break;
+	case 1: // int taste
+		ret = new KSGSIntKlasse( obj, val.taste );
+		break;
+	case 2: // bool verarbeitet
+		ret = new KSGSBoolKlasse( obj, val.verarbeitet );
+		break;
+	}
+	if( !ret )
+		error( 17, {}, obj );
+	return ret;
+}
+
+TastaturEreignis KSGSTastaturEreignisKlasse::getVal() const
+{
+	return val;
+}
+
+// Reference Counting
+KSGSVariable *KSGSTastaturEreignisKlasse::release()
+{
+	ref--;
+	if( !ref )
+		delete this;
+	return 0;
+}

+ 31 - 0
ksgScript/Klassen/KSGSTastaturEreignis.h

@@ -0,0 +1,31 @@
+#ifndef KSGSTastaturEreignis_H
+#define KSGSTastaturEreignis_H
+
+#include "../Befehl/KSGSKlasse.h"
+#include <TastaturEreignis.h>
+
+namespace KSGScript
+{
+	class KSGSTastaturEreignisKlasse : public KSGSKlasseInstanz
+	{
+	private:
+		TastaturEreignis val;
+
+	public:
+		// Konstruktor
+		__declspec( dllexport ) KSGSTastaturEreignisKlasse( KSGScriptObj *zObj, TastaturEreignis std = { 0, 0, 0 } );
+		// Destruktor
+		__declspec( dllexport ) ~KSGSTastaturEreignisKlasse();
+		// nicht constant
+		__declspec( dllexport ) void set( TastaturEreignis &te );
+		__declspec( dllexport ) virtual KSGSVariable *startFunktion( int id, bool access, RCArray< KSGSVariable > *parameter ) override;
+		__declspec( dllexport ) virtual KSGSVariable *doOperator( int id, KSGSVariable *rechts ) override;
+		// constant
+		__declspec( dllexport ) virtual KSGSVariable *getVariable( int id, bool zugriff ) const override;
+		__declspec( dllexport ) virtual TastaturEreignis getVal() const;
+		// Reference Counting
+		__declspec( dllexport ) virtual KSGSVariable *release() override;
+	};
+}
+
+#endif

+ 229 - 0
ksgScript/Klassen/KSGSText.cpp

@@ -0,0 +1,229 @@
+#include "KSGSText.h"
+#include "KSGSTyp.h"
+#include "../Error/Error.h"
+#include "KSGSBool.h"
+#include "KSGSInt.h"
+#include "KSGSDouble.h"
+
+using namespace KSGScript;
+
+// Inhalt der KSGSTextKlasse Klasse aus KSGSText.h
+// Konstruktor
+KSGSTextKlasse::KSGSTextKlasse( KSGScriptObj *zObj, char *std )
+	: KSGSKlasseInstanz( KSGS_TEXT, 0, 0, zObj )
+{
+	val = new Text( std );
+}
+
+// Destruktor
+KSGSTextKlasse::~KSGSTextKlasse()
+{
+	val->release();
+}
+
+// nicht constant
+KSGSVariable *KSGSTextKlasse::startFunktion( int id, bool access, RCArray< KSGSVariable > *parameter )
+{
+	KSGSVariable *ret = 0;
+	switch( id )
+	{
+	case 0: // void setSuchGrenzen( int, int )
+		if( parameter->getEintragAnzahl() < 2 )
+			error( 20, {}, obj );
+		val->setSuchGrenzen( (char)( parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0 ),
+							 (char)( parameter->z( 1 ) ? parameter->z( 1 )->getInt() : 0 ) );
+		break;
+	case 1: // void setText( Text )
+		if( parameter->getEintragAnzahl() < 1 )
+			error( 20, {}, obj );
+		val->setText( parameter->z( 0 ) ? parameter->z( 0 )->getText() : new Text( "" ) );
+		break;
+	case 2: // void anhängen( Text )
+		if( parameter->getEintragAnzahl() < 1 )
+			error( 20, {}, obj );
+		val->append( parameter->z( 0 ) ? parameter->z( 0 )->getText() : new Text( "" ) );
+		break;
+	case 3: // void einfügen( int, Text )
+		if( parameter->getEintragAnzahl() < 2 )
+			error( 20, {}, obj );
+		val->insert( parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0,
+					   parameter->z( 1 ) ? parameter->z( 1 )->getText() : new Text( "" ) );
+		break;
+	case 4: // void ersetzen( int, int, Text )
+		if( parameter->getEintragAnzahl() < 3 )
+			error( 20, {}, obj );
+		val->ersetzen( parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0,
+					   parameter->z( 1 ) ? parameter->z( 1 )->getInt() : 0,
+					   parameter->z( 2 ) ? parameter->z( 2 )->getText() : new Text( "" ) );
+		break;
+	case 5: // void löschen( int, int )
+		if( parameter->getEintragAnzahl() < 2 )
+			error( 20, {}, obj );
+		val->remove( parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0,
+					  parameter->z( 1 ) ? parameter->z( 1 )->getInt() : 0 );
+		break;
+	case 6: // int getLänge()
+		ret = new KSGSIntKlasse( obj, val->getLength() );
+		break;
+	case 7: // bool hat( Text )
+		if( parameter->getEintragAnzahl() < 1 )
+			error( 20, {}, obj );
+		ret = new KSGSBoolKlasse( obj, val->hat( parameter->z( 0 ) ? parameter->z( 0 )->getText() : new Text( "" ) ) );
+		break;
+	case 8: // bool istGleich( Text )
+		if( parameter->getEintragAnzahl() < 1 )
+			error( 20, {}, obj );
+		ret = new KSGSBoolKlasse( obj, val->istGleich( parameter->z( 0 ) ? parameter->z( 0 )->getText() : new Text( "" ) ) );
+		break;
+	case 9: // int anzahlVon( Text )
+		if( parameter->getEintragAnzahl() < 1 )
+			error( 20, {}, obj );
+		ret = new KSGSIntKlasse( obj, val->anzahlVon( parameter->z( 0 ) ? parameter->z( 0 )->getText() : new Text( "" ) ) );
+		break;
+	case 10: // int positionVon( Text, int )
+		if( parameter->getEintragAnzahl() < 2 )
+			error( 20, {}, obj );
+		ret = new KSGSIntKlasse( obj, val->positionVon( parameter->z( 0 ) ? parameter->z( 0 )->getText() : new Text( "" ),
+														parameter->z( 1 ) ? parameter->z( 1 )->getInt() : 0 ) );
+		break;
+	case 11: // Text getTeilText( int, int )
+		if( 1 )
+		{
+			Text *txt = val->getTeilText( parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0,
+										  parameter->z( 1 ) ? parameter->z( 1 )->getInt() : 0 );
+			if( !txt )
+				txt = new Text();
+			ret = new KSGSTextKlasse( obj, *txt );
+			txt->release();
+		}
+		break;
+	default: // unbekannt
+		error( 19, {}, obj );
+		break;
+	}
+	parameter->release();
+	return ret;
+}
+
+KSGSVariable *KSGSTextKlasse::doOperator( int id, KSGSVariable *rechts )
+{
+	if( !rechts )
+	{
+		error( 3, {}, obj );
+		return 0;
+	}
+	KSGSVariable *ret = 0;
+	switch( id )
+	{
+	case KSGS_O_SET:
+		val->setText( rechts->getText() );
+		ret = getThis();
+		break;
+	case KSGS_O_PLUSSET:
+		val->append( rechts->getText() );
+		ret = getThis();
+		break;
+	case KSGS_O_MINUSSET:
+		val->append( rechts->getText() );
+		ret = getThis();
+		break;
+	case KSGS_O_GLEICH:
+		ret = new KSGSBoolKlasse( obj, val->istGleich( rechts->getText() ) );
+		break;
+	case KSGS_O_KLEINERGLEICH:
+		if( 1 )
+		{
+			Text *txt = rechts->getText();
+			ret = new KSGSBoolKlasse( obj, val->istGleich( rechts->getText() ) || *val < *txt );
+			txt->release();
+		}
+		break;
+	case KSGS_O_GRÖßERGLEICH:
+		if( 1 )
+		{
+			Text *txt = rechts->getText();
+			ret = new KSGSBoolKlasse( obj, val->istGleich( rechts->getText() ) || *val > *txt );
+			txt->release();
+		}
+		break;
+	case KSGS_O_UNGLEICH:
+		ret = new KSGSBoolKlasse( obj, !val->istGleich( rechts->getText() ) );
+		break;
+	case KSGS_O_KLEINER:
+		if( 1 )
+		{
+			Text *txt = rechts->getText();
+			ret = new KSGSBoolKlasse( obj, *val < *txt );
+			txt->release();
+		}
+		break;
+	case KSGS_O_GRÖßER:
+		if( 1 )
+		{
+			Text *txt = rechts->getText();
+			ret = new KSGSBoolKlasse( obj, *val > *txt );
+			txt->release();
+		}
+		break;
+	case KSGS_O_PLUS:
+		if( 1 )
+		{
+			Text *txt = rechts->getText();
+			ret = new KSGSTextKlasse( obj, Text( (char*)val ) += (char*)*txt );
+			txt->release();
+		}
+		break;
+	case KSGS_O_MINUS:
+		if( 1 )
+		{
+			Text t( (char*)val );
+			t.remove( rechts->getText() );
+			ret = new KSGSTextKlasse( obj, t );
+		}
+		break;
+	}
+	if( !ret )
+		error( 21, {}, obj );
+	if( rechts )
+		rechts->release();
+	return ret;
+}
+
+// constant
+Text *KSGSTextKlasse::getVal() const
+{
+	return val->getThis();
+}
+
+Text *KSGSTextKlasse::zVal() const
+{
+	return val;
+}
+
+KSGSVariable *KSGSTextKlasse::umwandelnIn( int typ ) const
+{
+	switch( typ )
+	{
+	case KSGS_BOOL:
+		if( val->istGleich( "true" ) )
+			return new KSGSBoolKlasse( obj, 1 );
+		if( val->istGleich( "false" ) )
+			return new KSGSBoolKlasse( obj, 0 );
+		return new KSGSBoolKlasse( obj, (int)*val != 0 );
+	case KSGS_INT:
+		return new KSGSIntKlasse( obj, *val );
+	case KSGS_DOUBLE:
+		return new KSGSDoubleKlasse( obj, *val );
+	}
+	error( 16, {}, obj );
+	return 0;
+}
+
+// Reference Counting
+KSGSVariable *KSGSTextKlasse::release()
+{
+	ref--;
+	if( !ref )
+		delete this;
+	return 0;
+}

+ 30 - 0
ksgScript/Klassen/KSGSText.h

@@ -0,0 +1,30 @@
+#ifndef KSGSText_H
+#define KSGSText_H
+
+#include "../Befehl/KSGSKlasse.h"
+
+namespace KSGScript
+{
+	class KSGSTextKlasse : public KSGSKlasseInstanz
+	{
+	private:
+		Text *val;
+
+	public:
+		// Konstruktor
+		__declspec( dllexport ) KSGSTextKlasse( KSGScriptObj *zObj, char *std = "" );
+		// Destruktor
+		__declspec( dllexport ) ~KSGSTextKlasse();
+		// nicht constant
+		__declspec( dllexport ) virtual KSGSVariable *startFunktion( int id, bool access, RCArray< KSGSVariable > *parameter ) override;
+		__declspec( dllexport ) virtual KSGSVariable *doOperator( int id, KSGSVariable *rechts ) override;
+		// constant
+		__declspec( dllexport ) virtual Text *getVal() const;
+		__declspec( dllexport ) virtual Text *zVal() const;
+		__declspec( dllexport ) virtual KSGSVariable *umwandelnIn( int typ ) const override;
+		// Reference Counting
+		__declspec( dllexport ) virtual KSGSVariable *release() override;
+	};
+}
+
+#endif

+ 425 - 0
ksgScript/Klassen/KSGSTextFeld.cpp

@@ -0,0 +1,425 @@
+#include "KSGSTextFeld.h"
+#include "KSGSTyp.h"
+#include "../Error/Error.h"
+#include "KSGSBool.h"
+#include "KSGSText.h"
+#include "KSGSBild.h"
+#include "KSGSInt.h"
+#include "KSGSBool.h"
+#include "../Main/KSGScriptObj.h"
+#include "KSGSMausEreignis.h"
+#include "KSGSTastaturEreignis.h"
+#include <ToolTip.h>
+
+using namespace KSGScript;
+
+// Inhalt der KSGSTextFeldKlasse Klasse aus KSGSTextFeld.h
+// Konstruktor
+KSGSTextFeldKlasse::KSGSTextFeldKlasse( KSGScriptObj *zObj, TextFeld *std )
+	: KSGSKlasseInstanz( KSGS_TEXTFELD, 0, 0, zObj )
+{
+	val = std;
+	mausF = -1;
+	tastaturF = -1;
+	val->setMausEreignisParameter( this );
+	val->setMausEreignis( ksgsTextFeldME );
+	val->setTastaturEreignisParameter( this );
+	val->setTastaturEreignis( ksgsTextFeldTE );
+	if( zObj->zSchrift() )
+	    val->setSchriftZ( zObj->getSchrift() );
+}
+
+// Destruktor
+KSGSTextFeldKlasse::~KSGSTextFeldKlasse()
+{
+	val->release();
+}
+
+// nicht constant
+KSGSVariable *KSGSTextFeldKlasse::startFunktion( int id, bool access, RCArray< KSGSVariable > *parameter )
+{
+	KSGSVariable *ret = 0;
+	switch( id )
+	{
+	case 0: // void setText( Text )
+		if( parameter->getEintragAnzahl() < 1 )
+			error( 20, {}, obj );
+		val->setText( parameter->z( 0 ) ? parameter->z( 0 )->getText() : new Text() );
+		break;
+	case 1: // void addZeile( Text )
+		if( 1 )
+		{
+			if( parameter->getEintragAnzahl() < 1 )
+				error( 20, {}, obj );
+			Text *txt = parameter->z( 0 ) ? parameter->z( 0 )->getText() : new Text();
+			val->addZeile( *txt );
+			txt->release();
+		}
+		break;
+	case 2: // void setAuswahl( int, int )
+		if( parameter->getEintragAnzahl() < 2 )
+			error( 20, {}, obj );
+		val->setAuswahl( parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0,
+						 parameter->z( 1 ) ? parameter->z( 1 )->getInt() : 0 );
+		break;
+	case 3: // void setHintergrundBild( Bild )
+		if( parameter->getEintragAnzahl() < 1 )
+			error( 20, {}, obj );
+		val->setHintergrundBildZ( parameter->z( 0 ) ? parameter->z( 0 )->getBild() : 0 );
+		break;
+	case 4: // void setHintergrundFarbe( int )
+		if( parameter->getEintragAnzahl() < 1 )
+			error( 20, {}, obj );
+		val->setHintergrundFarbe( parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0 );
+		break;
+	case 5: // void setSchriftGröße( int )
+		if( parameter->getEintragAnzahl() < 1 )
+			error( 20, {}, obj );
+		val->setSchriftSize( parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0 );
+		break;
+	case 6: // void setSchriftFarbe( int )
+		if( parameter->getEintragAnzahl() < 1 )
+			error( 20, {}, obj );
+		val->setSchriftFarbe( parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0 );
+		break;
+	case 7: // void setAFStärke( int )
+		if( parameter->getEintragAnzahl() < 1 )
+			error( 20, {}, obj );
+		val->setAlphaFeldStrength( parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0 );
+		break;
+	case 8: // void setAFFarbe( int )
+		if( parameter->getEintragAnzahl() < 1 )
+			error( 20, {}, obj );
+		val->setAlphaFeldFarbe( parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0 );
+		break;
+	case 9: // void setLRBreite( int )
+		if( parameter->getEintragAnzahl() < 1 )
+			error( 20, {}, obj );
+		val->setLinienRahmenBreite( parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0 );
+		break;
+	case 10: // void setLRFarbe( int )
+		if( parameter->getEintragAnzahl() < 1 )
+			error( 20, {}, obj );
+		val->setLinienRahmenFarbe( parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0 );
+		break;
+	case 11: // void setShowChar( int )
+		if( parameter->getEintragAnzahl() < 1 )
+			error( 20, {}, obj );
+		val->setSchowChar( (char)( parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0 ) );
+		break;
+	case 12: // void setVKlickScroll( int )
+		if( parameter->getEintragAnzahl() < 1 )
+			error( 20, {}, obj );
+		val->setVertikalKlickScroll( parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0 );
+		break;
+	case 13: // void setVScrollPos( int )
+		if( parameter->getEintragAnzahl() < 1 )
+			error( 20, {}, obj );
+		val->setVertikalScrollPos( parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0 );
+		break;
+	case 14: // void setVScrollZuZeile( int )
+		if( parameter->getEintragAnzahl() < 1 )
+			error( 20, {}, obj );
+		val->setVScrollZuZeile( parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0 );
+		break;
+	case 15: // void updateVScroll()
+		val->updateVScroll();
+		break;
+	case 16: // void setStyle( int )
+		if( parameter->getEintragAnzahl() < 1 )
+			error( 20, {}, obj );
+		val->setStyle( parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0 );
+		break;
+	case 17: // void addStyle( int )
+		if( parameter->getEintragAnzahl() < 1 )
+			error( 20, {}, obj );
+		val->addStyle( parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0 );
+		break;
+	case 18: // void löscheStyle( int )
+		if( parameter->getEintragAnzahl() < 1 )
+			error( 20, {}, obj );
+		val->removeStyle( parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0 );
+		break;
+	case 19: // bool tick( double )
+		if( parameter->getEintragAnzahl() < 1 )
+			error( 20, {}, obj );
+		ret = new KSGSBoolKlasse( obj, val->tick( parameter->z( 0 ) ? parameter->z( 0 )->getDouble() : 0 ) );
+		break;
+	case 20: // void setMausEreignis( Text )
+		if( 1 )
+		{
+			if( parameter->getEintragAnzahl() < 1 )
+				error( 20, {}, obj );
+			Text *n = parameter->z( 0 ) ? parameter->z( 0 )->getText() : 0;
+			if( n )
+			{
+				mausF = obj->getFunktionId( *n );
+				n->release();
+			}
+			else
+				mausF = -1;
+		}
+		break;
+	case 21: // void setTastaturEreignis( Text )
+		if( 1 )
+		{
+			if( parameter->getEintragAnzahl() < 1 )
+				error( 20, {}, obj );
+			Text *n = parameter->z( 0 ) ? parameter->z( 0 )->getText() : 0;
+			if( n )
+			{
+				tastaturF = obj->getFunktionId( *n );
+				n->release();
+			}
+			else
+				tastaturF = -1;
+		}
+		break;
+	case 22: // void doMausEreignis( MausEreignis )
+		if( 1 )
+		{
+			if( parameter->getEintragAnzahl() < 1 )
+				error( 20, {}, obj );
+			MausEreignis me = parameter->z( 0 ) ? parameter->z( 0 )->getMausEreignis() : MausEreignis{ 0, 0, 0, 0, 0, 0 };
+			val->doMausEreignis( me );
+		}
+		break;
+	case 23: // void doTastaturEreignis( TastaturEreignis )
+		if( 1 )
+		{
+			if( parameter->getEintragAnzahl() < 1 )
+				error( 20, {}, obj );
+			TastaturEreignis te = parameter->z( 0 ) ? parameter->z( 0 )->getTastaturEreignis() : TastaturEreignis{ 0, 0, 0 };
+			val->doTastaturEreignis( te );
+		}
+		break;
+	case 24: // void render( int, int, Bild )
+		if( 1 )
+		{
+			if( parameter->getEintragAnzahl() < 1 )
+				error( 20, {}, obj );
+			Bild *b = parameter->z( 0 ) ? parameter->z( 0 )->getBild() : 0;
+			if( b )
+			{
+				val->render( *b );
+				b->release();
+			}
+		}
+		break;
+	case 25: // Text getText()
+		if( 1 )
+		{
+			Text *txt = val->getText();
+			ret = new KSGSTextKlasse( obj, *txt );
+			txt->release();
+		}
+		break;
+	case 26: // Bild getHintergrundBild()
+		if( val->zHintergrundBild() )
+			ret = new KSGSBildKlasse( obj, val->getHintergrundBild() );
+		break;
+	case 27: // int getHintergrundFarbe()
+		ret = new KSGSIntKlasse( obj, val->getHintergrundFarbe() );
+		break;
+	case 28: // int getSchriftGröße()
+		ret = new KSGSIntKlasse( obj, val->getSchriftSize() );
+		break;
+	case 29: // int getSchriftFarbe()
+		ret = new KSGSIntKlasse( obj, val->getSchriftFarbe() );
+		break;
+	case 30: // int getAFStärke()
+		ret = new KSGSIntKlasse( obj, val->getAlphaFeldStrength() );
+		break;
+	case 31: // int getAFFarbe()
+		ret = new KSGSIntKlasse( obj, val->getAlphaFeldFarbe() );
+		break;
+	case 32: // int getLRBreite()
+		ret = new KSGSIntKlasse( obj, val->getLinienRahmenBreite() );
+		break;
+	case 33: // int getLRFarbe()
+		ret = new KSGSIntKlasse( obj, val->getLinienRahmenFarbe() );
+		break;
+	case 34: // int getShowChar()
+		ret = new KSGSIntKlasse( obj, val->getShowChar() );
+		break;
+	case 35: // bool hatStyle( int )
+		if( parameter->getEintragAnzahl() < 1 )
+			error( 20, {}, obj );
+		ret = new KSGSBoolKlasse( obj, val->hatStyle( parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0 ) );
+		break;
+	case 36: // bool hatStyleNicht( int )
+		if( parameter->getEintragAnzahl() < 1 )
+			error( 20, {}, obj );
+		ret = new KSGSBoolKlasse( obj, val->hatStyleNicht( parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0 ) );
+		break;
+	case 37: // TextFeld dublizieren()
+		ret = new KSGSTextFeldKlasse( obj, (TextFeld*)val->dublizieren() );
+		break;
+	case 38: // void setToolTipText( Text )
+		if( 1 )
+		{
+			if( parameter->getEintragAnzahl() < 1 )
+				error( 20, {}, obj );
+			Text *txt = parameter->z( 0 ) ? parameter->z( 0 )->getText() : 0;
+			val->setToolTipText( txt ? *txt : 0, obj->zBildschirm() );
+			if( txt )
+				txt->release();
+		}
+		break;
+	case 39: // void setPosition( int, int )
+		if( parameter->getEintragAnzahl() < 2 )
+			error( 20, {}, obj );
+		val->setPosition( parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0,
+						  parameter->z( 1 ) ? parameter->z( 1 )->getInt() : 0 );
+		break;
+	case 40: // void setGröße( int, int )
+		if( parameter->getEintragAnzahl() < 2 )
+			error( 20, {}, obj );
+		val->setSize( parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0,
+					   parameter->z( 1 ) ? parameter->z( 1 )->getInt() : 0 );
+		break;
+	case 41: // int getBreite()
+		ret = new KSGSIntKlasse( obj, val->getBreite() );
+		break;
+	case 42: // int getHöhe()
+		ret = new KSGSIntKlasse( obj, val->getHeight() );
+		break;
+	case 43: // int getX()
+		ret = new KSGSIntKlasse( obj, val->getX() );
+		break;
+	case 44: // int getY()
+		ret = new KSGSIntKlasse( obj, val->getY() );
+		break;
+	case 45: // Text getToolTipText()
+		if( 1 )
+		{
+			Text *txt = val->zToolTip() ? val->zToolTip()->zText() : 0;
+			ret = new KSGSTextKlasse( obj, txt ? *txt : "" );
+		}
+		break;
+	case 46: // void setGrößeNachText()
+		if( 1 )
+		{
+			Schrift *s = val->zSchrift();
+			if( s )
+			{
+				s->lock();
+				s->setSchriftSize( val->getSchriftSize() );
+				val->setSize( s->getTextBreite( val->zText() ), s->getTextHeight( val->zText() ) );
+				s->unlock();
+			}
+		}
+        break;
+    case 47: // void setTextNachGröße()
+        if( 1 )
+        {
+            Schrift *s = val->zSchrift();
+            if( s )
+            {
+                val->lockZeichnung();
+                s->textFormatieren( val->zText(), val->getBreite(), val->getSchriftSize() );
+                val->unlockZeichnung();
+            }
+        }
+        break;
+	default: // unbekannt
+		error( 19, {}, obj );
+		break;
+	}
+	parameter->release();
+	return ret;
+}
+
+KSGSVariable *KSGSTextFeldKlasse::doOperator( int id, KSGSVariable *rechts )
+{
+	if( !rechts )
+	{
+		error( 3, {}, obj );
+		return 0;
+	}
+	KSGSVariable *ret = 0;
+	switch( id )
+	{
+	case KSGS_O_SET:
+		if( 1 )
+		{
+			val->release();
+			val = rechts->getTextFeld();
+			ret = getThis();
+		}
+		break;
+	}
+	if( !ret )
+		error( 21, {}, obj );
+	if( rechts )
+		rechts->release();
+	return ret;
+}
+
+bool KSGSTextFeldKlasse::doMausEreignis( MausEreignis &me )
+{
+	if( mausF < 0 )
+		return 1;
+	RCArray< KSGSVariable > *parameter = new RCArray< KSGSVariable >();
+	parameter->add( new KSGSMausEreignisKlasse( obj, me ) );
+	KSGSVariable *ret = obj->startFunktion( mausF, parameter );
+	if( ret )
+	{
+		bool r = ret->getBool();
+		ret->release();
+		return r;
+	}
+	return 1;
+}
+
+bool KSGSTextFeldKlasse::doTastaturEreignis( TastaturEreignis &te )
+{
+	if( tastaturF < 0 )
+		return 1;
+	RCArray< KSGSVariable > *parameter = new RCArray< KSGSVariable >();
+	parameter->add( new KSGSTastaturEreignisKlasse( obj, te ) );
+	KSGSVariable *ret = obj->startFunktion( tastaturF, parameter );
+	if( ret )
+	{
+		bool r = ret->getBool();
+		ret->release();
+		return r;
+	}
+	return 1;
+}
+
+// constant
+TextFeld *KSGSTextFeldKlasse::getVal() const
+{
+	return val->getThis();
+}
+
+TextFeld *KSGSTextFeldKlasse::zVal() const
+{
+	return val;
+}
+
+// Reference Counting
+KSGSVariable *KSGSTextFeldKlasse::release()
+{
+	ref--;
+	if( !ref )
+		delete this;
+	return 0;
+}
+
+
+// Ereignisse
+bool KSGScript::ksgsTextFeldME( void *var, void *obj, MausEreignis me )
+{
+	if( !var )
+		return 1;
+	return ( (KSGSTextFeldKlasse*)var )->doMausEreignis( me );
+}
+
+bool KSGScript::ksgsTextFeldTE( void *var, void *obj, TastaturEreignis te )
+{
+	if( !var )
+		return 1;
+	return ( (KSGSTextFeldKlasse*)var )->doTastaturEreignis( te );
+}

+ 38 - 0
ksgScript/Klassen/KSGSTextFeld.h

@@ -0,0 +1,38 @@
+#ifndef KSGSTextFeld_H
+#define KSGSTextFeld_H
+
+#include "../Befehl/KSGSKlasse.h"
+#include <TextFeld.h>
+
+namespace KSGScript
+{
+	class KSGSTextFeldKlasse : public KSGSKlasseInstanz
+	{
+	private:
+		TextFeld *val;
+		int mausF;
+		int tastaturF;
+
+	public:
+		// Konstruktor
+		__declspec( dllexport ) KSGSTextFeldKlasse( KSGScriptObj *zObj, TextFeld *std = new TextFeld() );
+		// Destruktor
+		__declspec( dllexport ) ~KSGSTextFeldKlasse();
+		// nicht constant
+		__declspec( dllexport ) virtual KSGSVariable *startFunktion( int id, bool access, RCArray< KSGSVariable > *parameter ) override;
+		__declspec( dllexport ) virtual KSGSVariable *doOperator( int id, KSGSVariable *rechts ) override;
+		__declspec( dllexport ) virtual bool doMausEreignis( MausEreignis &me );
+		__declspec( dllexport ) virtual bool doTastaturEreignis( TastaturEreignis &te );
+		// constant
+		__declspec( dllexport ) virtual TextFeld *getVal() const;
+		__declspec( dllexport ) virtual TextFeld *zVal() const;
+		// Reference Counting
+		__declspec( dllexport ) virtual KSGSVariable *release() override;
+	};
+
+	// Ereignisse
+	__declspec( dllexport ) bool ksgsTextFeldME( void *var, void *obj, MausEreignis me );
+	__declspec( dllexport ) bool ksgsTextFeldTE( void *var, void *obj, TastaturEreignis te );
+}
+
+#endif

+ 81 - 0
ksgScript/Klassen/KSGSThread.cpp

@@ -0,0 +1,81 @@
+#include "KSGSThread.h"
+#include "KSGSTyp.h"
+#include "../Error/Error.h"
+#include "KSGSInt.h"
+#include "KSGSBool.h"
+
+using namespace KSGScript;
+
+// Inhalt der KSGSThreadKlasse Klasse aus KSGSThreadKlasse.h
+// Konstruktor
+KSGSThreadKlasse::KSGSThreadKlasse( KSGScriptObj *zObj, KSGSFunktionInstanz *f )
+	: KSGSKlasseInstanz( KSGS_THREAD, 0, 0, zObj )
+{
+	func = f;
+}
+
+// Destruktor
+KSGSThreadKlasse::~KSGSThreadKlasse()
+{
+	if( func )
+		func->release();
+}
+
+// nicht constant
+void KSGSThreadKlasse::threadEnde()
+{
+	if( func )
+		func = func->release();
+}
+
+KSGSVariable *KSGSThreadKlasse::startFunktion( int id, bool access, RCArray< KSGSVariable > *parameter )
+{
+	switch( id )
+	{
+	case 0: // void pause();
+		if( func )
+			func->setPause( 1 );
+		break;
+	case 1: // void fortsetzen();
+		if( func )
+			func->setPause( 0 );
+		break;
+	case 2: // void ende();
+		if( func )
+			func->setEnde();
+		break;
+	case 3: // bool läuft();
+		if( func )
+		{
+			parameter->release();
+			return new KSGSBoolKlasse( obj, func->wirdAusgeführt() );
+		}
+		break;
+	case 4: // int warteAufThread( int zeit )
+		if( func )
+		{
+			int zeit = 0;
+			if( parameter->getEintragAnzahl() >= 1 && parameter->z( 0 ) )
+				zeit = parameter->z( 0 )->getInt();
+			else
+				error( 20, {}, obj );
+			parameter->release();
+			return new KSGSIntKlasse( obj, func->warteAufFunktion( zeit ) );
+		}
+		break;
+	default:
+		error( 19, {}, obj );
+		break;
+	}
+	parameter->release();
+	return 0;
+}
+
+// Reference Counting
+KSGSVariable *KSGSThreadKlasse::release()
+{
+	ref--;
+	if( !ref )
+		delete this;
+	return 0;
+}

+ 26 - 0
ksgScript/Klassen/KSGSThread.h

@@ -0,0 +1,26 @@
+#ifndef KAGSThread_H
+#define KAGSThread_H
+
+#include "../Befehl/KSGSKlasse.h"
+
+namespace KSGScript
+{
+	class KSGSThreadKlasse : public KSGSKlasseInstanz
+	{
+	private:
+		KSGSFunktionInstanz *func;
+
+	public:
+		// Konstruktor
+		__declspec( dllexport ) KSGSThreadKlasse( KSGScriptObj *zObj, KSGSFunktionInstanz *f );
+		// Destruktor
+		__declspec( dllexport ) ~KSGSThreadKlasse();
+		// nicht constant
+		__declspec( dllexport ) void threadEnde();
+		__declspec( dllexport ) virtual KSGSVariable *startFunktion( int id, bool access, RCArray< KSGSVariable > *parameter ) override;
+		// Reference Counting
+		__declspec( dllexport ) virtual KSGSVariable *release() override;
+	};
+}
+
+#endif

+ 62 - 0
ksgScript/Klassen/KSGSTyp.h

@@ -0,0 +1,62 @@
+#ifndef KSGSTyp_H
+#define KSGSTyp_H
+
+// Klassen
+// Entspricht der Definitionsreihenfolge im Konstruktor der KSGSCompKlassTable Klasse aus KSGSCompile.h
+#define KSGS_TYP_MIN          0
+
+#define KSGS_VOID			  0
+#define KSGS_BOOL			  1
+#define KSGS_INT              2
+#define KSGS_DOUBLE			  3
+#define KSGS_ARRAY            4
+#define KSGS_THREAD			  5
+#define KSGS_TEXT			  6
+#define KSGS_BILD			  7
+#define KSGS_MAUSEREIGNIS     8
+#define KSGS_TASTATUREREIGNIS 9
+#define KSGS_TEXTFELD         10
+#define KSGS_KNOPF            11
+#define KSGS_FENSTER          12
+#define KSGS_BILDO            13
+#define KSGS_ANIMATION2DDATA  14
+#define KSGS_ANIMATION2D      15
+
+#define KSGS_TYP_MAX          15
+
+// Operatoren
+
+#define KSGS_O_TYP_MIN        0
+
+#define KSGS_O_SET            0
+#define KSGS_O_PLUSSET        1
+#define KSGS_O_MINUSSET       2
+#define KSGS_O_MAHLSET        3
+#define KSGS_O_GETEILTSET     4
+#define KSGS_O_UNDSET         5
+#define KSGS_O_ODERSET        6
+#define KSGS_O_GLEICH         7
+#define KSGS_O_KLEINERGLEICH  8
+#define KSGS_O_GRÖßERGLEICH   9
+#define KSGS_O_UNGLEICH       10
+#define KSGS_O_KLEINER        11
+#define KSGS_O_GRÖßER         12
+#define KSGS_O_ODER           13
+#define KSGS_O_UND            14
+#define KSGS_O_BITODER        15
+#define KSGS_O_BITUND         16
+#define KSGS_O_PLUS           17
+#define KSGS_O_MINUS          18
+#define KSGS_O_MAHL           19
+#define KSGS_O_GETEILT        20
+#define KSGS_O_REST           21
+#define KSGS_O_PLUS1          22
+#define KSGS_O_MINUS1         23
+#define KSGS_O_NICHT          24
+#define KSGS_O_BITNICHT       25
+#define KSGS_O_NACHLINKS      26
+#define KSGS_O_NACHRECHTS     27
+
+#define KSGS_O_TYP_MAX        27
+
+#endif

+ 608 - 0
ksgScript/Leser/KSGSCompile.cpp

@@ -0,0 +1,608 @@
+#include "KSGSCompile.h"
+#include "../Klassen/KSGSTyp.h"
+
+using namespace KSGScript;
+
+// Compile Strukturen
+KSGSCompileVariable::KSGSCompileVariable( int t, int s )
+{
+	typ = t;
+	sichtbar = s;
+}
+
+KSGSCompileFunktion::KSGSCompileFunktion( int t, int s, std::initializer_list< int > pt )
+{
+	typ = t;
+	sichtbar = s;
+	for( auto p = pt.begin(); p != pt.end(); p++ )
+		parameterTyp.add( *p );
+}
+
+
+// Inhalt der KSGSCompVarTable Klasse aus KSGSCompile.h
+// Konstruktor
+KSGSCompVarTable::KSGSCompVarTable()
+{
+	namen = new RCArray< Text >();
+	vars = new Array< KSGSCompileVariable* >();
+	ref = 1;
+}
+
+// Destruktor
+KSGSCompVarTable::~KSGSCompVarTable()
+{
+	namen->release();
+	int anz = vars->getEintragAnzahl();
+	for( int i = 0; i < anz; i++ )
+		delete vars->get( i );
+	vars->release();
+}
+
+// nicht constant
+bool KSGSCompVarTable::addVariable( const char *name, KSGSCompileVariable *var ) // fügt namen der Tabelle hinzu
+{
+	if( !hat( name ) )
+	{
+		var->id = namen->getEintragAnzahl();
+		namen->set( new Text( name ), var->id );
+		vars->set( var, var->id );
+	}
+	else
+	{
+		delete var;
+		return 0;
+	}
+	return 1;
+}
+
+// constant
+KSGSCompileVariable *KSGSCompVarTable::get( const char *name ) const // gibt die KSGSCompVarTableariable eines Namens zurück
+{
+	int anz = namen->getEintragAnzahl();
+	for( int i = 0; i < anz; i++ )
+	{
+		if( namen->z( i )->istGleich( name ) )
+			return vars->get( i );
+	}
+	return 0;
+}
+
+bool KSGSCompVarTable::hat( const char *name ) const // prüft, ob name vorhanden ist
+{
+	int anz = namen->getEintragAnzahl();
+	for( int i = 0; i < anz; i++ )
+	{
+		if( namen->z( i )->istGleich( name ) )
+			return 1;
+	}
+	return 0;
+}
+
+// Reference Counting
+KSGSCompVarTable *KSGSCompVarTable::getThis()
+{
+	ref++;
+	return this;
+}
+
+KSGSCompVarTable *KSGSCompVarTable::release()
+{
+	ref--;
+	if( !ref )
+		delete this;
+	return 0;
+}
+
+
+// Inhalt der KSGSCompFuncTable Klasse aus KSGSCompile.h
+// Konstruktor
+KSGSCompFuncTable::KSGSCompFuncTable()
+{
+	namen = new RCArray< Text >();
+	funks = new Array< KSGSCompileFunktion* >();
+	ref = 1;
+}
+
+// Destruktor
+KSGSCompFuncTable::~KSGSCompFuncTable()
+{
+	namen->release();
+	int anz = funks->getEintragAnzahl();
+	for( int i = 0; i < anz; i++ )
+		delete funks->get( i );
+	funks->release();
+}
+
+// nicht constant
+bool KSGSCompFuncTable::addFunktion( const char *name, KSGSCompileFunktion *func ) // fügt namen der Tabelle hinzu
+{
+	if( !hat( name ) )
+	{
+		func->id = namen->getEintragAnzahl();
+		namen->set( new Text( name ), func->id );
+		funks->set( func, func->id );
+	}
+	else
+	{
+		delete func;
+		return 0;
+	}
+	return 1;
+}
+
+// constant
+KSGSCompileFunktion *KSGSCompFuncTable::get( const char *name ) const // gibt die KSGSCompVarTableariable eines Namens zurück
+{
+	int anz = namen->getEintragAnzahl();
+	for( int i = 0; i < anz; i++ )
+	{
+		if( namen->z( i )->istGleich( name ) )
+			return funks->get( i );
+	}
+	return 0;
+}
+
+bool KSGSCompFuncTable::hat( const char *name ) const // prüft, ob name vorhanden ist
+{
+	int anz = namen->getEintragAnzahl();
+	for( int i = 0; i < anz; i++ )
+	{
+		if( namen->z( i )->istGleich( name ) )
+			return 1;
+	}
+	return 0;
+}
+
+// Reference Counting
+KSGSCompFuncTable *KSGSCompFuncTable::getThis()
+{
+	ref++;
+	return this;
+}
+
+KSGSCompFuncTable *KSGSCompFuncTable::release()
+{
+	ref--;
+	if( !ref )
+		delete this;
+	return 0;
+}
+
+
+// Inhalt der KSGSCompKlassTable Klasse aus KSGSCompile.h
+// Konstruktor
+KSGSCompKlassTable::KSGSCompKlassTable()
+{
+	namen = new RCArray< Text >();
+	klassen = new Array< KSGSCompileKlasse* >();
+	ref = 1;
+	// Standart klassen
+	// Void Standart
+	addKlasse( "void", new KSGSCompileKlasse() );
+	// bool Standart
+	addKlasse( "bool", new KSGSCompileKlasse() );
+	// int Standart
+	addKlasse( "int", new KSGSCompileKlasse() );
+	// double Standart
+	addKlasse( "double", new KSGSCompileKlasse() );
+	// Array Standart
+	KSGSCompileKlasse *_array = new KSGSCompileKlasse();
+	addKlasse( "Array", _array );
+	_array->funcs.addFunktion( "anhängen", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_VOID } ) );
+	_array->funcs.addFunktion( "einfügen", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_INT, KSGS_VOID } ) );
+	_array->funcs.addFunktion( "set", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_INT, KSGS_VOID } ) );
+	_array->funcs.addFunktion( "setPosition", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_INT, KSGS_INT } ) );
+	_array->funcs.addFunktion( "lösche", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_INT } ) );
+	_array->funcs.addFunktion( "tausche", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_INT, KSGS_INT } ) );
+	_array->funcs.addFunktion( "leeren", new KSGSCompileFunktion( KSGS_VOID, 1, {} ) );
+	_array->funcs.addFunktion( "getEintragAnzahl", new KSGSCompileFunktion( KSGS_INT, 1, {} ) );
+	_array->funcs.addFunktion( "get", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_INT } ) );
+	_array->funcs.addFunktion( "hat", new KSGSCompileFunktion( KSGS_BOOL, 1, { KSGS_INT } ) );
+	// Thread Standart
+	KSGSCompileKlasse *_thread = new KSGSCompileKlasse();
+	addKlasse( "Thread", _thread );
+	_thread->funcs.addFunktion( "pause", new KSGSCompileFunktion( KSGS_VOID, 1, {} ) );
+	_thread->funcs.addFunktion( "fortsetzen", new KSGSCompileFunktion( KSGS_VOID, 1, {} ) );
+	_thread->funcs.addFunktion( "ende", new KSGSCompileFunktion( KSGS_VOID, 1, {} ) );
+	_thread->funcs.addFunktion( "läuft", new KSGSCompileFunktion( KSGS_BOOL, 1, {} ) );
+	_thread->funcs.addFunktion( "warteAufThread", new KSGSCompileFunktion( KSGS_INT, 1, { KSGS_INT } ) );
+	// Text Standart
+	KSGSCompileKlasse *_Text = new KSGSCompileKlasse();
+	addKlasse( "Text", _Text );
+	_Text->funcs.addFunktion( "setSuchGrenzen", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_INT, KSGS_INT } ) );
+	_Text->funcs.addFunktion( "setText", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_TEXT } ) );
+	_Text->funcs.addFunktion( "anhängen", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_TEXT } ) );
+	_Text->funcs.addFunktion( "einfügen", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_INT, KSGS_TEXT } ) );
+	_Text->funcs.addFunktion( "ersetzen", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_INT, KSGS_INT, KSGS_TEXT } ) );
+	_Text->funcs.addFunktion( "löschen", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_INT, KSGS_INT } ) );
+	_Text->funcs.addFunktion( "getLänge", new KSGSCompileFunktion( KSGS_INT, 1, {} ) );
+	_Text->funcs.addFunktion( "hat", new KSGSCompileFunktion( KSGS_BOOL, 1, { KSGS_TEXT } ) );
+	_Text->funcs.addFunktion( "istGleich", new KSGSCompileFunktion( KSGS_BOOL, 1, { KSGS_TEXT } ) );
+	_Text->funcs.addFunktion( "anzahlVon", new KSGSCompileFunktion( KSGS_INT, 1, { KSGS_TEXT } ) );
+	_Text->funcs.addFunktion( "positionVon", new KSGSCompileFunktion( KSGS_INT, 1, { KSGS_TEXT, KSGS_INT } ) );
+	_Text->funcs.addFunktion( "getTeilText", new KSGSCompileFunktion( KSGS_TEXT, 1, { KSGS_INT, KSGS_INT } ) );
+	// Bild Standart
+	KSGSCompileKlasse *_Bild = new KSGSCompileKlasse();
+	addKlasse( "Bild", _Bild );
+	_Bild->funcs.addFunktion( "neuBild", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_INT, KSGS_INT, KSGS_INT } ) );
+	_Bild->funcs.addFunktion( "setAlpha", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_INT } ) );
+	_Bild->funcs.addFunktion( "releaseAlpha", new KSGSCompileFunktion( KSGS_VOID, 1, {} ) );
+	_Bild->funcs.addFunktion( "alphaPixel", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_INT, KSGS_INT, KSGS_INT } ) );
+	_Bild->funcs.addFunktion( "setPixel", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_INT, KSGS_INT, KSGS_INT } ) );
+	_Bild->funcs.addFunktion( "alphaRegion", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_INT, KSGS_INT, KSGS_INT, KSGS_INT, KSGS_INT } ) );
+	_Bild->funcs.addFunktion( "füllRegion", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_INT, KSGS_INT, KSGS_INT, KSGS_INT, KSGS_INT } ) );
+	_Bild->funcs.addFunktion( "drawLinieAlpha", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_INT, KSGS_INT, KSGS_INT, KSGS_INT, KSGS_INT } ) );
+	_Bild->funcs.addFunktion( "drawLinie", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_INT, KSGS_INT, KSGS_INT, KSGS_INT, KSGS_INT } ) );
+	_Bild->funcs.addFunktion( "alphaBild", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_INT, KSGS_INT, KSGS_INT, KSGS_INT, KSGS_BILD } ) );
+	_Bild->funcs.addFunktion( "drawBild", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_INT, KSGS_INT, KSGS_INT, KSGS_INT, KSGS_BILD } ) );
+	_Bild->funcs.addFunktion( "alphaBild90", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_INT, KSGS_INT, KSGS_INT, KSGS_INT, KSGS_BILD } ) );
+	_Bild->funcs.addFunktion( "drawBild90", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_INT, KSGS_INT, KSGS_INT, KSGS_INT, KSGS_BILD } ) );
+	_Bild->funcs.addFunktion( "alphaBild180", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_INT, KSGS_INT, KSGS_INT, KSGS_INT, KSGS_BILD } ) );
+	_Bild->funcs.addFunktion( "drawBild180", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_INT, KSGS_INT, KSGS_INT, KSGS_INT, KSGS_BILD } ) );
+	_Bild->funcs.addFunktion( "alphaBild270", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_INT, KSGS_INT, KSGS_INT, KSGS_INT, KSGS_BILD } ) );
+	_Bild->funcs.addFunktion( "drawBild270", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_INT, KSGS_INT, KSGS_INT, KSGS_INT, KSGS_BILD } ) );
+	_Bild->funcs.addFunktion( "setDrawOptions", new KSGSCompileFunktion( KSGS_BOOL, 1, { KSGS_INT, KSGS_INT, KSGS_INT, KSGS_INT } ) );
+	_Bild->funcs.addFunktion( "setDrawOptionsErzwingen", new KSGSCompileFunktion( KSGS_BOOL, 1, { KSGS_INT, KSGS_INT, KSGS_INT, KSGS_INT } ) );
+	_Bild->funcs.addFunktion( "releaseDrawOptions", new KSGSCompileFunktion( KSGS_VOID, 1, {} ) );
+	_Bild->funcs.addFunktion( "getBreite", new KSGSCompileFunktion( KSGS_INT, 1, {} ) );
+	_Bild->funcs.addFunktion( "getHöhe", new KSGSCompileFunktion( KSGS_INT, 1, {} ) );
+	_Bild->funcs.addFunktion( "getPixel", new KSGSCompileFunktion( KSGS_INT, 1, { KSGS_INT, KSGS_INT } ) );
+	_Bild->funcs.addFunktion( "addScrollOffset", new KSGSCompileFunktion( KSGS_BOOL, 1, { KSGS_INT, KSGS_INT } ) );
+	// MausEreignis Standart
+	KSGSCompileKlasse *_MausEreignis = new KSGSCompileKlasse();
+	addKlasse( "MausEreignis", _MausEreignis );
+	_MausEreignis->vars.addVariable( "id", new KSGSCompileVariable( KSGS_INT, 1 ) );
+	_MausEreignis->vars.addVariable( "mx", new KSGSCompileVariable( KSGS_INT, 1 ) );
+	_MausEreignis->vars.addVariable( "my", new KSGSCompileVariable( KSGS_INT, 1 ) );
+	_MausEreignis->vars.addVariable( "rmx", new KSGSCompileVariable( KSGS_INT, 1 ) );
+	_MausEreignis->vars.addVariable( "rmy", new KSGSCompileVariable( KSGS_INT, 1 ) );
+	_MausEreignis->vars.addVariable( "verarbeitet", new KSGSCompileVariable( KSGS_BOOL, 1 ) );
+	_MausEreignis->funcs.addFunktion( "setId", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_INT } ) );
+	_MausEreignis->funcs.addFunktion( "setMx", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_INT } ) );
+	_MausEreignis->funcs.addFunktion( "setMy", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_INT } ) );
+	_MausEreignis->funcs.addFunktion( "setRmx", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_INT } ) );
+	_MausEreignis->funcs.addFunktion( "setRmy", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_INT } ) );
+	_MausEreignis->funcs.addFunktion( "setVerarbeitet", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_BOOL } ) );
+	// TastaturEreignis Standart
+	KSGSCompileKlasse *_TastaturEreignis = new KSGSCompileKlasse();
+	addKlasse( "TastaturEreignis", _TastaturEreignis );
+	_TastaturEreignis->vars.addVariable( "id", new KSGSCompileVariable( KSGS_INT, 1 ) );
+	_TastaturEreignis->vars.addVariable( "taste", new KSGSCompileVariable( KSGS_INT, 1 ) );
+	_TastaturEreignis->vars.addVariable( "verarbeitet", new KSGSCompileVariable( KSGS_BOOL, 1 ) );
+	_TastaturEreignis->funcs.addFunktion( "setId", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_INT } ) );
+	_TastaturEreignis->funcs.addFunktion( "setTaste", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_INT } ) );
+	_TastaturEreignis->funcs.addFunktion( "setVerarbeitet", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_BOOL } ) );
+	// TextFeld Standart
+	KSGSCompileKlasse *_TextFeld = new KSGSCompileKlasse();
+	addKlasse( "TextFeld", _TextFeld );
+	_TextFeld->funcs.addFunktion( "setText", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_TEXT } ) );
+	_TextFeld->funcs.addFunktion( "addZeile", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_TEXT } ) );
+	_TextFeld->funcs.addFunktion( "setAuswahl", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_INT, KSGS_INT } ) );
+	_TextFeld->funcs.addFunktion( "setHintergrundBild", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_BILD } ) );
+	_TextFeld->funcs.addFunktion( "setHintergrundFarbe", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_INT } ) );
+	_TextFeld->funcs.addFunktion( "setSchriftGröße", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_INT } ) );
+	_TextFeld->funcs.addFunktion( "setSchriftFarbe", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_INT } ) );
+	_TextFeld->funcs.addFunktion( "setAFStärke", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_INT } ) );
+	_TextFeld->funcs.addFunktion( "setAFFarbe", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_INT } ) );
+	_TextFeld->funcs.addFunktion( "setLRBreite", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_INT } ) );
+	_TextFeld->funcs.addFunktion( "setLRFarbe", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_INT } ) );
+	_TextFeld->funcs.addFunktion( "setShowChar", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_INT } ) );
+	_TextFeld->funcs.addFunktion( "setVKlickScroll", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_INT } ) );
+	_TextFeld->funcs.addFunktion( "setVScrollPos", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_INT } ) );
+	_TextFeld->funcs.addFunktion( "setVScrollZuZeile", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_INT } ) );
+	_TextFeld->funcs.addFunktion( "updateVScroll", new KSGSCompileFunktion( KSGS_VOID, 1, {} ) );
+	_TextFeld->funcs.addFunktion( "setStyle", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_INT } ) );
+	_TextFeld->funcs.addFunktion( "addStyle", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_INT } ) );
+	_TextFeld->funcs.addFunktion( "löscheStyle", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_INT } ) );
+	_TextFeld->funcs.addFunktion( "tick", new KSGSCompileFunktion( KSGS_BOOL, 1, { KSGS_DOUBLE } ) );
+	_TextFeld->funcs.addFunktion( "setMausEreignis", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_TEXT } ) );
+	_TextFeld->funcs.addFunktion( "setTastaturEreignis", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_TEXT } ) );
+	_TextFeld->funcs.addFunktion( "doMausEreignis", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_MAUSEREIGNIS } ) );
+	_TextFeld->funcs.addFunktion( "doTastaturEreignis", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_TASTATUREREIGNIS } ) );
+	_TextFeld->funcs.addFunktion( "render", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_BILD } ) );
+	_TextFeld->funcs.addFunktion( "getText", new KSGSCompileFunktion( KSGS_TEXT, 1, {} ) );
+	_TextFeld->funcs.addFunktion( "getHintergrundBild", new KSGSCompileFunktion( KSGS_BILD, 1, {} ) );
+	_TextFeld->funcs.addFunktion( "getHintergrundFarbe", new KSGSCompileFunktion( KSGS_INT, 1, {} ) );
+	_TextFeld->funcs.addFunktion( "getSchriftGröße", new KSGSCompileFunktion( KSGS_INT, 1, {} ) );
+	_TextFeld->funcs.addFunktion( "getSchriftFarbe", new KSGSCompileFunktion( KSGS_INT, 1, {} ) );
+	_TextFeld->funcs.addFunktion( "getAFStärke", new KSGSCompileFunktion( KSGS_INT, 1, {} ) );
+	_TextFeld->funcs.addFunktion( "getAFFarbe", new KSGSCompileFunktion( KSGS_INT, 1, {} ) );
+	_TextFeld->funcs.addFunktion( "getLRBreite", new KSGSCompileFunktion( KSGS_INT, 1, {} ) );
+	_TextFeld->funcs.addFunktion( "getLRFarbe", new KSGSCompileFunktion( KSGS_INT, 1, {} ) );
+	_TextFeld->funcs.addFunktion( "getShowChar", new KSGSCompileFunktion( KSGS_INT, 1, {} ) );
+	_TextFeld->funcs.addFunktion( "hatStyle", new KSGSCompileFunktion( KSGS_BOOL, 1, { KSGS_INT } ) );
+	_TextFeld->funcs.addFunktion( "hatStyleNicht", new KSGSCompileFunktion( KSGS_BOOL, 1, { KSGS_INT } ) );
+	_TextFeld->funcs.addFunktion( "dublizieren", new KSGSCompileFunktion( KSGS_TEXTFELD, 1, {} ) );
+	_TextFeld->funcs.addFunktion( "setToolTipText", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_TEXT } ) );
+	_TextFeld->funcs.addFunktion( "setPosition", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_INT, KSGS_INT } ) );
+	_TextFeld->funcs.addFunktion( "setGröße", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_INT, KSGS_INT } ) );
+	_TextFeld->funcs.addFunktion( "getBreite", new KSGSCompileFunktion( KSGS_INT, 1, {} ) );
+	_TextFeld->funcs.addFunktion( "getHöhe", new KSGSCompileFunktion( KSGS_INT, 1, {} ) );
+	_TextFeld->funcs.addFunktion( "getX", new KSGSCompileFunktion( KSGS_INT, 1, {} ) );
+	_TextFeld->funcs.addFunktion( "getY", new KSGSCompileFunktion( KSGS_INT, 1, {} ) );
+	_TextFeld->funcs.addFunktion( "getToolTipText", new KSGSCompileFunktion( KSGS_TEXT, 1, {} ) );
+    _TextFeld->funcs.addFunktion( "setGrößeNachText", new KSGSCompileFunktion( KSGS_VOID, 1, {} ) );
+    _TextFeld->funcs.addFunktion( "setTextNachGröße", new KSGSCompileFunktion( KSGS_VOID, 1, {} ) );
+	// Knopf Standart
+	KSGSCompileKlasse *_Knopf = new KSGSCompileKlasse();
+	addKlasse( "Knopf", _Knopf );
+	_Knopf->funcs.addFunktion( "setText", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_TEXT } ) );
+	_Knopf->funcs.addFunktion( "setHintergrundBild", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_BILD } ) );
+	_Knopf->funcs.addFunktion( "setHintergrundFarbe", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_INT } ) );
+	_Knopf->funcs.addFunktion( "setSchriftGröße", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_INT } ) );
+	_Knopf->funcs.addFunktion( "setSchriftFarbe", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_INT } ) );
+	_Knopf->funcs.addFunktion( "setAFStärke", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_INT } ) );
+	_Knopf->funcs.addFunktion( "setAFFarbe", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_INT } ) );
+	_Knopf->funcs.addFunktion( "setLRBreite", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_INT } ) );
+	_Knopf->funcs.addFunktion( "setLRFarbe", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_INT } ) );
+	_Knopf->funcs.addFunktion( "setKlickFarbe", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_INT } ) );
+	_Knopf->funcs.addFunktion( "setKlickBild", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_BILD } ) );
+	_Knopf->funcs.addFunktion( "setKBStärke", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_INT } ) );
+	_Knopf->funcs.addFunktion( "setKBFarbe", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_INT } ) );
+	_Knopf->funcs.addFunktion( "setStyle", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_INT } ) );
+	_Knopf->funcs.addFunktion( "addStyle", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_INT } ) );
+	_Knopf->funcs.addFunktion( "löscheStyle", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_INT } ) );
+	_Knopf->funcs.addFunktion( "tick", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_DOUBLE } ) );
+	_Knopf->funcs.addFunktion( "setMausEreignis", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_TEXT } ) );
+	_Knopf->funcs.addFunktion( "doMausEreignis", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_MAUSEREIGNIS } ) );
+	_Knopf->funcs.addFunktion( "render", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_BILD } ) );
+	_Knopf->funcs.addFunktion( "getText", new KSGSCompileFunktion( KSGS_TEXT, 1, {} ) );
+	_Knopf->funcs.addFunktion( "getHintergrundBild", new KSGSCompileFunktion( KSGS_BILD, 1, {} ) );
+	_Knopf->funcs.addFunktion( "getHintergrundFarbe", new KSGSCompileFunktion( KSGS_INT, 1, {} ) );
+	_Knopf->funcs.addFunktion( "getSchriftGröße", new KSGSCompileFunktion( KSGS_INT, 1, {} ) );
+	_Knopf->funcs.addFunktion( "getSchriftFarbe", new KSGSCompileFunktion( KSGS_INT, 1, {} ) );
+	_Knopf->funcs.addFunktion( "getAFStärke", new KSGSCompileFunktion( KSGS_INT, 1, {} ) );
+	_Knopf->funcs.addFunktion( "getAFFarbe", new KSGSCompileFunktion( KSGS_INT, 1, {} ) );
+	_Knopf->funcs.addFunktion( "getLRBreite", new KSGSCompileFunktion( KSGS_INT, 1, {} ) );
+	_Knopf->funcs.addFunktion( "getLRFarbe", new KSGSCompileFunktion( KSGS_INT, 1, {} ) );
+	_Knopf->funcs.addFunktion( "getKlickFarbe", new KSGSCompileFunktion( KSGS_INT, 1, {} ) );
+	_Knopf->funcs.addFunktion( "getKlickBild", new KSGSCompileFunktion( KSGS_BILD, 1, {} ) );
+	_Knopf->funcs.addFunktion( "getKBFarbe", new KSGSCompileFunktion( KSGS_INT, 1, {} ) );
+	_Knopf->funcs.addFunktion( "getKBStärke", new KSGSCompileFunktion( KSGS_INT, 1, {} ) );
+	_Knopf->funcs.addFunktion( "hatStyle", new KSGSCompileFunktion( KSGS_BOOL, 1, { KSGS_INT } ) );
+	_Knopf->funcs.addFunktion( "hatStyleNicht", new KSGSCompileFunktion( KSGS_BOOL, 1, { KSGS_INT } ) );
+	_Knopf->funcs.addFunktion( "dublizieren", new KSGSCompileFunktion( KSGS_KNOPF, 1, {} ) );
+	_Knopf->funcs.addFunktion( "setToolTipText", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_TEXT } ) );
+	_Knopf->funcs.addFunktion( "setPosition", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_INT, KSGS_INT } ) );
+	_Knopf->funcs.addFunktion( "setGröße", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_INT, KSGS_INT } ) );
+	_Knopf->funcs.addFunktion( "getBreite", new KSGSCompileFunktion( KSGS_INT, 1, {} ) );
+	_Knopf->funcs.addFunktion( "getHöhe", new KSGSCompileFunktion( KSGS_INT, 1, {} ) );
+	_Knopf->funcs.addFunktion( "getX", new KSGSCompileFunktion( KSGS_INT, 1, {} ) );
+	_Knopf->funcs.addFunktion( "getY", new KSGSCompileFunktion( KSGS_INT, 1, {} ) );
+	_Knopf->funcs.addFunktion( "getToolTipText", new KSGSCompileFunktion( KSGS_TEXT, 1, {} ) );
+	// Fenster Standart
+	KSGSCompileKlasse *_Fenster = new KSGSCompileKlasse();
+	addKlasse( "Fenster", _Fenster );
+	_Fenster->funcs.addFunktion( "setRFarbe", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_INT } ) );
+	_Fenster->funcs.addFunktion( "setRBreite", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_INT } ) );
+	_Fenster->funcs.addFunktion( "setTitel", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_TEXT } ) );
+	_Fenster->funcs.addFunktion( "setTSFarbe", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_INT } ) );
+	_Fenster->funcs.addFunktion( "setTSGröße", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_INT } ) );
+	_Fenster->funcs.addFunktion( "setTBgFarbe", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_INT } ) );
+	_Fenster->funcs.addFunktion( "setTAfFarbe", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_INT } ) );
+	_Fenster->funcs.addFunktion( "setTAfStärke", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_INT } ) );
+	_Fenster->funcs.addFunktion( "setTBgBild", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_BILD } ) );
+	_Fenster->funcs.addFunktion( "setTRFarbe", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_INT } ) );
+	_Fenster->funcs.addFunktion( "setTRBreite", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_INT } ) );
+	_Fenster->funcs.addFunktion( "setKBgFarbe", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_INT } ) );
+	_Fenster->funcs.addFunktion( "setKBgBild", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_BILD } ) );
+	_Fenster->funcs.addFunktion( "setKAfFarbe", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_INT } ) );
+	_Fenster->funcs.addFunktion( "setKAfStärke", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_INT } ) );
+	_Fenster->funcs.addFunktion( "setSBgFarbe", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_INT } ) );
+	_Fenster->funcs.addFunktion( "setSBgBild", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_BILD } ) );
+	_Fenster->funcs.addFunktion( "setSAfFarbe", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_INT } ) );
+	_Fenster->funcs.addFunktion( "setSAfStärke", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_INT } ) );
+	_Fenster->funcs.addFunktion( "setSKAfFarbe", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_INT } ) );
+	_Fenster->funcs.addFunktion( "setSKAfStärke", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_INT } ) );
+	_Fenster->funcs.addFunktion( "setMin", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_INT, KSGS_INT } ) );
+	_Fenster->funcs.addFunktion( "setMax", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_INT, KSGS_INT } ) );
+	_Fenster->funcs.addFunktion( "setKMin", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_INT, KSGS_INT } ) );
+	_Fenster->funcs.addFunktion( "setKMax", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_INT, KSGS_INT } ) );
+	_Fenster->funcs.addFunktion( "setHSBMax", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_INT } ) );
+	_Fenster->funcs.addFunktion( "setVSBMax", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_INT } ) );
+	_Fenster->funcs.addFunktion( "setHSBScroll", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_INT } ) );
+	_Fenster->funcs.addFunktion( "setVSBScroll", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_INT } ) );
+	_Fenster->funcs.addFunktion( "setStyle", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_INT } ) );
+	_Fenster->funcs.addFunktion( "addStyle", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_INT } ) );
+	_Fenster->funcs.addFunktion( "removeStyle", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_INT } ) );
+	_Fenster->funcs.addFunktion( "addMember", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_VOID } ) );
+	_Fenster->funcs.addFunktion( "removeMember", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_VOID } ) );
+	_Fenster->funcs.addFunktion( "tick", new KSGSCompileFunktion( KSGS_BOOL, 1, { KSGS_DOUBLE } ) );
+	_Fenster->funcs.addFunktion( "setMausEreignis", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_TEXT } ) );
+	_Fenster->funcs.addFunktion( "setTastaturEreignis", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_TEXT } ) );
+	_Fenster->funcs.addFunktion( "doMausEreignis", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_MAUSEREIGNIS } ) );
+	_Fenster->funcs.addFunktion( "doTastaturEreignis", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_TASTATUREREIGNIS } ) );
+	_Fenster->funcs.addFunktion( "render", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_BILD } ) );
+	_Fenster->funcs.addFunktion( "getRFarbe", new KSGSCompileFunktion( KSGS_INT, 1, {} ) );
+	_Fenster->funcs.addFunktion( "getRBreite", new KSGSCompileFunktion( KSGS_INT, 1, {} ) );
+	_Fenster->funcs.addFunktion( "getTitel", new KSGSCompileFunktion( KSGS_TEXT, 1, {} ) );
+	_Fenster->funcs.addFunktion( "getTSFarbe", new KSGSCompileFunktion( KSGS_INT, 1, {} ) );
+	_Fenster->funcs.addFunktion( "getTSGröße", new KSGSCompileFunktion( KSGS_INT, 1, {} ) );
+	_Fenster->funcs.addFunktion( "getTBgFarbe", new KSGSCompileFunktion( KSGS_INT, 1, {} ) );
+	_Fenster->funcs.addFunktion( "getTAfFarbe", new KSGSCompileFunktion( KSGS_INT, 1, {} ) );
+	_Fenster->funcs.addFunktion( "getTAfStärke", new KSGSCompileFunktion( KSGS_INT, 1, {} ) );
+	_Fenster->funcs.addFunktion( "getTBgBild", new KSGSCompileFunktion( KSGS_BILD, 1, {} ) );
+	_Fenster->funcs.addFunktion( "getTRFarbe", new KSGSCompileFunktion( KSGS_INT, 1, {} ) );
+	_Fenster->funcs.addFunktion( "getTRBreite", new KSGSCompileFunktion( KSGS_INT, 1, {} ) );
+	_Fenster->funcs.addFunktion( "getKBgFarbe", new KSGSCompileFunktion( KSGS_INT, 1, {} ) );
+	_Fenster->funcs.addFunktion( "getKBgBild", new KSGSCompileFunktion( KSGS_BILD, 1, {} ) );
+	_Fenster->funcs.addFunktion( "getKAfFarbe", new KSGSCompileFunktion( KSGS_INT, 1, {} ) );
+	_Fenster->funcs.addFunktion( "getKAfStärke", new KSGSCompileFunktion( KSGS_INT, 1, {} ) );
+	_Fenster->funcs.addFunktion( "getSBgFarbe", new KSGSCompileFunktion( KSGS_INT, 1, {} ) );
+	_Fenster->funcs.addFunktion( "getSBgBild", new KSGSCompileFunktion( KSGS_BILD, 1, {} ) );
+	_Fenster->funcs.addFunktion( "getSAfFarbe", new KSGSCompileFunktion( KSGS_INT, 1, {} ) );
+	_Fenster->funcs.addFunktion( "getSAfStärke", new KSGSCompileFunktion( KSGS_INT, 1, {} ) );
+	_Fenster->funcs.addFunktion( "getSKAfFarbe", new KSGSCompileFunktion( KSGS_INT, 1, {} ) );
+	_Fenster->funcs.addFunktion( "getSKAfStärke", new KSGSCompileFunktion( KSGS_INT, 1, {} ) );
+	_Fenster->funcs.addFunktion( "getMinBreite", new KSGSCompileFunktion( KSGS_INT, 1, {} ) );
+	_Fenster->funcs.addFunktion( "getMinHöhe", new KSGSCompileFunktion( KSGS_INT, 1, {} ) );
+	_Fenster->funcs.addFunktion( "getMaxBreite", new KSGSCompileFunktion( KSGS_INT, 1, {} ) );
+	_Fenster->funcs.addFunktion( "getMaxHöhe", new KSGSCompileFunktion( KSGS_INT, 1, {} ) );
+	_Fenster->funcs.addFunktion( "getKMinBreite", new KSGSCompileFunktion( KSGS_INT, 1, {} ) );
+	_Fenster->funcs.addFunktion( "getKMinHöhe", new KSGSCompileFunktion( KSGS_INT, 1, {} ) );
+	_Fenster->funcs.addFunktion( "getKMaxBreite", new KSGSCompileFunktion( KSGS_INT, 1, {} ) );
+	_Fenster->funcs.addFunktion( "getKMaxHöhe", new KSGSCompileFunktion( KSGS_INT, 1, {} ) );
+	_Fenster->funcs.addFunktion( "hatStyle", new KSGSCompileFunktion( KSGS_INT, 1, { KSGS_INT } ) );
+	_Fenster->funcs.addFunktion( "hatStyleNicht", new KSGSCompileFunktion( KSGS_INT, 1, { KSGS_INT } ) );
+	_Fenster->funcs.addFunktion( "dublizieren", new KSGSCompileFunktion( KSGS_FENSTER, 1, {} ) );
+	_Fenster->funcs.addFunktion( "setToolTipText", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_TEXT } ) );
+	_Fenster->funcs.addFunktion( "setPosition", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_INT, KSGS_INT } ) );
+	_Fenster->funcs.addFunktion( "setGröße", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_INT, KSGS_INT } ) );
+	_Fenster->funcs.addFunktion( "getBreite", new KSGSCompileFunktion( KSGS_INT, 1, {} ) );
+	_Fenster->funcs.addFunktion( "getHöhe", new KSGSCompileFunktion( KSGS_INT, 1, {} ) );
+	_Fenster->funcs.addFunktion( "getX", new KSGSCompileFunktion( KSGS_INT, 1, {} ) );
+	_Fenster->funcs.addFunktion( "getY", new KSGSCompileFunktion( KSGS_INT, 1, {} ) );
+	_Fenster->funcs.addFunktion( "getToolTipText", new KSGSCompileFunktion( KSGS_TEXT, 1, {} ) );
+	// BildZ Standart
+	KSGSCompileKlasse *_BildZ = new KSGSCompileKlasse();
+	addKlasse( "BildZ", _BildZ );
+	_BildZ->funcs.addFunktion( "setBild", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_BILD } ) );
+	_BildZ->funcs.addFunktion( "setRFarbe", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_INT } ) );
+	_BildZ->funcs.addFunktion( "setRBreite", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_INT } ) );
+	_BildZ->funcs.addFunktion( "setStyle", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_INT } ) );
+	_BildZ->funcs.addFunktion( "addStyle", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_INT } ) );
+	_BildZ->funcs.addFunktion( "löscheStyle", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_INT } ) );
+	_BildZ->funcs.addFunktion( "tick", new KSGSCompileFunktion( KSGS_BOOL, 1, { KSGS_DOUBLE } ) );
+	_BildZ->funcs.addFunktion( "setMausEreignis", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_TEXT } ) );
+	_BildZ->funcs.addFunktion( "doMausEreignis", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_MAUSEREIGNIS } ) );
+	_BildZ->funcs.addFunktion( "render", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_BILD } ) );
+	_BildZ->funcs.addFunktion( "getBild", new KSGSCompileFunktion( KSGS_VOID, 1, {} ) );
+	_BildZ->funcs.addFunktion( "hatStyle", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_INT } ) );
+	_BildZ->funcs.addFunktion( "hatStyleNicht", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_INT } ) );
+	_BildZ->funcs.addFunktion( "dublizieren", new KSGSCompileFunktion( KSGS_BILDO, 1, {} ) );
+	_BildZ->funcs.addFunktion( "setToolTipText", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_TEXT } ) );
+	_BildZ->funcs.addFunktion( "setPosition", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_INT, KSGS_INT } ) );
+	_BildZ->funcs.addFunktion( "setGröße", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_INT, KSGS_INT } ) );
+	_BildZ->funcs.addFunktion( "getBreite", new KSGSCompileFunktion( KSGS_INT, 1, {} ) );
+	_BildZ->funcs.addFunktion( "getHöhe", new KSGSCompileFunktion( KSGS_INT, 1, {} ) );
+	_BildZ->funcs.addFunktion( "getX", new KSGSCompileFunktion( KSGS_INT, 1, {} ) );
+	_BildZ->funcs.addFunktion( "getY", new KSGSCompileFunktion( KSGS_INT, 1, {} ) );
+	_BildZ->funcs.addFunktion( "getToolTipText", new KSGSCompileFunktion( KSGS_TEXT, 1, {} ) );
+	// Animation2DData Standart
+	KSGSCompileKlasse *_Animation2DData = new KSGSCompileKlasse();
+	addKlasse( "Animation2DData", _Animation2DData );
+	_Animation2DData->funcs.addFunktion( "ladeAnimation", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_TEXT } ) );
+	_Animation2DData->funcs.addFunktion( "setFPS", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_INT } ) );
+	_Animation2DData->funcs.addFunktion( "setWiederhohlend", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_BOOL } ) );
+	_Animation2DData->funcs.addFunktion( "setTransparent", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_BOOL } ) );
+	_Animation2DData->funcs.addFunktion( "reset", new KSGSCompileFunktion( KSGS_VOID, 1, {} ) );
+	_Animation2DData->funcs.addFunktion( "getBild", new KSGSCompileFunktion( KSGS_BILD, 1, { KSGS_INT } ) );
+	_Animation2DData->funcs.addFunktion( "getBildAnzahl", new KSGSCompileFunktion( KSGS_INT, 1, {} ) );
+	_Animation2DData->funcs.addFunktion( "getFPS", new KSGSCompileFunktion( KSGS_INT, 1, {} ) );
+	_Animation2DData->funcs.addFunktion( "istWiederhohlend", new KSGSCompileFunktion( KSGS_BOOL, 1, {} ) );
+	_Animation2DData->funcs.addFunktion( "istTransparent", new KSGSCompileFunktion( KSGS_BOOL, 1, {} ) );
+	// Animation2DData Standart
+	KSGSCompileKlasse *_Animation2D = new KSGSCompileKlasse();
+	addKlasse( "Animation2D", _Animation2D );
+	_Animation2D->funcs.addFunktion( "setRahmen", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_BOOL } ) );
+	_Animation2D->funcs.addFunktion( "setRahmenBreite", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_INT } ) );
+	_Animation2D->funcs.addFunktion( "setRahmenFarbe", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_INT } ) );
+	_Animation2D->funcs.addFunktion( "setAnimationData", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_ANIMATION2DDATA } ) );
+	_Animation2D->funcs.addFunktion( "setAlphaMaske", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_INT } ) );
+	_Animation2D->funcs.addFunktion( "setAPS", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_INT } ) );
+	_Animation2D->funcs.addFunktion( "setSichtbar", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_BOOL } ) );
+	_Animation2D->funcs.addFunktion( "tick", new KSGSCompileFunktion( KSGS_BOOL, 1, { KSGS_DOUBLE } ) );
+	_Animation2D->funcs.addFunktion( "render", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_BILD } ) );
+	_Animation2D->funcs.addFunktion( "getAnimationData", new KSGSCompileFunktion( KSGS_ANIMATION2DDATA, 1, {} ) );
+	_Animation2D->funcs.addFunktion( "istSichtbar", new KSGSCompileFunktion( KSGS_BOOL, 1, {} ) );
+	_Animation2D->funcs.addFunktion( "getJetzt", new KSGSCompileFunktion( KSGS_INT, 1, {} ) );
+	_Animation2D->funcs.addFunktion( "getAlphaMaske", new KSGSCompileFunktion( KSGS_INT, 1, {} ) );
+	_Animation2D->funcs.addFunktion( "hatRahmen", new KSGSCompileFunktion( KSGS_BOOL, 1, {} ) );
+	_Animation2D->funcs.addFunktion( "getRahmenBreite", new KSGSCompileFunktion( KSGS_INT, 1, {} ) );
+	_Animation2D->funcs.addFunktion( "getRahmenFarbe", new KSGSCompileFunktion( KSGS_INT, 1, {} ) );
+	_Animation2D->funcs.addFunktion( "setToolTipText", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_TEXT } ) );
+	_Animation2D->funcs.addFunktion( "setPosition", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_INT, KSGS_INT } ) );
+	_Animation2D->funcs.addFunktion( "setGröße", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_INT, KSGS_INT } ) );
+	_Animation2D->funcs.addFunktion( "getBreite", new KSGSCompileFunktion( KSGS_INT, 1, {} ) );
+	_Animation2D->funcs.addFunktion( "getHöhe", new KSGSCompileFunktion( KSGS_INT, 1, {} ) );
+	_Animation2D->funcs.addFunktion( "getX", new KSGSCompileFunktion( KSGS_INT, 1, {} ) );
+	_Animation2D->funcs.addFunktion( "getY", new KSGSCompileFunktion( KSGS_INT, 1, {} ) );
+	_Animation2D->funcs.addFunktion( "getToolTipText", new KSGSCompileFunktion( KSGS_TEXT, 1, {} ) );
+}
+
+// Destruktor
+KSGSCompKlassTable::~KSGSCompKlassTable()
+{
+	namen->release();
+	int anz = klassen->getEintragAnzahl();
+	for( int i = 0; i < anz; i++ )
+		delete klassen->get( i );
+	klassen->release();
+}
+
+// nicht constant
+bool KSGSCompKlassTable::addKlasse( const char *name, KSGSCompileKlasse *klasse ) // fügt namen der Tabelle hinzu
+{
+	if( !hat( name ) )
+	{
+		klasse->id = namen->getEintragAnzahl();
+		namen->set( new Text( name ), klasse->id );
+		klassen->set( klasse, klasse->id );
+	}
+	else
+	{
+		delete klasse;
+		return 0;
+	}
+	return 1;
+}
+
+// constant
+KSGSCompileKlasse *KSGSCompKlassTable::get( const char *name ) const // gibt die KSGSCompVarTableariable eines Namens zurück
+{
+	int anz = namen->getEintragAnzahl();
+	for( int i = 0; i < anz; i++ )
+	{
+		if( namen->z( i )->istGleich( name ) )
+			return klassen->get( i );
+	}
+	return 0;
+}
+
+KSGSCompileKlasse *KSGSCompKlassTable::get( int id ) const // gibt die Klasse einer id zurück
+{
+	int anz = klassen->getEintragAnzahl();
+	for( int i = 0; i < anz; i++ )
+	{
+		if( klassen->get( i )->id == id )
+			return klassen->get( i );
+	}
+	return 0;
+}
+
+bool KSGSCompKlassTable::hat( const char *name ) const // prüft, ob name vorhanden ist
+{
+	int anz = namen->getEintragAnzahl();
+	for( int i = 0; i < anz; i++ )
+	{
+		if( namen->z( i )->istGleich( name ) )
+			return 1;
+	}
+	return 0;
+}
+
+bool KSGSCompKlassTable::hat( int id ) const // prüft, ob id vorhanden ist
+{
+	int anz = klassen->getEintragAnzahl();
+	for( int i = 0; i < anz; i++ )
+	{
+		if( klassen->get( i )->id == id )
+			return 1;
+	}
+	return 0;
+}
+
+// Reference Counting
+KSGSCompKlassTable *KSGSCompKlassTable::getThis()
+{
+	ref++;
+	return this;
+}
+
+KSGSCompKlassTable *KSGSCompKlassTable::release()
+{
+	ref--;
+	if( !ref )
+		delete this;
+	return 0;
+}

+ 113 - 0
ksgScript/Leser/KSGSCompile.h

@@ -0,0 +1,113 @@
+#ifndef KSGSCompile_H
+#define KSGSCompile_H
+
+#include <Array.h>
+#include <Text.h>
+#include <initializer_list>
+
+using namespace Framework;
+
+namespace KSGScript
+{
+	struct KSGSCompileVariable; // aus dieser Datei
+	struct KSGSCompileFunktion; // aus dieser Datei
+	struct KSGSCompileKlasse; // aus dieser Datei
+
+
+	class KSGSCompVarTable
+	{
+	private:
+		RCArray< Text > *namen;
+		Array< KSGSCompileVariable* > *vars;
+		int ref;
+
+	public:
+		// Konstruktor
+		__declspec( dllexport ) KSGSCompVarTable();
+		// Destruktor
+		__declspec( dllexport ) ~KSGSCompVarTable();
+		// nicht constant
+		__declspec( dllexport ) bool addVariable( const char *name, KSGSCompileVariable *var );
+		// constant
+		__declspec( dllexport ) KSGSCompileVariable *get( const char *name ) const; // gibt die Variable eines Namens zurück
+		__declspec( dllexport ) bool hat( const char *name ) const; // prüft, ob name vorhanden ist
+		// Reference Counting
+		__declspec( dllexport ) KSGSCompVarTable *getThis();
+		__declspec( dllexport ) KSGSCompVarTable *release();
+	};
+
+	class KSGSCompFuncTable
+	{
+	private:
+		RCArray< Text > *namen;
+		Array< KSGSCompileFunktion* > *funks;
+		int ref;
+
+	public:
+		// Konstruktor
+		__declspec( dllexport ) KSGSCompFuncTable();
+		// Destruktor
+		__declspec( dllexport ) ~KSGSCompFuncTable();
+		// nicht constant
+		__declspec( dllexport ) bool addFunktion( const char *name, KSGSCompileFunktion *func );
+		// constant
+		__declspec( dllexport ) KSGSCompileFunktion *get( const char *name ) const; // gibt die Funktion eines Namens zurück
+		__declspec( dllexport ) bool hat( const char *name ) const; // prüft, ob name vorhanden ist
+		// Reference Counting
+		__declspec( dllexport ) KSGSCompFuncTable *getThis();
+		__declspec( dllexport ) KSGSCompFuncTable *release();
+	};
+
+	class KSGSCompKlassTable
+	{
+	private:
+		RCArray< Text > *namen;
+		Array< KSGSCompileKlasse* > *klassen;
+		int ref;
+
+	public:
+		// Konstruktor
+		__declspec( dllexport ) KSGSCompKlassTable();
+		// Destruktor
+		__declspec( dllexport ) ~KSGSCompKlassTable();
+		// nicht constant
+		__declspec( dllexport ) bool addKlasse( const char *name, KSGSCompileKlasse *klasse );
+		// constant
+		__declspec( dllexport ) KSGSCompileKlasse *get( const char *name ) const; // gibt die Klasse eines Namens zurück
+		__declspec( dllexport ) KSGSCompileKlasse *get( int id ) const; // gibt die Klasse einer id zurück
+		__declspec( dllexport ) bool hat( const char *name ) const; // prüft, ob name vorhanden ist
+		__declspec( dllexport ) bool hat( int id ) const; // prüft, ob id vorhanden ist
+		// Reference Counting
+		__declspec( dllexport ) KSGSCompKlassTable *getThis();
+		__declspec( dllexport ) KSGSCompKlassTable *release();
+	};
+
+	struct KSGSCompileVariable
+	{
+		int typ;
+		int id;
+		int sichtbar; // 0 = global, 1 = global in klasse, 2 = lokal in Klasse, 3 = lokal in Funktion
+		// Konstruktor
+		__declspec( dllexport ) KSGSCompileVariable( int t, int s );
+	};
+
+	struct KSGSCompileFunktion
+	{
+		int typ;
+		int id;
+		int sichtbar; // 0 = global, 1 = global in klasse, 2 = lokal in Klasse
+		Array< int > parameterTyp;
+		KSGSCompVarTable vars; // tabelle mit lokalen variblen
+		// Konstruktor
+		__declspec( dllexport ) KSGSCompileFunktion( int t, int s, std::initializer_list< int > pt );
+	};
+
+	struct KSGSCompileKlasse
+	{
+		int id;
+		KSGSCompVarTable vars;
+		KSGSCompFuncTable funcs;
+	};
+}
+
+#endif

+ 1441 - 0
ksgScript/Leser/KSGSLeser.cpp

@@ -0,0 +1,1441 @@
+#include "KSGSLeser.h"
+#include <Datei.h>
+#include "../Error/Error.h"
+#include "KSGSCompile.h"
+#include "../Befehl/KSGSKlasse.h"
+#include "../Klassen/KSGSTyp.h"
+#include "../Funktionen/KSGSRückruf.h"
+#include "../Main/KSGScriptObj.h"
+
+using namespace KSGScript;
+
+
+void KSGScript::removeLehr( Text *txt )
+{
+	if( !txt->getLength() )
+		return;
+	while( txt->getLength() && ( *txt[ 0 ] == ' ' || *txt[ 0 ] == '\n' || *txt[ 0 ] == '\r' || *txt[ 0 ] == '\t' ) )
+		txt->remove( 0 );
+	while( txt->getLength() && ( txt->getText()[ txt->getLength() - 1 ] == ' ' || txt->getText()[ txt->getLength() - 1 ] == '\n' ||
+		   txt->getText()[ txt->getLength() - 1 ] == '\r' || txt->getText()[ txt->getLength() - 1 ] == '\t' ) )
+		txt->remove( txt->getLength() - 1 );
+}
+
+void KSGScript::removeKlammer( Text *txt )
+{
+	if( !txt->getLength() )
+		return;
+	removeLehr( txt );
+	while( *txt[ 0 ] == '(' && txt->getText()[ txt->getLength() - 1 ] == ')' )
+	{
+		int count = 0;
+		for( int i = 0; i < txt->getLength(); i++ )
+		{
+			if( txt->getText()[ i ] == '(' )
+				count++;
+			if( txt->getText()[ i ] == ')' )
+				count--;
+			if( !count && i != txt->getLength() - 1 )
+				return;
+		}
+		txt->remove( 0 );
+		txt->remove( txt->getLength() - 1 );
+		removeLehr( txt );
+		if( !txt->getLength() )
+			return;
+	}
+}
+
+int KSGScript::hatOperator( Text *txt )
+{
+	if( txt->hat( "+=" ) )
+		return KSGS_O_PLUSSET;
+	if( txt->hat( "-=" ) )
+		return KSGS_O_MINUSSET;
+	if( txt->hat( "*=" ) )
+		return KSGS_O_MAHLSET;
+	if( txt->hat( "/=" ) )
+		return KSGS_O_GETEILTSET;
+	if( txt->hat( "&=" ) )
+		return KSGS_O_UNDSET;
+	if( txt->hat( "|=" ) )
+		return KSGS_O_ODERSET;
+	if( txt->hat( "==" ) )
+		return KSGS_O_GLEICH;
+	if( txt->hat( "<=" ) )
+		return KSGS_O_KLEINERGLEICH;
+	if( txt->hat( ">=" ) )
+		return KSGS_O_GRÖßERGLEICH;
+	if( txt->hat( "!=" ) )
+		return KSGS_O_UNGLEICH;
+	if( txt->hat( "||" ) )
+		return KSGS_O_ODER;
+	if( txt->hat( "&&" ) )
+		return KSGS_O_UND;
+	if( txt->hat( "++" ) )
+		return KSGS_O_PLUS1;
+	if( txt->hat( "--" ) )
+		return KSGS_O_MINUS1;
+	if( txt->hat( "<<" ) )
+		return KSGS_O_NACHLINKS;
+	if( txt->hat( ">>" ) )
+		return KSGS_O_NACHRECHTS;
+	if( txt->hat( "=" ) )
+		return KSGS_O_SET;
+	if( txt->hat( "<" ) )
+		return KSGS_O_KLEINER;
+	if( txt->hat( ">" ) )
+		return KSGS_O_GRÖßER;
+	if( txt->hat( "|" ) )
+		return KSGS_O_BITODER;
+	if( txt->hat( "&" ) )
+		return KSGS_O_BITUND;
+	if( txt->hat( "+" ) )
+		return KSGS_O_PLUS;
+	if( txt->hat( "-" ) )
+		return KSGS_O_MINUS;
+	if( txt->hat( "*" ) )
+		return KSGS_O_MAHL;
+	if( txt->hat( "/" ) )
+		return KSGS_O_GETEILT;
+	if( txt->hat( "%" ) )
+		return KSGS_O_REST;
+	if( txt->hat( "!" ) )
+		return KSGS_O_NICHT;
+	if( txt->hat( "~" ) )
+		return KSGS_O_BITNICHT;
+	return -1;
+}
+
+int KSGScript::getOperatorPos( Text *txt, int *län )
+{
+	*län = 2;
+	if( txt->hat( "+=" ) )
+		return txt->positionVon( "+=" );
+	if( txt->hat( "-=" ) )
+		return txt->positionVon( "-=" );
+	if( txt->hat( "*=" ) )
+		return txt->positionVon( "*=" );
+	if( txt->hat( "/=" ) )
+		return txt->positionVon( "/=" );
+	if( txt->hat( "&=" ) )
+		return txt->positionVon( "&=" );
+	if( txt->hat( "|=" ) )
+		return txt->positionVon( "|=" );
+	if( txt->hat( "==" ) )
+		return txt->positionVon( "==" );
+	if( txt->hat( "<=" ) )
+		return txt->positionVon( "<=" );
+	if( txt->hat( ">=" ) )
+		return txt->positionVon( ">=" );
+	if( txt->hat( "!=" ) )
+		return txt->positionVon( "!=" );
+	if( txt->hat( "||" ) )
+		return txt->positionVon( "||" );
+	if( txt->hat( "&&" ) )
+		return txt->positionVon( "&&" );
+	if( txt->hat( "++" ) )
+		return txt->positionVon( "++" );
+	if( txt->hat( "--" ) )
+		return txt->positionVon( "--" );
+	if( txt->hat( "<<" ) )
+		return txt->positionVon( "<<" );
+	if( txt->hat( ">>" ) )
+		return txt->positionVon( ">>" );
+	*län = 1;
+	if( txt->hat( "=" ) )
+		return txt->positionVon( "=" );
+	if( txt->hat( "<" ) )
+		return txt->positionVon( "<" );
+	if( txt->hat( ">" ) )
+		return txt->positionVon( ">" );
+	if( txt->hat( "|" ) )
+		return txt->positionVon( "|" );
+	if( txt->hat( "&" ) )
+		return txt->positionVon( "&" );
+	if( txt->hat( "+" ) )
+		return txt->positionVon( "+" );
+	if( txt->hat( "-" ) )
+		return txt->positionVon( "-" );
+	if( txt->hat( "*" ) )
+		return txt->positionVon( "*" );
+	if( txt->hat( "/" ) )
+		return txt->positionVon( "/" );
+	if( txt->hat( "%" ) )
+		return txt->positionVon( "%" );
+	if( txt->hat( "!" ) )
+		return txt->positionVon( "!" );
+	if( txt->hat( "~" ) )
+		return txt->positionVon( "~" );
+	*län = 0;
+	return -1;
+}
+
+// Lese Strukturen
+KSGSLeseBefehl::~KSGSLeseBefehl()
+{
+	int anz = listA.getEintragAnzahl();
+	for( int i = 0; i < anz; i++ )
+		delete listA.get( i );
+	anz = listB.getEintragAnzahl();
+	for( int i = 0; i < anz; i++ )
+		delete listB.get( i );
+}
+
+KSGSLeseFunktion::~KSGSLeseFunktion()
+{
+	int anz3 = parameter.getEintragAnzahl();
+	for( int k = 0; k < anz3; k++ )
+		delete parameter.get( k );
+	anz3 = befehle.getEintragAnzahl();
+	for( int k = 0; k < anz3; k++ )
+		delete befehle.get( k );
+}
+
+KSGSLeseKlasse::~KSGSLeseKlasse()
+{
+	int anz2 = variablen.getEintragAnzahl();
+	for( int j = 0; j < anz2; j++ )
+		delete variablen.get( j );
+	anz2 = funktionen.getEintragAnzahl();
+	for( int j = 0; j < anz2; j++ )
+		delete funktionen.get( j );
+}
+
+KSGSLeseScript::~KSGSLeseScript()
+{
+	int anz = variablen.getEintragAnzahl();
+	for( int i = 0; i < anz; i++ )
+		delete variablen.get( i );
+	anz = funktionen.getEintragAnzahl();
+	for( int i = 0; i < anz; i++ )
+		delete funktionen.get( i );
+	anz = klassen.getEintragAnzahl();
+	for( int i = 0; i < anz; i++ )
+		delete klassen.get( i );
+}
+
+
+// Inhalt der KSGSLeser klasse aus KSGSLeser.h
+// Konstruktor
+KSGSLeser::KSGSLeser( const char *pfad, KSGScriptObj *zObj )
+{
+	this->zObj = zObj;
+	d = 0;
+	dat = 0;
+	this->pfad = new Text( pfad );
+	zeile = 0;
+	mainFuncId = -1;
+	mausFuncId = -1;
+	tastaturFuncId = -1;
+	tickFuncId = -1;
+	renderFuncId = -1;
+	ref = 1;
+}
+
+// Destruktor
+KSGSLeser::~KSGSLeser()
+{
+	delete dat;
+	pfad->release();
+}
+
+// privat
+// Script Laden
+bool KSGSLeser::ladeDatei()
+{
+	bool ok = 1;
+	d = new Datei();
+	d->setDatei( *pfad );
+	if( !d->open( Datei::Style::lesen ) )
+	{
+		d->release();
+		error( 4, { *pfad }, zObj );
+		return 0;
+	}
+	zeile = 1;
+	while( !d->istEnde() )
+	{
+		bool br = 0;
+		int id = leseNext();
+		switch( id )
+		{
+		case -1: // Ende der Datei
+			break;
+		case 1: // Klasse
+			if( 1 )
+			{
+				KSGSLeseKlasse *k = leseKlasse();
+				if( !k )
+				{
+					error( 6, { "Klasse", *pfad }, zObj );
+					br = 1;
+				}
+				else
+					dat->klassen.add( k );
+			}
+			break;
+		case 2: // funktion
+			if( 1 )
+			{
+				KSGSLeseFunktion *f = leseFunktion();
+				if( !f )
+				{
+					error( 6, { "Funktion", *pfad }, zObj );
+					br = 1;
+				}
+				else
+					dat->funktionen.add( f );
+			}
+			break;
+		case 3: // Variable
+			if( 1 )
+			{
+				KSGSLeseVariable *v = leseVariable();
+				if( !v )
+				{
+					error( 6, { "Variable", *pfad }, zObj );
+					br = 1;
+				}
+				else
+					dat->variablen.add( v );
+			}
+			break;
+		case 12: // lesen
+			if( 1 )
+			{
+				if( !leseBis( '(' ) )
+				{
+					error( 6, { "Lade Anweisung", *pfad }, zObj );
+					br = 1;
+					break;
+				}
+				d->setLPosition( d->getLPosition() + 1, 0 );
+				if( !leseBis( '"' ) )
+				{
+					error( 6, { "Lade Anweisung", *pfad }, zObj );
+					br = 1;
+					break;
+				}
+				d->setLPosition( d->getLPosition() + 1, 0 );
+				__int64 end = nextPosOf( '"', 0 );
+				if( end < 0 )
+				{
+					error( 6, { "Lade Anweisung", *pfad }, zObj );
+					br = 1;
+					break;
+				}
+				char *datei = new char[ (int)(end - d->getLPosition() ) + 1 ];
+				datei[ end - d->getLPosition() ] = 0;
+				d->lese( datei, (int)(end - d->getLPosition()) );
+				Text *dPf = zObj->convertPfad( datei );
+				delete[] datei;
+				if( !leseBis( ')' ) )
+				{
+					error( 6, { "Lade Anweisung", *pfad }, zObj );
+					br = 1;
+					break;
+				}
+				d->setLPosition( d->getLPosition() + 1, 0 );
+				Text *pf = new Text( pfad->getText() );
+				pfad->setText( dPf );
+				Datei *tmp = d;
+				if( !ladeDatei() )
+				{
+					d = tmp;
+					pfad->setText( pf );
+					error( 6, { "Lade Anweisung", *pfad }, zObj );
+					br = 1;
+					break;
+				}
+				d = tmp;
+				pfad->setText( pf );
+			}
+			break;
+		default: // Fehler
+			error( 5, { *pfad, Text() += zeile }, zObj );
+			br = 1;
+			break;
+		}
+		if( id == -1 )
+			break;
+		if( br )
+		{
+			ok = 0;
+			break;
+		}
+	}
+	d->close();
+	d = d->release();
+	return ok;
+}
+
+bool KSGSLeser::leseBis( char c )
+{
+	__int64 pos = d->getLPosition();
+	int tmpZ = zeile;
+	char byte = 0;
+	bool kommentar = 0;
+	bool slash = 0;
+	bool gefunden = 0;
+	while( !d->istEnde() )
+	{
+		d->lese( &byte, 1 );
+		if( byte == '\n' )
+		{
+			zeile++;
+			kommentar = 0;
+			continue;
+		}
+		if( byte == '#' )
+		{
+			kommentar = 1;
+			continue;
+		}
+		if( byte == '/' )
+		{
+			if( slash )
+			{
+				kommentar = 1;
+				slash = 0;
+			}
+			else
+				slash = 1;
+			continue;
+		}
+		else
+			slash = 0;
+		if( byte == c && !kommentar )
+		{
+			gefunden = 1;
+			break;
+		}
+	}
+	if( d->istEnde() && !gefunden )
+	{
+		d->setLPosition( pos, 0 );
+		zeile = tmpZ;
+		return 0;
+	}
+	d->setLPosition( d->getLPosition() - 1, 0 );
+	return 1;
+}
+
+__int64 KSGSLeser::nextPosOf( char c, char c2 )
+{
+	__int64 pos = d->getLPosition();
+	char byte = 0;
+	bool kommentar = 0;
+	bool slash = 0;
+	int count = 0;
+	bool gefunden = 0;
+	while( !d->istEnde() )
+	{
+		d->lese( &byte, 1 );
+		if( byte == '\n' )
+		{
+			kommentar = 0;
+			continue;
+		}
+		if( byte == '#' )
+		{
+			kommentar = 1;
+			continue;
+		}
+		if( byte == '/' )
+		{
+			if( slash )
+			{
+				kommentar = 1;
+				slash = 0;
+			}
+			else
+				slash = 1;
+			continue;
+		}
+		else
+			slash = 0;
+		if( !kommentar )
+		{
+			if( byte == c2 )
+			{
+				count++;
+				continue;
+			}
+			if( byte == c )
+			{
+				if( !count )
+				{
+					gefunden = 1;
+					break;
+				}
+				count--;
+				continue;
+			}
+		}
+	}
+	if( d->istEnde() && !gefunden )
+	{
+		d->setLPosition( pos, 0 );
+		return -1;
+	}
+	__int64 ret = d->getLPosition() - 1;
+	d->setLPosition( pos, 0 );
+	return ret;
+}
+
+bool KSGSLeser::leseBisText()
+{
+	__int64 pos = d->getLPosition();
+	char c = 0;
+	bool kommentar = 0;
+	bool slash = 0;
+	bool gefunden = 0;
+	while( !d->istEnde() )
+	{
+		d->lese( &c, 1 );
+		if( c == '\n' )
+		{
+			zeile++;
+			kommentar = 0;
+			continue;
+		}
+		if( c == '#' )
+		{
+			kommentar = 1;
+			continue;
+		}
+		if( c == '/' )
+		{
+			if( slash )
+			{
+				kommentar = 1;
+				slash = 0;
+			}
+			else
+				slash = 1;
+			continue;
+		}
+		else
+			slash = 0;
+		if( !istLehr( c ) && !kommentar )
+		{
+			gefunden = 1;
+			break;
+		}
+	}
+	if( d->istEnde() && !gefunden )
+	{
+		d->setLPosition( pos, 0 );
+		return 0;
+	}
+	d->setLPosition( d->getLPosition() - 1, 0 );
+	return 1;
+}
+
+int KSGSLeser::leseNext()
+{
+	if( !leseBisText() )
+		return -1;
+	__int64 pos = d->getLPosition();
+	int ret = 0;
+	Text txt = "";
+	char byte[] = { 0, 0 };
+	d->lese( byte, 1 );
+	while( !istTrenner( byte[ 0 ] ) && !d->istEnde() )
+	{
+		txt.append( byte );
+		d->lese( byte, 1 );
+	}
+	if( d->istEnde() || !txt.getLength() )
+	{
+		d->setLPosition( pos, 0 );
+		return -1;
+	}
+	if( txt.istGleich( "class" ) )
+		ret = 1;
+	if( txt.istGleich( "func" ) )
+		ret = 2;
+	if( txt.istGleich( "var" ) )
+		ret = 3;
+	if( txt.istGleich( "public" ) )
+		ret = 4;
+	if( txt.istGleich( "private" ) )
+		ret = 5;
+	if( txt.istGleich( "if" ) )
+		ret = 6;
+	if( txt.istGleich( "for" ) )
+		ret = 7;
+	if( txt.istGleich( "while" ) )
+		ret = 8;
+	if( txt.istGleich( "return" ) )
+		ret = 9;
+	if( txt.istGleich( "break" ) )
+		ret = 10;
+	if( txt.istGleich( "continue" ) )
+		ret = 11;
+	if( txt.istGleich( "lesen" ) )
+		ret = 12;
+	d->setLPosition( pos, 0 );
+	return ret;
+}
+
+bool KSGSLeser::istTrenner( char c )
+{
+	return !( ( c >= 'a' && c <= 'z' ) || ( c >= 'A' && c <= 'Z' ) || ( c >= '0' && c <= '9' )
+			  || c == '_' || c == 'ä' || c == 'ö' || c == 'ü' || c == 'Ä' || c == 'Ö' || c == 'Ü' || c == 'ß' );
+}
+
+bool KSGSLeser::istLehr( char c )
+{
+	return c == ' ' || c == '\n' || c == '\r' || c == '\t';
+}
+
+KSGSLeseKlasse *KSGSLeser::leseKlasse()
+{
+	KSGSLeseKlasse *ret = new KSGSLeseKlasse();
+	ret->debug.datei.setText( *pfad );
+	ret->debug.zeile = zeile;
+	d->setLPosition( d->getLPosition() + 5, 0 ); // 'class' überspringen
+	if( !leseBisText() ) // Bis zum beginn des Klassennamens lesen
+	{
+		delete ret;
+		return 0;
+	}
+	char byte[] = { 0, 0 }; // Klassenname lesen
+	d->lese( byte, 1 );
+	while( !istTrenner( *byte ) )
+	{
+		ret->name.append( byte );
+		d->lese( byte, 1 );
+	}
+	if( !leseBis( '{' ) ) // Bis zum beginn der Klasse lesen
+	{
+		delete ret;
+		return 0;
+	}
+	d->setLPosition( d->getLPosition() + 1, 0 );
+	bool sichtbar = 0;
+	__int64 ende = nextPosOf( '}', '{' ); // Ende der Klasse
+	if( ende < 0 )
+	{
+		delete ret;
+		return 0;
+	}
+	while( d->getLPosition() < ende ) // Inhalt der Klasse lesen
+	{
+		int id = leseNext();
+		if( id == -1 )
+			break;
+		switch( id )
+		{
+		case 2: // Funktion
+			if( 1 )
+			{
+				KSGSLeseFunktion *f = leseFunktion();
+				if( !f )
+				{
+					delete ret;
+					return 0;
+				}
+				ret->funktionen.add( f );
+				ret->fSichtbar.add( sichtbar );
+			}
+			break;
+		case 3: // Variable
+			if( 1 )
+			{
+				KSGSLeseVariable *v = leseVariable();
+				if( !v )
+				{
+					delete ret;
+					return 0;
+				}
+				ret->variablen.add( v );
+				ret->vSichtbar.add( sichtbar );
+			}
+			break;
+		case 4: // public
+			sichtbar = 1;
+			d->setLPosition( d->getLPosition() + 6, 0 );
+			if( !leseBis( ':' ) )
+			{
+				delete ret;
+				return 0;
+			}
+			d->setLPosition( d->getLPosition() + 1, 0 );
+			break;
+		case 5: // private
+			sichtbar = 0;
+			d->setLPosition( d->getLPosition() + 7, 0 );
+			if( !leseBis( ':' ) )
+			{
+				delete ret;
+				return 0;
+			}
+			d->setLPosition( d->getLPosition() + 1, 0 );
+			break;
+		default:
+			delete ret;
+			return 0;
+		}
+	}
+	if( d->getLPosition() > ende )
+	{
+		delete ret;
+		return 0;
+	}
+	d->setLPosition( ende + 1, 0 );
+	if( !leseBis( ';' ) ) // ';' Nach einer Klasse überlesen
+	{
+		delete ret;
+		return 0;
+	}
+	d->setLPosition( d->getLPosition() + 1, 0 );
+	return ret;
+}
+
+KSGSLeseFunktion *KSGSLeser::leseFunktion()
+{
+	KSGSLeseFunktion *ret = new KSGSLeseFunktion();
+	ret->debug.datei.setText( *pfad );
+	ret->debug.zeile = zeile;
+	d->setLPosition( d->getLPosition() + 4, 0 ); // 'func' überspringen
+	if( !leseBisText() )
+	{
+		delete ret;
+		return 0;
+	}
+	char byte[] = { 0, 0 }; // Rückgabetyp der Funktion lesen
+	d->lese( byte, 1 );
+	while( !istTrenner( *byte ) )
+	{
+		ret->typ.append( byte );
+		d->lese( byte, 1 );
+	}
+	d->setLPosition( d->getLPosition() - 1, 0 );
+	if( !leseBisText() )
+	{
+		delete ret;
+		return 0;
+	}
+	d->lese( byte, 1 ); // Name der Funktion lesen
+	while( !istTrenner( *byte ) )
+	{
+		ret->name.append( byte );
+		d->lese( byte, 1 );
+	}
+	d->setLPosition( d->getLPosition() - 1, 0 );
+	if( !leseBis( '(' ) ) // Parameterbeginn
+	{
+		delete ret;
+		return 0;
+	}
+	d->setLPosition( d->getLPosition() + 1, 0 );
+	__int64 paramEnde = nextPosOf( ')', '(' );
+	while( d->getLPosition() < paramEnde )
+	{
+		KSGSLeseVariable *param = leseVariable( 1 ); // Übergabeparameter einlesen
+		if( !param )
+			break;
+		ret->parameter.add( param );
+	}
+	d->setLPosition( paramEnde + 1, 0 );
+	if( !leseBis( '{' ) ) // Funktionsrumpf beginn
+	{
+		delete ret;
+		return 0;
+	}
+	d->setLPosition( d->getLPosition() + 1, 0 );
+	__int64 funkEnde = nextPosOf( '}', '{' ); // Ende der Funktion
+	while( d->getLPosition() < funkEnde )
+	{
+		KSGSLeseBefehl *bef = leseBefehl(); // Befehle einlesen
+		if( !bef )
+			break;
+		else
+			ret->befehle.add( bef );
+		if( !leseBisText() )
+		{
+			delete ret;
+			return 0;
+		}
+	}
+	d->setLPosition( funkEnde + 1, 0 ); // '}' am ende der Funktion überlesen
+	return ret;
+}
+
+KSGSLeseVariable *KSGSLeser::leseVariable( bool param )
+{
+	KSGSLeseVariable *ret = new KSGSLeseVariable();
+	ret->debug.datei.setText( *pfad );
+	ret->debug.zeile = zeile;
+	if( !param )
+		d->setLPosition( d->getLPosition() + 3, 0 ); // 'var' überspringen
+	__int64 endPos = 0;
+	if( param )
+		endPos = nextPosOf( ')', 0 );
+	if( !leseBisText() )
+	{
+		delete ret;
+		return 0;
+	}
+	if( param && d->getLPosition() >= endPos )
+	{
+		delete ret;
+		return 0;
+	}
+	char byte[] = { 0, 0 }; // Variablentyp lesen
+	d->lese( byte, 1 );
+	while( !istTrenner( *byte ) )
+	{
+		ret->typ.append( byte );
+		d->lese( byte, 1 );
+	}
+	d->setLPosition( d->getLPosition() - 1, 0 );
+	if( !leseBisText() )
+	{
+		delete ret;
+		return 0;
+	}
+	d->lese( byte, 1 ); // Variablenname lesen
+	while( !istTrenner( *byte ) )
+	{
+		ret->name.append( byte );
+		d->lese( byte, 1 );
+	}
+	d->setLPosition( d->getLPosition() - 1, 0 );
+	__int64 ende = nextPosOf( ';', 0 );
+	if( param )
+	{
+		__int64 tmp = nextPosOf( ',', 0 );
+		if( tmp >= 0 && tmp < endPos )
+			ende = tmp;
+		else
+			ende = endPos;
+	}
+	__int64 gleich = nextPosOf( '=', 0 );
+	if( gleich < ende && gleich >= 0 ) // prüfen ob die variable gesetzt wird
+	{
+		if( !leseBis( '=' ) )
+		{
+			delete ret;
+			return 0;
+		}
+		d->setLPosition( d->getLPosition() + 1, 0 );
+	}
+	if( leseBisText() )
+	{
+		if( d->getLPosition() < ende )
+		{
+			while( d->getLPosition() < ende ) // Wert der Variable lesen
+			{
+				d->lese( byte, 1 );
+				ret->wert.append( byte );
+			}
+		}
+	}
+	while( istLehr( ret->wert.getText()[ ret->wert.getLength() - 1 ] ) && ret->wert.getLength() > 0 )
+	{
+		if( ret->wert.getText()[ ret->wert.getLength() - 1 ] == '\n' )
+			zeile++;
+		if( !( ret->wert.getLength() - 1 ) )
+		{
+			ret->wert.setText( "" );
+			break;
+		}
+		ret->wert.setText( ret->wert.getText(), ret->wert.getLength() - 1 );
+	}
+	if( d->getLPosition() > ende )
+	{
+		delete ret;
+		return 0;
+	}
+	d->setLPosition( ende + 1, 0 ); // ';' oder bei param ')' oder ',' am Ende überlesen
+	return ret;
+}
+
+KSGSLeseBefehl *KSGSLeser::leseBefehl()
+{
+	__int64 fEnde = nextPosOf( '}', '{' );
+	if( fEnde < 0 )
+		return 0;
+	int typ = leseNext();
+	if( typ < 0 )
+		return 0;
+	KSGSLeseBefehl *ret = new KSGSLeseBefehl();
+	ret->debug.datei.setText( *pfad );
+	ret->debug.zeile = zeile;
+	ret->typ = typ;
+	switch( typ )
+	{
+	case 0:
+	case 3: // var
+		if( 1 )
+		{
+			__int64 endPos = nextPosOf( ';', 0 );
+			if( endPos < 0 )
+			{
+				delete ret;
+				return 0;
+			}
+			int län = (int)( endPos - d->getLPosition() );
+			if( län )
+			{
+				char *txt = new char[ län + 1 ];
+				txt[ län ] = 0;
+				d->lese( txt, län );
+				ret->befehl = txt;
+				delete[] txt;
+			}
+			d->setLPosition( endPos + 1, 0 );
+		}
+		break;
+	case 6: // if
+		if( 1 )
+		{
+			if( !leseBis( '(' ) )
+			{
+				delete ret;
+				return 0;
+			}
+			d->setLPosition( d->getLPosition() + 1, 0 );
+			__int64 endPos = nextPosOf( ')', '(' );
+			if( endPos < 0 )
+			{
+				delete ret;
+				return 0;
+			}
+			int län = (int)( endPos - d->getLPosition() );
+			if( län )
+			{
+				char *txt = new char[ län + 1 ];
+				txt[ län ] = 0;
+				d->lese( txt, län );
+				ret->befehl = txt;
+				delete[] txt;
+			}
+			d->setLPosition( endPos + 1, 0 );
+			if( !leseBis( '{' ) )
+			{
+				delete ret;
+				return 0;
+			}
+			d->setLPosition( d->getLPosition() + 1, 0 );
+			endPos = nextPosOf( '}', '{' );
+			if( endPos < 0 )
+			{
+				delete ret;
+				return 0;
+			}
+			while( d->getLPosition() < endPos )
+			{
+				KSGSLeseBefehl *tmp = leseBefehl();
+				if( !tmp )
+					break;
+				else
+					ret->listA.add( tmp );
+			}
+			d->setLPosition( endPos + 1, 0 );
+			int tmpZ = zeile;
+			if( !leseBisText() )
+			{
+				delete ret;
+				return 0;
+			}
+			char *el = new char[ 5 ];
+            if( d->getLPosition() + 4 <= fEnde )
+                d->lese( el, 4 );
+            else
+                el[ 0 ] = 0;
+            el[ 4 ] = 0;
+			if( Text( "else" ).istGleich( el ) )
+			{
+				if( !leseBis( '{' ) )
+				{
+					delete ret;
+					return 0;
+				}
+				d->setLPosition( d->getLPosition() + 1, 0 );
+				endPos = nextPosOf( '}', '{' );
+				if( endPos < 0 )
+				{
+					delete ret;
+					return 0;
+				}
+				while( d->getLPosition() < endPos )
+				{
+					KSGSLeseBefehl *tmp = leseBefehl();
+					if( !tmp )
+						break;
+					else
+						ret->listB.add( tmp );
+				}
+				d->setLPosition( endPos + 1, 0 );
+			}
+			else
+			{
+				d->setLPosition( endPos + 1, 0 );
+				zeile = tmpZ;
+			}
+			delete[] el;
+		}
+		break;
+	case 7: // for
+	case 8: // while
+		if( 1 )
+		{
+			if( !leseBis( '(' ) )
+			{
+				delete ret;
+				return 0;
+			}
+			d->setLPosition( d->getLPosition() + 1, 0 );
+			__int64 endPos = nextPosOf( ')', '(' );
+			if( endPos < 0 )
+			{
+				delete ret;
+				return 0;
+			}
+			int län = (int)( endPos - d->getLPosition() );
+			if( län )
+			{
+				char *txt = new char[ län + 1 ];
+				txt[ län ] = 0;
+				d->lese( txt, län );
+				ret->befehl = txt;
+				delete[] txt;
+			}
+			d->setLPosition( endPos + 1, 0 );
+			if( !leseBis( '{' ) )
+			{
+				delete ret;
+				return 0;
+			}
+			d->setLPosition( d->getLPosition() + 1, 0 );
+			endPos = nextPosOf( '}', '{' );
+			if( endPos < 0 )
+			{
+				delete ret;
+				return 0;
+			}
+			while( d->getLPosition() < endPos )
+			{
+				KSGSLeseBefehl *tmp = leseBefehl();
+				if( !tmp )
+					break;
+				else
+					ret->listA.add( tmp );
+			}
+			d->setLPosition( endPos + 1, 0 );
+		}
+		break;
+	case 9: // return
+		if( 1 )
+		{
+			__int64 endPos = nextPosOf( ';', 0 );
+			if( endPos < 0 )
+			{
+				delete ret;
+				return 0;
+			}
+			int län = (int)( endPos - d->getLPosition() );
+			if( län )
+			{
+				char *txt = new char[ län + 1 ];
+				txt[ län ] = 0;
+				d->lese( txt, län );
+				ret->befehl = txt;
+				delete[] txt;
+			}
+			d->setLPosition( endPos + 1, 0 );
+		}
+		break;
+	case 10: // break
+	case 11: // continue
+		if( 1 )
+		{
+			__int64 endPos = nextPosOf( ';', 0 );
+			if( endPos < 0 )
+			{
+				delete ret;
+				return 0;
+			}
+			d->setLPosition( endPos + 1, 0 );
+		}
+		break;
+	}
+	if( d->getLPosition() > fEnde )
+	{
+		delete ret;
+		return 0;
+	}
+	ret->befehl.ersetzen( "->", "." );
+	return ret;
+}
+
+// Script Compilieren
+bool KSGSLeser::compileKlasse( KSGSLeseKlasse *zLK, KSGSCompKlassTable *zKT )
+{
+	if( !zKT->hat( (char*)zLK->name ) )
+	{
+		error( 10, {}, zObj );
+		return 0;
+	}
+	KSGSCompileKlasse *k = zKT->get( (char*)zLK->name );
+	int lFAnz = zLK->funktionen.getEintragAnzahl();
+	for( int i = 0; i < lFAnz; i++ )
+	{
+		if( !compileFunktion( zLK->funktionen.get( i ), zKT, &k->funcs, 1 + !zLK->fSichtbar.get( i ) ) )
+			return 0;
+	}
+	k->vars.addVariable( "this", new KSGSCompileVariable( k->id, 2 ) );
+	int lVAnz = zLK->variablen.getEintragAnzahl();
+	for( int i = 0; i < lVAnz; i++ )
+	{
+        auto tmp = zKT->get( (char*)zLK->variablen.get( i )->typ );
+        if( !tmp )
+        {
+            error( 11, { zLK->debug.datei, Text() += zLK->debug.zeile, (char*)zLK->variablen.get( i )->typ, (char*)zLK->variablen.get( i )->name }, zObj );
+            return 0;
+        }
+		if( !k->vars.addVariable( zLK->variablen.get( i )->name, new KSGSCompileVariable( tmp->id, 1 + !zLK->vSichtbar.get( i ) ) ) )
+		{
+			error( 9, { zLK->variablen.get( i )->debug.datei, Text() += zLK->variablen.get( i )->debug.zeile, zLK->variablen.get( i )->name }, zObj );
+			return 0;
+		}
+	}
+	return 1;
+}
+
+bool KSGSLeser::compileFunktion( KSGSLeseFunktion *zLF, KSGSCompKlassTable *zKT, KSGSCompFuncTable *zFT, int s )
+{
+	KSGSCompileFunktion *f = new KSGSCompileFunktion( zKT->get( (char*)zLF->typ )->id, s, {} );
+	int anz = zLF->parameter.getEintragAnzahl();
+    for( int j = 0; j < anz; j++ )
+    {
+        auto tmp = zKT->get( (char*)zLF->parameter.get( j )->typ );
+        if( tmp )
+            f->parameterTyp.add( tmp->id );
+        else
+        {
+            error( 11, { zLF->debug.datei, Text() += zLF->debug.zeile, zLF->parameter.get( j )->typ, zLF->parameter.get( j )->name }, zObj );
+            return 0;
+        }
+    }
+	if( !zFT->addFunktion( zLF->name, f ) )
+	{
+		error( 8, { zLF->debug.datei, Text() += zLF->debug.zeile, zLF->name }, zObj );
+		return 0;
+	}
+	return 1;
+}
+
+KSGSVariableDef *KSGSLeser::compileVariable( KSGSLeseVariable *zLV, KSGSCompKlassTable *zKT, int id )
+{
+	if( !zKT->hat( (char*)zLV->typ ) )
+	{
+		error( 11, { zLV->debug.datei, Text() += zLV->debug.zeile, zLV->typ, zLV->name }, zObj );
+		return 0;
+	}
+	KSGSVariableDef *ret = new KSGSVariableDef();
+	ret->id = id;
+	ret->sichtbar = 0;
+	ret->typId = zKT->get( (char*)zLV->typ )->id;
+	ret->wert.setText( zLV->wert );
+	return ret;
+}
+
+KSGSKlasse *KSGSLeser::buildKlasse( KSGSLeseKlasse *zLK, KSGSCompKlassTable *zKT, KSGSCompFuncTable *zFT, KSGSCompVarTable *zVT )
+{
+	if( !zKT->hat( (char*)zLK->name ) )
+	{
+		error( 10, {}, zObj );
+		return 0;
+	}
+	KSGSKlasse *ret = new KSGSKlasse( zKT->get( (char*)zLK->name )->id );
+	int anz = zLK->funktionen.getEintragAnzahl();
+	for( int i = 0; i < anz; i++ )
+	{
+		KSGSFunktion *f = buildFunktion( zLK->funktionen.get( i ), zKT, zFT, zVT, zLK->name );
+		if( !f )
+		{
+			ret->release();
+			return 0;
+		}
+		ret->addFunktion( f );
+	}
+	anz = zLK->variablen.getEintragAnzahl();
+	for( int i = 0; i < anz; i++ )
+	{
+		KSGSVariableDef *v = compileVariable( zLK->variablen.get( i ), zKT, i );
+		if( !v )
+		{
+			ret->release();
+			return 0;
+		}
+		v->sichtbar = 1 + !zLK->vSichtbar.get( i );
+		ret->addVariable( v );
+	}
+	return ret;
+}
+
+KSGSFunktion *KSGSLeser::buildFunktion( KSGSLeseFunktion *zLF, KSGSCompKlassTable *zKT, KSGSCompFuncTable *zFT, KSGSCompVarTable *zVT, const char *klassName )
+{
+	KSGSCompFuncTable *ft = zFT;
+	if( klassName )
+		ft = &zKT->get( klassName )->funcs;
+	if( !ft->hat( zLF->name ) )
+	{
+		error( 10, {}, zObj );
+		return 0;
+	}
+	KSGSFunktion *ret = new KSGSFunktion( ft->get( zLF->name )->id, ft->get( zLF->name )->sichtbar, zKT->get( (char*)zLF->typ )->id );
+	ret->setName( zLF->name );
+	int anz = zLF->parameter.getEintragAnzahl();
+	for( int i = 0; i < anz; i++ )
+	{
+		KSGSVariableDef *v = compileVariable( zLF->parameter.get( i ), zKT, i );
+		if( !v )
+		{
+			ret->release();
+			return 0;
+		}
+		v->sichtbar = 3;
+		ret->addParameter( v );
+        auto tmp = zKT->get( (char*)zLF->parameter.get( i )->typ );
+        if( !tmp )
+        {
+            error( 11, { zLF->debug.datei, Text() += zLF->debug.zeile, zLF->parameter.get( i )->typ, zLF->parameter.get( i )->name }, zObj );
+            return 0;
+        }
+		ft->get( zLF->name )->vars.addVariable( zLF->parameter.get( i )->name, new KSGSCompileVariable( tmp->id, 3 ) );
+	}
+	anz = zLF->befehle.getEintragAnzahl();
+	for( int i = 0; i < anz; i++ )
+	{
+		KSGSBefehl *b = buildBefehl( zLF->befehle.get( i ), zKT, zFT, zVT, klassName, zLF->name );
+		if( !b )
+		{
+			ret->release();
+			return 0;
+		}
+		ret->addBefehl( b );
+	}
+	return ret;
+}
+
+KSGSBefehl *KSGSLeser::buildBefehl( KSGSLeseBefehl *zLB, KSGSCompKlassTable *zKT, KSGSCompFuncTable *zFT, KSGSCompVarTable *zVT, const char *klassName, const char *funktionName )
+{
+	KSGSBefehl *ret = 0;
+	zLB->befehl.setSuchGrenzen( '(', ')' );
+	removeKlammer( &zLB->befehl );
+	switch( zLB->typ )
+	{
+	case 0: // call oder operator
+		if( 1 )
+		{
+			if( hatOperator( &zLB->befehl ) >= 0 )
+				ret = new KSGSOperatorBefehl( zObj, zLB, zKT, zFT, zVT, klassName, funktionName );
+			else
+				ret = new KSGSCallBefehl( zObj, zLB, zKT, zFT, zVT, klassName, funktionName );
+		}
+		break;
+	case 3: // var
+		ret = new KSGSVariableBefehl( zObj, zLB, zKT, zFT, zVT, klassName, funktionName );
+		break;
+	case 6: // if
+		ret = new KSGSIfBefehl( zObj, zLB, zKT, zFT, zVT, klassName, funktionName );
+		break;
+	case 7: // for
+		ret = new KSGSForBefehl( zObj, zLB, zKT, zFT, zVT, klassName, funktionName );
+		break;
+	case 8: // while
+		ret = new KSGSWhileBefehl( zObj, zLB, zKT, zFT, zVT, klassName, funktionName );
+		break;
+	case 9: // return
+		ret = new KSGSReturnBefehl( zObj, zLB, zKT, zFT, zVT, klassName, funktionName );
+		break;
+	case 10: // break
+		ret = new KSGSBreakBefehl( zLB, zKT, zFT, zVT, klassName, funktionName );
+		break;
+	case 11: // continue
+		ret = new KSGSContinueBefehl( zLB, zKT, zFT, zVT, klassName, funktionName );
+		break;
+	}
+	if( !ret )
+		error( 13, { zLB->debug.datei, Text() += zLB->debug.zeile, zLB->befehl }, zObj );
+	if( ret && ret->hatFehler() )
+		ret = ret->release();
+	return ret;
+}
+
+// nicht constant
+bool KSGSLeser::laden()
+{
+	delete dat;
+	dat = new KSGSLeseScript();
+	bool ok = ladeDatei();
+	return ok;
+}
+
+bool KSGSLeser::compile( RCArray< KSGSKlasse > *klassen, RCArray< KSGSFunktion > *funktionen, Array< KSGSVariableDef* > *variablen )
+{
+	// Klassen Tabelle
+	KSGSCompKlassTable *klassT = new KSGSCompKlassTable();
+	int kAnz = dat->klassen.getEintragAnzahl();
+	for( int i = 0; i < kAnz; i++ )
+	{
+		if( !klassT->addKlasse( dat->klassen.get( i )->name, new KSGSCompileKlasse() ) )
+		{
+			error( 7, { dat->klassen.get( i )->debug.datei, Text() += dat->klassen.get( i )->debug.zeile, dat->klassen.get( i )->name }, zObj );
+			klassT->release();
+			return 0;
+		}
+	}
+	// Funktions Tabelle
+	KSGSCompFuncTable *funcT = new KSGSCompFuncTable();
+	funcT->addFunktion( "Rückruf", new KSGSCompileFunktion( KSGS_VOID, 0, {} ) );
+	int fAnz = dat->funktionen.getEintragAnzahl();
+	for( int i = 0; i < fAnz; i++ )
+	{
+		if( !compileFunktion( dat->funktionen.get( i ), klassT, funcT ) )
+		{
+			error( 8, { dat->funktionen.get( i )->debug.datei, Text() += dat->funktionen.get( i )->debug.zeile, dat->funktionen.get( i )->name }, zObj );
+			klassT->release();
+			funcT->release();
+			return 0;
+		}
+		if( dat->funktionen.get( i )->name.istGleich( "start" ) )
+			mainFuncId = funcT->get( "start" )->id;
+		if( dat->funktionen.get( i )->name.istGleich( "maus" ) )
+			mausFuncId = funcT->get( "maus" )->id;
+		if( dat->funktionen.get( i )->name.istGleich( "tastatur" ) )
+			tastaturFuncId = funcT->get( "tastatur" )->id;
+		if( dat->funktionen.get( i )->name.istGleich( "tick" ) )
+			tickFuncId = funcT->get( "tick" )->id;
+		if( dat->funktionen.get( i )->name.istGleich( "render" ) )
+			renderFuncId = funcT->get( "render" )->id;
+	}
+	// Variablen Tabelle
+	KSGSCompVarTable *varT = new KSGSCompVarTable();
+	int vAnz = dat->variablen.getEintragAnzahl();
+	for( int i = 0; i < vAnz; i++ )
+	{
+        auto tmp = klassT->get( (char*)dat->variablen.get( i )->typ );
+        if( !tmp )
+        {
+            error( 11, { dat->variablen.get( i )->debug.datei, Text() += dat->variablen.get( i )->debug.zeile, dat->variablen.get( i )->typ, dat->variablen.get( i )->name }, zObj );
+            return 0;
+        }
+		if( !varT->addVariable( dat->variablen.get( i )->name, new KSGSCompileVariable( klassT->get( (char*)dat->variablen.get( i )->typ )->id, 0 ) ) )
+		{
+			error( 9, { dat->variablen.get( i )->debug.datei, Text() += dat->variablen.get( i )->debug.zeile, dat->variablen.get( i )->name }, zObj );
+			klassT->release();
+			funcT->release();
+			varT->release();
+			return 0;
+		}
+	}
+	for( int i = 0; i < kAnz; i++ )
+	{
+		if( !compileKlasse( dat->klassen.get( i ), klassT ) )
+		{
+			klassT->release();
+			funcT->release();
+			varT->release();
+			return 0;
+		}
+	}
+	for( int i = 0; i < vAnz; i++ )
+	{
+		KSGSVariableDef *k = compileVariable( dat->variablen.get( i ), klassT, i );
+		if( !k )
+		{
+			int anz = variablen->getEintragAnzahl();
+			for( int i = 0; i < anz; i++ )
+				delete variablen->get( i );
+			variablen->leeren();
+			klassT->release();
+			funcT->release();
+			varT->release();
+			return 0;
+		}
+		variablen->add( k );
+	}
+	for( int i = 0; i < kAnz; i++ )
+	{
+		KSGSKlasse *k = buildKlasse( dat->klassen.get( i ), klassT, funcT, varT );
+		if( !k )
+		{
+			klassen->leeren();
+			variablen->leeren();
+			klassT->release();
+			funcT->release();
+			varT->release();
+			return 0;
+		}
+		klassen->add( k );
+	}
+	funktionen->add( new KSGSRückrufFunktion() );
+	for( int i = 0; i < fAnz; i++ )
+	{
+		KSGSFunktion *f = buildFunktion( dat->funktionen.get( i ), klassT, funcT, varT );
+		if( !f )
+		{
+			klassen->leeren();
+			funktionen->leeren();
+			variablen->leeren();
+			klassT->release();
+			funcT->release();
+			varT->release();
+			return 0;
+		}
+		funktionen->add( f );
+	}
+	klassT->release();
+	funcT->release();
+	varT->release();
+	return 1;
+}
+
+// constant
+int KSGSLeser::getMainFuncId() const
+{
+	return mainFuncId;
+}
+
+int KSGSLeser::getMausFuncId() const
+{
+	return mausFuncId;
+}
+
+int KSGSLeser::getTastaturFuncId() const
+{
+	return tastaturFuncId;
+}
+
+int KSGSLeser::getTickFuncId() const
+{
+	return tickFuncId;
+}
+
+int KSGSLeser::getRenderFuncId() const
+{
+	return renderFuncId;
+}
+
+// Reference Counting
+KSGSLeser *KSGSLeser::getThis()
+{
+	ref++;
+	return this;
+}
+
+KSGSLeser *KSGSLeser::release()
+{
+	ref--;
+	if( !ref )
+		delete this;
+	return 0;
+}

+ 138 - 0
ksgScript/Leser/KSGSLeser.h

@@ -0,0 +1,138 @@
+#ifndef KSGSLeser_H
+#define KSGSLeser_H
+
+#include <Text.h>
+#include <Array.h>
+#include <Datei.h>
+
+using namespace Framework;
+
+namespace KSGScript
+{
+	class KSGScriptObj;
+	class KSGSKlasse;
+	class KSGSFunktion;
+	struct KSGSVariableDef;
+	class KSGSCompVarTable;
+	class KSGSCompFuncTable;
+	class KSGSCompKlassTable;
+	class KSGSBefehl;
+
+	__declspec( dllexport ) void removeLehr( Text *txt );
+	__declspec( dllexport ) void removeKlammer( Text *txt );
+	__declspec( dllexport ) int hatOperator( Text *txt );
+	__declspec( dllexport ) int getOperatorPos( Text *txt, int *län );
+
+	struct KSGSLeseDebug
+	{
+		Text datei;
+		int zeile;
+	};
+
+	struct KSGSLeseBefehl
+	{
+		int typ;
+		Text befehl;
+		Array< KSGSLeseBefehl* > listA;
+		Array< KSGSLeseBefehl* > listB;
+		KSGSLeseDebug debug;
+		// Destruktor
+		__declspec( dllexport ) ~KSGSLeseBefehl();
+	};
+
+	struct KSGSLeseVariable
+	{
+		Text typ;
+		Text name;
+		Text wert;
+		KSGSLeseDebug debug;
+	};
+
+	struct KSGSLeseFunktion
+	{
+		Text name;
+		Text typ;
+		Array< KSGSLeseVariable* > parameter;
+		Array< KSGSLeseBefehl* > befehle;
+		KSGSLeseDebug debug;
+		// Destruktor
+		__declspec( dllexport ) ~KSGSLeseFunktion();
+	};
+
+	struct KSGSLeseKlasse
+	{
+		Text name;
+		Array< KSGSLeseVariable* > variablen;
+		Array< bool > vSichtbar;
+		Array< KSGSLeseFunktion* > funktionen;
+		Array< bool > fSichtbar;
+		KSGSLeseDebug debug;
+		// Destruktor
+		__declspec( dllexport ) ~KSGSLeseKlasse();
+	};
+
+	struct KSGSLeseScript
+	{
+		Array< KSGSLeseVariable* > variablen;
+		Array< KSGSLeseFunktion* > funktionen;
+		Array< KSGSLeseKlasse* > klassen;
+		// Destruktor
+		__declspec( dllexport ) ~KSGSLeseScript();
+	};
+
+	class KSGSLeser
+	{
+	private:
+		KSGScriptObj *zObj;
+		KSGSLeseScript *dat;
+		Datei *d;
+		Text *pfad;
+		int zeile;
+		int mainFuncId;
+		int mausFuncId;
+		int tastaturFuncId;
+		int tickFuncId;
+		int renderFuncId;
+		int ref;
+		// privat
+		// Script Laden
+		__declspec( dllexport ) bool ladeDatei();
+		__declspec( dllexport ) bool leseBis( char c );
+		__declspec( dllexport ) __int64 nextPosOf( char c, char c2 );
+		__declspec( dllexport ) bool leseBisText();
+		__declspec( dllexport ) int leseNext();
+		__declspec( dllexport ) bool istTrenner( char c );
+		__declspec( dllexport ) bool istLehr( char c );
+		__declspec( dllexport ) KSGSLeseKlasse *leseKlasse();
+		__declspec( dllexport ) KSGSLeseFunktion *leseFunktion();
+		__declspec( dllexport ) KSGSLeseVariable *leseVariable( bool param = 0 );
+		__declspec( dllexport ) KSGSLeseBefehl *leseBefehl();
+		// Script Compilieren
+		__declspec( dllexport ) bool compileKlasse( KSGSLeseKlasse *zLK, KSGSCompKlassTable *zKT );
+		__declspec( dllexport ) bool compileFunktion( KSGSLeseFunktion *zLF, KSGSCompKlassTable *zKT, KSGSCompFuncTable *zFT, int s = 0 );
+		__declspec( dllexport ) KSGSVariableDef *compileVariable( KSGSLeseVariable *zLV, KSGSCompKlassTable *zKT,  int id );
+		__declspec( dllexport ) KSGSKlasse *buildKlasse( KSGSLeseKlasse *zLK, KSGSCompKlassTable *zKT, KSGSCompFuncTable *zFT, KSGSCompVarTable *zVT );
+		__declspec( dllexport ) KSGSFunktion *buildFunktion( KSGSLeseFunktion *zLF, KSGSCompKlassTable *zKT, KSGSCompFuncTable *zFT, KSGSCompVarTable *zVT, const char *klassName = 0 );
+		__declspec( dllexport ) KSGSBefehl *buildBefehl( KSGSLeseBefehl *zLB, KSGSCompKlassTable *zKT, KSGSCompFuncTable *zFT, KSGSCompVarTable *zVT, const char *klassName = 0, const char *funktionName = 0 );
+
+	public:
+		// Konstruktor
+		__declspec( dllexport ) KSGSLeser( const char *pfad, KSGScriptObj *zObj );
+		// Destruktor
+		__declspec( dllexport ) ~KSGSLeser();
+		// nicht constant
+		__declspec( dllexport ) bool laden();
+		__declspec( dllexport ) bool compile( RCArray< KSGSKlasse > *klassen, RCArray< KSGSFunktion > *funktionen, Array< KSGSVariableDef* > *variablen );
+		// constant
+		__declspec( dllexport ) int getMainFuncId() const;
+		__declspec( dllexport ) int getMausFuncId() const;
+		__declspec( dllexport ) int getTastaturFuncId() const;
+		__declspec( dllexport ) int getTickFuncId() const;
+		__declspec( dllexport ) int getRenderFuncId() const;
+		// Reference Counting
+		__declspec( dllexport ) KSGSLeser *getThis();
+		__declspec( dllexport ) KSGSLeser *release();
+	};
+}
+
+#endif

+ 31 - 0
ksgScript/Main/Einstieg.cpp

@@ -0,0 +1,31 @@
+#include "KSGScriptObj.h"
+#include "../Befehl/KSGSKlasse.h"
+#include "../Klassen/KSGSTyp.h"
+#include "../Klassen/KSGSBild.h"
+
+using namespace KSGScript;
+
+extern "C"
+{
+	__declspec( dllexport ) KSGScriptObj *GetNewKSGScriptObj()
+	{
+		return new KSGScriptObj();
+	}
+
+	__declspec( dllexport ) KSGSVariable *GetNewKSGSVariable( KSGScriptObj *zObj, KSGSVariableDef *def )
+	{
+		return KSGSVariable::erstellVariable( zObj, def );
+	}
+
+	__declspec( dllexport ) void SetKSGSBildVariable( KSGSVariable *zBv, Bild *b )
+	{
+		if( !b )
+			return;
+		if( zBv->getTyp() != KSGS_BILD )
+		{
+			b->release();
+			return;
+		}
+		( (KSGSBildKlasse*)zBv )->set( b );
+	}
+}

+ 497 - 0
ksgScript/Main/KSGScriptObj.cpp

@@ -0,0 +1,497 @@
+#include "KSGScriptObj.h"
+#include "../Befehl/KSGSKlasse.h"
+#include "../Leser/KSGSLeser.h"
+#include <fstream>
+#include <iostream>
+#include <sstream>
+#include <Punkt.h>
+#include "../Klassen/KSGSMausEreignis.h"
+#include "../Klassen/KSGSTastaturEreignis.h"
+#include "../Klassen/KSGSInt.h"
+#include "../Klassen/KSGSBild.h"
+#include "../Klassen/KSGSDouble.h"
+#include "../Error/Error.h"
+#include <Bildschirm.h>
+#include <Zeit.h>
+
+using namespace KSGScript;
+
+// Inhalt der KSGScriptObj Klasse aus KSGScriptObj.h
+// Konstruktor
+KSGScriptObj::KSGScriptObj()
+{
+	pfad = new Text();
+	wd = new Text();
+	rParam = 0;
+	rFunktion = 0;
+	variablen = new RCArray< KSGSVariable >();
+	funktionen = new RCArray< KSGSFunktion >();
+	klassen = new RCArray< KSGSKlasse >();
+	schrift = 0;
+	screen = 0;
+	mainId = 0;
+	mausId = 0;
+	tastaturId = 0;
+	tickId = 0;
+	renderId = 0;
+	geladen = 0;
+	scrId = 0;
+	ref = 1;
+	mausP = new RCArray< KSGSVariable >();
+	tastaturP = new RCArray< KSGSVariable >();
+	tickP = new RCArray< KSGSVariable >();
+	renderP = new RCArray< KSGSVariable >();
+    log = 0;
+}
+
+// Destruktor
+KSGScriptObj::~KSGScriptObj()
+{
+	if( schrift )
+		schrift->release();
+	if( screen )
+		screen->release();
+	zurücksetzen();
+	mausP->release();
+	tastaturP->release();
+	tickP->release();
+	renderP->release();
+	pfad->release();
+	wd->release();
+	variablen->release();
+	funktionen->release();
+	klassen->release();
+    if( log )
+        log->release();
+}
+
+// nicht constant
+void KSGScriptObj::lock()
+{
+    cs.lock();
+}
+
+void KSGScriptObj::unlock()
+{
+    cs.unlock();
+}
+
+void KSGScriptObj::setScriptDatei( const char *pfad )
+{
+	this->pfad->setText( pfad );
+	this->pfad->ersetzen( '\\', '/' );
+	int l = this->pfad->hat( '/' ) ? this->pfad->positionVon( '/', this->pfad->anzahlVon( '/' ) - 1 ) + 1 : 0;
+	if( l )
+		wd->setText( pfad, l );
+}
+
+void KSGScriptObj::setScriptDatei( Text *pfad )
+{
+	setScriptDatei( pfad->getText() );
+	pfad->release();
+}
+
+bool KSGScriptObj::neuLaden()
+{
+	lock();
+	ZeitMesser *gzm = new ZeitMesser();
+	gzm->messungStart();
+	if( geladen )
+		zurücksetzen();
+	scrId++;
+	KSGSLeser *reader = new KSGSLeser( *pfad, this );
+	ZeitMesser *zm = new ZeitMesser();
+	zm->messungStart();
+	if( !reader->laden() )
+	{
+		reader->release();
+		zm->release();
+		gzm->release();
+		unlock();
+		return 0;
+	}
+	zm->messungEnde();
+    if( log )
+    {
+        Text msg = "Reader: Zum lesen benötigte Sekunden: ";
+        msg += zm->getSekunden();
+        logNachricht( msg );
+    }
+	std::cout << "KSGS Reader: Zum lesen benötigte Sekunden: " << zm->getSekunden() << "\n";
+	Array< KSGSVariableDef* > *varDefs = new Array< KSGSVariableDef* >();
+	zm->messungStart();
+	if( !reader->compile( klassen, funktionen, varDefs ) )
+	{
+		varDefs->release();
+		reader->release();
+		zm->release();
+		gzm->release();
+		unlock();
+		return 0;
+	}
+	mausP->add( new KSGSMausEreignisKlasse( this ) );
+	tastaturP->add( new KSGSTastaturEreignisKlasse( this ) );
+	tickP->add( new KSGSDoubleKlasse( this ) );
+	renderP->add( new KSGSBildKlasse( this ) );
+	zm->messungEnde();
+    if( log )
+    {
+        Text msg = "Reader: Zum compilieren benötigte Sekunden: ";
+        msg += zm->getSekunden();
+        logNachricht( msg );
+    }
+	std::cout << "KSGS Reader: Zum compilieren benötigte Sekunden: " << zm->getSekunden() << "\n";
+	zm->release();
+	int vAnz = varDefs->getEintragAnzahl();
+	for( int i = 0; i < vAnz; i++ )
+	{
+		KSGSVariable *var = KSGSVariable::erstellVariable( this, varDefs->get( i ) );
+		if( var )
+			variablen->add( var );
+		delete varDefs->get( i );
+	}
+	varDefs->release();
+	mainId = reader->getMainFuncId();
+	mausId = reader->getMausFuncId();
+	tastaturId = reader->getTastaturFuncId();
+	tickId = reader->getTickFuncId();
+	renderId = reader->getRenderFuncId();
+	reader->release();
+	int anz = funktionen->getEintragAnzahl();
+	geladen = 1;
+	for( int i = 0; i < anz; i++ )
+	{
+		if( funktionen->z( i )->getId() == mainId )
+		{
+			KSGSFunktionInstanz *inst = funktionen->z( i )->erstellInstanz( getThis(), 0, 0 );
+			KSGSVariable *ret = inst->startFunktion();
+			if( ret )
+				ret->release();
+			if( inst->wirdFunktionAusgeführt() )
+				inst->warteAufFunktion( INFINITE );
+			inst->release();
+			break;
+		}
+	}
+	geladen = 2;
+	gzm->messungEnde();
+    if( log )
+    {
+        Text msg = "Reader: Zum laden benötigte Sekunden: ";
+        msg += gzm->getSekunden();
+        logNachricht( msg );
+    }
+	std::cout << "KSGS Reader: Zum laden benötigte Sekunden: " << gzm->getSekunden() << "\n";
+	gzm->release();
+	unlock();
+	return 1;
+}
+
+void KSGScriptObj::zurücksetzen()
+{
+	lock();
+	geladen = 0;
+	variablen->leeren();
+	funktionen->leeren();
+	klassen->leeren();
+	mausP->leeren();
+	tastaturP->leeren();
+	tickP->leeren();
+	renderP->leeren();
+	unlock();
+}
+
+void KSGScriptObj::setRückrufParam( void *p )
+{
+	rParam = p;
+}
+
+void KSGScriptObj::setRückrufFunktion( void( *funktion )( void *, RCArray< KSGSVariable > *, KSGSVariable ** ) )
+{
+	rFunktion = funktion;
+}
+
+void KSGScriptObj::setSchriftZ( Schrift *s )
+{
+	if( schrift )
+		schrift->release();
+	schrift = s;
+}
+
+void KSGScriptObj::setBildschirmZ( Bildschirm *s )
+{
+	if( screen )
+		screen->release();
+	screen = s;
+}
+
+void KSGScriptObj::doMausEreignis( MausEreignis &me )
+{
+	if( geladen != 2 )
+		return;
+	lock();
+	me.mx -= pos.x;
+	me.my -= pos.y;
+	int anz = funktionen->getEintragAnzahl();
+	for( int i = 0; i < anz; i++ )
+	{
+		if( funktionen->z( i )->getId() == mausId )
+		{
+			( (KSGSMausEreignisKlasse*)mausP->z( 0 ) )->set( me );
+			KSGSFunktionInstanz *inst = funktionen->z( i )->erstellInstanz( getThis(), 0, mausP->getThis() );
+			KSGSVariable *ret = inst->startFunktion();
+			if( ret )
+			{
+				me.verarbeitet |= ret->getBool();
+				ret->release();
+			}
+			if( inst->wirdFunktionAusgeführt() )
+				inst->warteAufFunktion( INFINITE );
+			inst->release();
+			break;
+		}
+	}
+	me.mx += pos.x;
+	me.my += pos.y;
+	unlock();
+}
+
+void KSGScriptObj::doTastaturEreignis( TastaturEreignis &te )
+{
+	if( geladen != 2 )
+		return;
+	lock();
+	int anz = funktionen->getEintragAnzahl();
+	for( int i = 0; i < anz; i++ )
+	{
+		if( funktionen->z( i )->getId() == tastaturId )
+		{
+			( (KSGSTastaturEreignisKlasse*)tastaturP->z( 0 ) )->set( te );
+			KSGSFunktionInstanz *inst = funktionen->z( i )->erstellInstanz( getThis(), 0, tastaturP->getThis() );
+			KSGSVariable *ret = inst->startFunktion();
+			if( ret )
+			{
+				te.verarbeitet |= ret->getBool();
+				ret->release();
+			}
+			if( inst->wirdFunktionAusgeführt() )
+				inst->warteAufFunktion( INFINITE );
+			inst->release();
+			break;
+		}
+	}
+	unlock();
+}
+
+bool KSGScriptObj::tick( double zeit )
+{
+	if( geladen != 2 )
+		return 0;
+	lock();
+	int anz = funktionen->getEintragAnzahl();
+	for( int i = 0; i < anz; i++ )
+	{
+		if( funktionen->z( i )->getId() == tickId )
+		{
+			( (KSGSDoubleKlasse*)tickP->z( 0 ) )->set( zeit );
+			KSGSFunktionInstanz *inst = funktionen->z( i )->erstellInstanz( getThis(), 0, tickP->getThis() );
+			KSGSVariable *ret = inst->startFunktion();
+			bool r = 0;
+			if( ret )
+			{
+				r = ret->getBool();
+				ret->release();
+			}
+			if( inst->wirdFunktionAusgeführt() )
+				inst->warteAufFunktion( INFINITE );
+			inst->release();
+			unlock();
+			return r;
+		}
+	}
+	unlock();
+	return 0;
+}
+
+void KSGScriptObj::render( Bild &zRObj )
+{
+	if( geladen != 2 )
+		return;
+	lock();
+	if( !zRObj.setDrawOptions( pos, gr ) )
+	{
+		unlock();
+		return;
+	}
+	int anz = funktionen->getEintragAnzahl();
+	for( int i = 0; i < anz; i++ )
+	{
+		if( funktionen->z( i )->getId() == renderId )
+		{
+			( (KSGSBildKlasse*)renderP->z( 0 ) )->set( zRObj.getThis() );
+			KSGSFunktionInstanz *inst = funktionen->z( i )->erstellInstanz( getThis(), 0, renderP->getThis() );
+			KSGSVariable *ret = inst->startFunktion();
+			if( ret )
+				ret->release();
+			if( inst->wirdFunktionAusgeführt() )
+				inst->warteAufFunktion( INFINITE );
+			inst->release();
+			break;
+		}
+	}
+	zRObj.releaseDrawOptions();
+	unlock();
+}
+
+KSGSVariable *KSGScriptObj::startFunktion( int id, RCArray< KSGSVariable > *parameter )
+{
+	if( !funktionen || !funktionen->z( id ) || funktionen->z( id )->getSichtbarkeit() != 0 )
+	{
+		error( 19, {}, this );
+		parameter->release();
+		return 0;
+	}
+	KSGSFunktionInstanz *inst = funktionen->z( id )->erstellInstanz( getThis(), 0, parameter );
+	KSGSVariable *ret = inst->startFunktion();
+	inst->release();
+	return ret;
+}
+
+KSGSVariable *KSGScriptObj::erstellKlassenInstanz( int id )
+{
+	int anz = klassen->getEintragAnzahl();
+	for( int i = 0; i < anz; i++ )
+	{
+		if( klassen->z( i ) && klassen->z( i )->getId() == id )
+			return klassen->z( i )->erstellInstanz( this );
+	}
+	error( 2, {}, this );
+	return 0;
+}
+
+void KSGScriptObj::setVariable( int id, KSGSVariable *var )
+{
+	variablen->set( var, id );
+}
+
+Text *KSGScriptObj::convertPfad( char *pf )
+{
+	Text *ret = new Text( pf );
+	ret->ersetzen( '\\', '/' );
+	if( ret->getText()[ 0 ] == '/' )
+	{
+		ret->remove( 0 );
+		return ret;
+	}
+	ret->insert( 0, wd->getText() );
+	return ret;
+}
+
+void KSGScriptObj::setLog( TextFeld *log )
+{
+    lock();
+    if( this->log )
+        this->log->release();
+    this->log = log;
+    unlock();
+}
+
+void KSGScriptObj::logNachricht( char *n )
+{
+    if( log )
+    {
+        lock();
+        log->addZeile( n );
+        unlock();
+    }
+}
+
+// constant
+KSGSVariable *KSGScriptObj::rückruf( RCArray< KSGSVariable > *parameter ) const
+{
+	if( !rFunktion )
+	{
+		parameter->release();
+		return 0;
+	}
+	KSGSVariable *ret = 0;
+	rFunktion( rParam, parameter, &ret );
+	parameter->release();
+	return ret;
+}
+
+Text *KSGScriptObj::getScriptDateiPfad() const
+{
+	return pfad->getThis();
+}
+
+Text *KSGScriptObj::zScriptDateiPfad() const
+{
+	return pfad;
+}
+
+Schrift *KSGScriptObj::getSchrift() const
+{
+	return schrift ? schrift->getThis() : 0;
+}
+
+Schrift *KSGScriptObj::zSchrift() const
+{
+	return schrift;
+}
+
+Bildschirm *KSGScriptObj::getBildschirm() const
+{
+	return screen ? screen->getThis() : 0;
+}
+
+Bildschirm *KSGScriptObj::zBildschirm() const
+{
+	return screen;
+}
+
+int KSGScriptObj::getScriptId() const
+{
+	return scrId;
+}
+
+bool KSGScriptObj::istBeendet( int scrId ) const
+{
+	return !geladen || this->scrId != scrId;
+}
+
+int KSGScriptObj::getFunktionId( const char *name ) const
+{
+	int anz = funktionen->getEintragAnzahl();
+	for( int i = 0; i < anz; i++ )
+	{
+		if( funktionen->z( i )->hatName( name ) )
+			return i;
+	}
+	return -1;
+}
+
+KSGSVariable *KSGScriptObj::getVariable( int id ) const
+{
+	if( !variablen || !variablen->z( id ) )
+	{
+		error( 17, {}, (KSGScriptObj*)this );
+		return 0;
+	}
+	return variablen->get( id );
+}
+
+// Reference Counting
+KSGScriptObj *KSGScriptObj::getThis()
+{
+	ref++;
+	return this;
+}
+
+KSGScriptObj *KSGScriptObj::release()
+{
+	ref--;
+	if( !ref )
+		delete this;
+	return 0;
+}

+ 91 - 0
ksgScript/Main/KSGScriptObj.h

@@ -0,0 +1,91 @@
+#ifndef KSGScriptObj_H
+#define KSGScriptObj_H
+
+#include <Zeichnung.h>
+#include <Text.h>
+#include <Array.h>
+#include <Schrift.h>
+#include <TextFeld.h>
+
+using namespace Framework;
+
+namespace KSGScript
+{
+	class KSGSFunktion; // ../Befehl/KSGSFunktion.h
+	class KSGSFunktionInstanz; // ../Befehl/KSGSFunktion.h
+	class KSGSKlasse; // ../Befehl/KSGSKlasse.h
+	class KSGSKlasseInstanz; // ../Befehl/KSGSKlasse.h
+	typedef KSGSKlasseInstanz KSGSVariable;
+
+	class KSGScriptObj : public Zeichnung
+	{
+	private:
+		Text *pfad;
+		Text *wd;
+		void *rParam;
+		void( *rFunktion )( void *, RCArray< KSGSVariable > *, KSGSVariable ** );
+		RCArray< KSGSVariable > *variablen;
+		RCArray< KSGSFunktion > *funktionen;
+		RCArray< KSGSKlasse > *klassen;
+		Schrift *schrift;
+		Bildschirm *screen;
+		RCArray< KSGSVariable > *mausP;
+		RCArray< KSGSVariable > *tastaturP;
+		RCArray< KSGSVariable > *tickP;
+		RCArray< KSGSVariable > *renderP;
+        TextFeld *log;
+		int mainId;
+		int mausId;
+		int tastaturId;
+		int tickId;
+		int renderId;
+		int geladen;
+		int scrId;
+		Critical cs;
+		int ref;
+
+	public:
+		// Konstruktor
+		__declspec( dllexport ) KSGScriptObj();
+		// Destruktor
+		__declspec( dllexport ) ~KSGScriptObj();
+		// nicht constant
+		__declspec( dllexport ) virtual void lock();
+		__declspec( dllexport ) virtual void unlock();
+		__declspec( dllexport ) virtual void setScriptDatei( const char *pfad );
+		__declspec( dllexport ) virtual void setScriptDatei( Text *pfad );
+		__declspec( dllexport ) virtual bool neuLaden();
+		__declspec( dllexport ) virtual void zurücksetzen();
+		__declspec( dllexport ) virtual void setRückrufParam( void *p );
+		__declspec( dllexport ) virtual void setRückrufFunktion( void( *funktion )( void *, RCArray< KSGSVariable > *, KSGSVariable ** ) );
+		__declspec( dllexport ) virtual void setSchriftZ( Schrift *s );
+		__declspec( dllexport ) virtual void setBildschirmZ( Bildschirm *s );
+		__declspec( dllexport ) virtual void doMausEreignis( MausEreignis &me ) override;
+		__declspec( dllexport ) virtual void doTastaturEreignis( TastaturEreignis &te ) override;
+		__declspec( dllexport ) virtual bool tick( double zeit ) override;
+		__declspec( dllexport ) virtual void render( Bild &zRObj ) override;
+		__declspec( dllexport ) virtual KSGSVariable *startFunktion( int id, RCArray< KSGSVariable > *parameter );
+		__declspec( dllexport ) virtual KSGSVariable *erstellKlassenInstanz( int id );
+		__declspec( dllexport ) virtual void setVariable( int id, KSGSVariable *var );
+		__declspec( dllexport ) virtual Text *convertPfad( char *pf );
+        __declspec( dllexport ) virtual void setLog( TextFeld *log );
+        __declspec( dllexport ) virtual void logNachricht( char *n );
+		// constant
+		__declspec( dllexport ) virtual KSGSVariable *rückruf( RCArray< KSGSVariable > *parameter ) const;
+		__declspec( dllexport ) virtual Text *getScriptDateiPfad() const;
+		__declspec( dllexport ) virtual Text *zScriptDateiPfad() const;
+		__declspec( dllexport ) virtual Schrift *getSchrift() const;
+		__declspec( dllexport ) virtual Schrift *zSchrift() const;
+		__declspec( dllexport ) virtual Bildschirm *getBildschirm() const;
+		__declspec( dllexport ) virtual Bildschirm *zBildschirm() const;
+		__declspec( dllexport ) virtual int getScriptId() const;
+		__declspec( dllexport ) virtual bool istBeendet( int scrId ) const;
+		__declspec( dllexport ) virtual int getFunktionId( const char *name ) const;
+		__declspec( dllexport ) virtual KSGSVariable *getVariable( int id ) const;
+		// Reference Counting
+		__declspec( dllexport ) virtual KSGScriptObj *getThis();
+		__declspec( dllexport ) virtual KSGScriptObj *release();
+	};
+}
+
+#endif

+ 233 - 0
ksgScript/ksgScript.vcxproj

@@ -0,0 +1,233 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup Label="ProjectConfigurations">
+    <ProjectConfiguration Include="Debug|Win32">
+      <Configuration>Debug</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Debug|x64">
+      <Configuration>Debug</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|Win32">
+      <Configuration>Release</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|x64">
+      <Configuration>Release</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+  </ItemGroup>
+  <PropertyGroup Label="Globals">
+    <ProjectGuid>{50E49628-0E0C-41A3-B48D-1E9EE553EC6F}</ProjectGuid>
+    <Keyword>Win32Proj</Keyword>
+    <RootNamespace>ksgScript</RootNamespace>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <PlatformToolset>v141</PlatformToolset>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <PlatformToolset>v141</PlatformToolset>
+    <CharacterSet>MultiByte</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <UseDebugLibraries>false</UseDebugLibraries>
+    <PlatformToolset>v141</PlatformToolset>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+    <CharacterSet>MultiByte</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <UseDebugLibraries>false</UseDebugLibraries>
+    <PlatformToolset>v141</PlatformToolset>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+    <CharacterSet>MultiByte</CharacterSet>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+  <ImportGroup Label="ExtensionSettings">
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <PropertyGroup Label="UserMacros" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <LinkIncremental>true</LinkIncremental>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <LinkIncremental>true</LinkIncremental>
+    <IncludePath>..\..\Framework;$(IncludePath)</IncludePath>
+    <LibraryPath>..\..\Framework\x64\Debug;$(LibraryPath)</LibraryPath>
+    <CustomBuildBeforeTargets>Build</CustomBuildBeforeTargets>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <LinkIncremental>false</LinkIncremental>
+    <IncludePath>..\..\Framework;$(IncludePath)</IncludePath>
+    <LibraryPath>..\..\Framework\Release;$(LibraryPath)</LibraryPath>
+    <CustomBuildBeforeTargets>Build</CustomBuildBeforeTargets>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <LinkIncremental>false</LinkIncremental>
+    <IncludePath>..\..\Framework;$(IncludePath)</IncludePath>
+    <LibraryPath>..\..\Framework\x64\Release;$(LibraryPath)</LibraryPath>
+    <CustomBuildBeforeTargets>Build</CustomBuildBeforeTargets>
+  </PropertyGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <ClCompile>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <Optimization>Disabled</Optimization>
+      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;KSGSCRIPT_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+    </ClCompile>
+    <Link>
+      <SubSystem>Windows</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <ClCompile>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <Optimization>Disabled</Optimization>
+      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;KSGSCRIPT_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+    </ClCompile>
+    <Link>
+      <SubSystem>Windows</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <AdditionalDependencies>Framework.lib;%(AdditionalDependencies)</AdditionalDependencies>
+    </Link>
+    <CustomBuildStep>
+      <Command>copy "..\x64\Debug\ksgScript.dll" "..\..\Test\Test\KSGScript.dll"
+copy "..\x64\Debug\ksgScript.dll" "..\..\..\Spiele Platform\Klient\patcher\patcher\data\bin\KSGScript.dll"
+copy "..\x64\Debug\ksgScript.dll" "..\..\..\Spiele Platform\Klient\Fertig\Debug\x64\data\bin\KSGScript.dll"</Command>
+    </CustomBuildStep>
+    <CustomBuildStep>
+      <Outputs>Kopieren...;%(Outputs)</Outputs>
+    </CustomBuildStep>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <ClCompile>
+      <WarningLevel>Level3</WarningLevel>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <Optimization>MaxSpeed</Optimization>
+      <FunctionLevelLinking>true</FunctionLevelLinking>
+      <IntrinsicFunctions>true</IntrinsicFunctions>
+      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;KSGSCRIPT_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+    </ClCompile>
+    <Link>
+      <SubSystem>Windows</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <OptimizeReferences>true</OptimizeReferences>
+      <AdditionalDependencies>Framework.lib;%(AdditionalDependencies)</AdditionalDependencies>
+    </Link>
+    <CustomBuildStep>
+      <Command>copy "..\Release\ksgScript.dll" "..\..\..\Spiele Platform\Klient\Fertig\x32\data\bin\KSGScript.dll"</Command>
+    </CustomBuildStep>
+    <CustomBuildStep>
+      <Outputs>kopieren...;%(Outputs)</Outputs>
+    </CustomBuildStep>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <ClCompile>
+      <WarningLevel>Level3</WarningLevel>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <Optimization>MaxSpeed</Optimization>
+      <FunctionLevelLinking>true</FunctionLevelLinking>
+      <IntrinsicFunctions>true</IntrinsicFunctions>
+      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;KSGSCRIPT_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+    </ClCompile>
+    <Link>
+      <SubSystem>Windows</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <OptimizeReferences>true</OptimizeReferences>
+      <AdditionalDependencies>Framework.lib;%(AdditionalDependencies)</AdditionalDependencies>
+    </Link>
+    <CustomBuildStep>
+      <Command>copy "..\x64\Release\ksgScript.dll" "..\..\..\Spiele Platform\Klient\Fertig\x64\data\bin\KSGScript.dll"</Command>
+    </CustomBuildStep>
+    <CustomBuildStep>
+      <Outputs>kopieren...;%(Outputs)</Outputs>
+    </CustomBuildStep>
+  </ItemDefinitionGroup>
+  <ItemGroup>
+    <ClInclude Include="Befehl\KSGSBefehl.h" />
+    <ClInclude Include="Befehl\KSGSFunktion.h" />
+    <ClInclude Include="Befehl\KSGSKlasse.h" />
+    <ClInclude Include="Befehl\KSGSVariable.h" />
+    <ClInclude Include="Error\Error.h" />
+    <ClInclude Include="Funktionen\KSGSRückruf.h" />
+    <ClInclude Include="Include\KSGScript.h" />
+    <ClInclude Include="Include\KSGSStandart.h" />
+    <ClInclude Include="Klassen\KSGSArray.h" />
+    <ClInclude Include="Klassen\KSGSFenster.h" />
+    <ClInclude Include="Klassen\KSGSAnimation2D.h" />
+    <ClInclude Include="Klassen\KSGSAnimation2DData.h" />
+    <ClInclude Include="Klassen\KSGSBild.h" />
+    <ClInclude Include="Klassen\KSGSBildZ.h" />
+    <ClInclude Include="Klassen\KSGSBool.h" />
+    <ClInclude Include="Klassen\KSGSDouble.h" />
+    <ClInclude Include="Klassen\KSGSInt.h" />
+    <ClInclude Include="Klassen\KSGSKnopf.h" />
+    <ClInclude Include="Klassen\KSGSMausEreignis.h" />
+    <ClInclude Include="Klassen\KSGSTastaturEreignis.h" />
+    <ClInclude Include="Klassen\KSGSText.h" />
+    <ClInclude Include="Klassen\KSGSTextFeld.h" />
+    <ClInclude Include="Klassen\KSGSThread.h" />
+    <ClInclude Include="Klassen\KSGSTyp.h" />
+    <ClInclude Include="Leser\KSGSCompile.h" />
+    <ClInclude Include="Leser\KSGSLeser.h" />
+    <ClInclude Include="Main\KSGScriptObj.h" />
+  </ItemGroup>
+  <ItemGroup>
+    <ClCompile Include="Befehl\KSGSBefehl.cpp" />
+    <ClCompile Include="Befehl\KSGSFunktion.cpp" />
+    <ClCompile Include="Befehl\KSGSKlasse.cpp" />
+    <ClCompile Include="Error\Error.cpp" />
+    <ClCompile Include="Funktionen\KSGSRückruf.cpp" />
+    <ClCompile Include="Klassen\KSGSAnimation2D.cpp" />
+    <ClCompile Include="Klassen\KSGSAnimation2DData.cpp" />
+    <ClCompile Include="Klassen\KSGSArray.cpp" />
+    <ClCompile Include="Klassen\KSGSBild.cpp" />
+    <ClCompile Include="Klassen\KSGSBildZ.cpp" />
+    <ClCompile Include="Klassen\KSGSBool.cpp" />
+    <ClCompile Include="Klassen\KSGSDouble.cpp" />
+    <ClCompile Include="Klassen\KSGSFenster.cpp" />
+    <ClCompile Include="Klassen\KSGSInt.cpp" />
+    <ClCompile Include="Klassen\KSGSKnopf.cpp" />
+    <ClCompile Include="Klassen\KSGSMausEreignis.cpp" />
+    <ClCompile Include="Klassen\KSGSTastaturEreignis.cpp" />
+    <ClCompile Include="Klassen\KSGSText.cpp" />
+    <ClCompile Include="Klassen\KSGSTextFeld.cpp" />
+    <ClCompile Include="Klassen\KSGSThread.cpp" />
+    <ClCompile Include="Leser\KSGSCompile.cpp" />
+    <ClCompile Include="Leser\KSGSLeser.cpp" />
+    <ClCompile Include="Main\Einstieg.cpp" />
+    <ClCompile Include="Main\KSGScriptObj.cpp" />
+  </ItemGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+  <ImportGroup Label="ExtensionTargets">
+  </ImportGroup>
+</Project>

+ 174 - 0
ksgScript/ksgScript.vcxproj.filters

@@ -0,0 +1,174 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup>
+    <Filter Include="Quelldateien">
+      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+    </Filter>
+    <Filter Include="Headerdateien">
+      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+      <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
+    </Filter>
+    <Filter Include="Ressourcendateien">
+      <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+    </Filter>
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="Befehl\KSGSBefehl.h">
+      <Filter>Headerdateien</Filter>
+    </ClInclude>
+    <ClInclude Include="Befehl\KSGSFunktion.h">
+      <Filter>Headerdateien</Filter>
+    </ClInclude>
+    <ClInclude Include="Leser\KSGSLeser.h">
+      <Filter>Headerdateien</Filter>
+    </ClInclude>
+    <ClInclude Include="Main\KSGScriptObj.h">
+      <Filter>Headerdateien</Filter>
+    </ClInclude>
+    <ClInclude Include="Befehl\KSGSKlasse.h">
+      <Filter>Headerdateien</Filter>
+    </ClInclude>
+    <ClInclude Include="Error\Error.h">
+      <Filter>Headerdateien</Filter>
+    </ClInclude>
+    <ClInclude Include="Leser\KSGSCompile.h">
+      <Filter>Headerdateien</Filter>
+    </ClInclude>
+    <ClInclude Include="Klassen\KSGSThread.h">
+      <Filter>Headerdateien</Filter>
+    </ClInclude>
+    <ClInclude Include="Klassen\KSGSTyp.h">
+      <Filter>Headerdateien</Filter>
+    </ClInclude>
+    <ClInclude Include="Klassen\KSGSInt.h">
+      <Filter>Headerdateien</Filter>
+    </ClInclude>
+    <ClInclude Include="Klassen\KSGSBool.h">
+      <Filter>Headerdateien</Filter>
+    </ClInclude>
+    <ClInclude Include="Klassen\KSGSDouble.h">
+      <Filter>Headerdateien</Filter>
+    </ClInclude>
+    <ClInclude Include="Klassen\KSGSText.h">
+      <Filter>Headerdateien</Filter>
+    </ClInclude>
+    <ClInclude Include="Klassen\KSGSBild.h">
+      <Filter>Headerdateien</Filter>
+    </ClInclude>
+    <ClInclude Include="Klassen\KSGSMausEreignis.h">
+      <Filter>Headerdateien</Filter>
+    </ClInclude>
+    <ClInclude Include="Klassen\KSGSTastaturEreignis.h">
+      <Filter>Headerdateien</Filter>
+    </ClInclude>
+    <ClInclude Include="Klassen\KSGSTextFeld.h">
+      <Filter>Headerdateien</Filter>
+    </ClInclude>
+    <ClInclude Include="Klassen\KSGSKnopf.h">
+      <Filter>Headerdateien</Filter>
+    </ClInclude>
+    <ClInclude Include="Klassen\KSGSAnimation2DData.h">
+      <Filter>Headerdateien</Filter>
+    </ClInclude>
+    <ClInclude Include="Klassen\KSGSAnimation2D.h">
+      <Filter>Headerdateien</Filter>
+    </ClInclude>
+    <ClInclude Include="Klassen\KSGSFenster.h">
+      <Filter>Headerdateien</Filter>
+    </ClInclude>
+    <ClInclude Include="Befehl\KSGSVariable.h">
+      <Filter>Headerdateien</Filter>
+    </ClInclude>
+    <ClInclude Include="Funktionen\KSGSRückruf.h">
+      <Filter>Headerdateien</Filter>
+    </ClInclude>
+    <ClInclude Include="Include\KSGScript.h">
+      <Filter>Headerdateien</Filter>
+    </ClInclude>
+    <ClInclude Include="Include\KSGSStandart.h">
+      <Filter>Headerdateien</Filter>
+    </ClInclude>
+    <ClInclude Include="Klassen\KSGSArray.h">
+      <Filter>Headerdateien</Filter>
+    </ClInclude>
+    <ClInclude Include="Klassen\KSGSBildZ.h">
+      <Filter>Headerdateien</Filter>
+    </ClInclude>
+  </ItemGroup>
+  <ItemGroup>
+    <ClCompile Include="Befehl\KSGSFunktion.cpp">
+      <Filter>Quelldateien</Filter>
+    </ClCompile>
+    <ClCompile Include="Leser\KSGSLeser.cpp">
+      <Filter>Quelldateien</Filter>
+    </ClCompile>
+    <ClCompile Include="Befehl\KSGSBefehl.cpp">
+      <Filter>Quelldateien</Filter>
+    </ClCompile>
+    <ClCompile Include="Main\KSGScriptObj.cpp">
+      <Filter>Quelldateien</Filter>
+    </ClCompile>
+    <ClCompile Include="Befehl\KSGSKlasse.cpp">
+      <Filter>Quelldateien</Filter>
+    </ClCompile>
+    <ClCompile Include="Error\Error.cpp">
+      <Filter>Quelldateien</Filter>
+    </ClCompile>
+    <ClCompile Include="Leser\KSGSCompile.cpp">
+      <Filter>Quelldateien</Filter>
+    </ClCompile>
+    <ClCompile Include="Klassen\KSGSThread.cpp">
+      <Filter>Quelldateien</Filter>
+    </ClCompile>
+    <ClCompile Include="Klassen\KSGSBool.cpp">
+      <Filter>Quelldateien</Filter>
+    </ClCompile>
+    <ClCompile Include="Klassen\KSGSInt.cpp">
+      <Filter>Quelldateien</Filter>
+    </ClCompile>
+    <ClCompile Include="Klassen\KSGSDouble.cpp">
+      <Filter>Quelldateien</Filter>
+    </ClCompile>
+    <ClCompile Include="Klassen\KSGSText.cpp">
+      <Filter>Quelldateien</Filter>
+    </ClCompile>
+    <ClCompile Include="Klassen\KSGSBild.cpp">
+      <Filter>Quelldateien</Filter>
+    </ClCompile>
+    <ClCompile Include="Klassen\KSGSMausEreignis.cpp">
+      <Filter>Quelldateien</Filter>
+    </ClCompile>
+    <ClCompile Include="Klassen\KSGSTastaturEreignis.cpp">
+      <Filter>Quelldateien</Filter>
+    </ClCompile>
+    <ClCompile Include="Klassen\KSGSTextFeld.cpp">
+      <Filter>Quelldateien</Filter>
+    </ClCompile>
+    <ClCompile Include="Klassen\KSGSKnopf.cpp">
+      <Filter>Quelldateien</Filter>
+    </ClCompile>
+    <ClCompile Include="Klassen\KSGSFenster.cpp">
+      <Filter>Quelldateien</Filter>
+    </ClCompile>
+    <ClCompile Include="Klassen\KSGSAnimation2DData.cpp">
+      <Filter>Quelldateien</Filter>
+    </ClCompile>
+    <ClCompile Include="Klassen\KSGSAnimation2D.cpp">
+      <Filter>Quelldateien</Filter>
+    </ClCompile>
+    <ClCompile Include="Funktionen\KSGSRückruf.cpp">
+      <Filter>Quelldateien</Filter>
+    </ClCompile>
+    <ClCompile Include="Main\Einstieg.cpp">
+      <Filter>Quelldateien</Filter>
+    </ClCompile>
+    <ClCompile Include="Klassen\KSGSArray.cpp">
+      <Filter>Quelldateien</Filter>
+    </ClCompile>
+    <ClCompile Include="Klassen\KSGSBildZ.cpp">
+      <Filter>Quelldateien</Filter>
+    </ClCompile>
+  </ItemGroup>
+</Project>