Quellcode durchsuchen

add KSGSExpressionEvaluator to evaluate simple expressions without graphics

Kolja Strohm vor 3 Jahren
Ursprung
Commit
1f8b63a9d7
55 geänderte Dateien mit 4719 neuen und 4565 gelöschten Zeilen
  1. 10 0
      ksgScript/.h
  2. 1314 1331
      ksgScript/Befehl/KSGSBefehl.cpp
  3. 235 238
      ksgScript/Befehl/KSGSBefehl.h
  4. 14 29
      ksgScript/Befehl/KSGSFunktion.cpp
  5. 69 73
      ksgScript/Befehl/KSGSFunktion.h
  6. 323 354
      ksgScript/Befehl/KSGSKlasse.cpp
  7. 58 66
      ksgScript/Befehl/KSGSKlasse.h
  8. 11 26
      ksgScript/Editor/Editor.cpp
  9. 0 3
      ksgScript/Editor/Editor.h
  10. 9 9
      ksgScript/Editor/Parser/ColorParser.cpp
  11. 4 3
      ksgScript/Error/Error.cpp
  12. 2 2
      ksgScript/Error/Error.h
  13. 15 16
      ksgScript/Funktionen/KSGSRückruf.cpp
  14. 103 93
      ksgScript/Include/KSGScript.h
  15. 3 3
      ksgScript/Klassen/KSGSAnimation2D.cpp
  16. 16 16
      ksgScript/Klassen/KSGSAnimation2D.h
  17. 99 99
      ksgScript/Klassen/KSGSAnimation2DData.cpp
  18. 16 16
      ksgScript/Klassen/KSGSAnimation2DData.h
  19. 86 86
      ksgScript/Klassen/KSGSArray.cpp
  20. 16 16
      ksgScript/Klassen/KSGSArray.h
  21. 275 275
      ksgScript/Klassen/KSGSBild.cpp
  22. 17 17
      ksgScript/Klassen/KSGSBild.h
  23. 5 5
      ksgScript/Klassen/KSGSBildZ.cpp
  24. 20 20
      ksgScript/Klassen/KSGSBildZ.h
  25. 103 103
      ksgScript/Klassen/KSGSBool.cpp
  26. 15 15
      ksgScript/Klassen/KSGSBool.h
  27. 123 123
      ksgScript/Klassen/KSGSDouble.cpp
  28. 16 16
      ksgScript/Klassen/KSGSDouble.h
  29. 8 8
      ksgScript/Klassen/KSGSFenster.cpp
  30. 23 23
      ksgScript/Klassen/KSGSFenster.h
  31. 123 123
      ksgScript/Klassen/KSGSInt.cpp
  32. 1 1
      ksgScript/Klassen/KSGSInt.h
  33. 6 6
      ksgScript/Klassen/KSGSKnopf.cpp
  34. 20 20
      ksgScript/Klassen/KSGSKnopf.h
  35. 75 76
      ksgScript/Klassen/KSGSMausEreignis.cpp
  36. 17 17
      ksgScript/Klassen/KSGSMausEreignis.h
  37. 67 68
      ksgScript/Klassen/KSGSTastaturEreignis.cpp
  38. 17 17
      ksgScript/Klassen/KSGSTastaturEreignis.h
  39. 180 180
      ksgScript/Klassen/KSGSText.cpp
  40. 17 17
      ksgScript/Klassen/KSGSText.h
  41. 7 7
      ksgScript/Klassen/KSGSTextFeld.cpp
  42. 23 23
      ksgScript/Klassen/KSGSTextFeld.h
  43. 46 46
      ksgScript/Klassen/KSGSThread.cpp
  44. 13 13
      ksgScript/Klassen/KSGSThread.h
  45. 453 498
      ksgScript/Leser/KSGSCompile.cpp
  46. 77 89
      ksgScript/Leser/KSGSCompile.h
  47. 53 67
      ksgScript/Leser/KSGSLeser.cpp
  48. 108 111
      ksgScript/Leser/KSGSLeser.h
  49. 5 0
      ksgScript/Main/Einstieg.cpp
  50. 243 0
      ksgScript/Main/KSGSExpressionEvaluator.cpp
  51. 49 0
      ksgScript/Main/KSGSExpressionEvaluator.h
  52. 38 34
      ksgScript/Main/KSGScriptObj.cpp
  53. 65 68
      ksgScript/Main/KSGScriptObj.h
  54. 2 0
      ksgScript/ksgScript.vcxproj
  55. 6 0
      ksgScript/ksgScript.vcxproj.filters

+ 10 - 0
ksgScript/.h

@@ -0,0 +1,10 @@
+#pragma once
+
+#include "KSGScript.h"
+
+using namespace KSGScript;
+
+class KSGSExpressionEvaluatorImpl : public KSGSExpressionEvaluator
+{
+
+};

+ 1314 - 1331
ksgScript/Befehl/KSGSBefehl.cpp

@@ -14,511 +14,511 @@ 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 )
+                                        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;
+    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 )
+KSGSBefehlFunktion::KSGSBefehlFunktion( KSGScriptProcessor *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;
+    *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( 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;
+        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 )
-	{
+        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;
+        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 );
+    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 )
+KSGSBefehlMember::KSGSBefehlMember( KSGScriptProcessor *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;
+    *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, (Text *)abschnitt.getThis(), dbg, zKT, zFT, zVT, klassName, funktionName, typId, &b );
+        if( !b )
+            return;
+    }
+    else
+    { // Variable
+        typ = VARIABLE;
+        bool b = 0;
+        var = new KSGSBefehlVariable( (Text *)abschnitt.getThis(), zKT, zFT, zVT, klassName, funktionName, typId, &b );
+        if( !b )
+            return;
+    }
+    *ok = 1;
 }
 
 KSGSBefehlMember::~KSGSBefehlMember()
 {
-	if( bef )
-		bef->release();
-	delete funk;
-	delete var;
+    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 )
+KSGSBefehlParameter::KSGSBefehlParameter( KSGScriptProcessor *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;
+    *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, (Text *)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 );
+    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 )
+KSGSBefehlErstell::KSGSBefehlErstell( KSGScriptProcessor *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;
+    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, (Text *)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;
+    delete param;
 }
 
 
 // Inhalt der KSGSBefehl Klasse aus KSGSBefehl.h
 // Konstruktor
 KSGSBefehl::KSGSBefehl( Typ typ )
+    : ReferenceCounter()
 {
-	this->typ = typ;
-	fehler = 0;
-	returnTyp = -1;
-	ref = 1;
+    this->typ = typ;
+    fehler = 0;
+    returnTyp = -1;
 }
 
 // Destruktor
@@ -528,970 +528,954 @@ KSGSBefehl::~KSGSBefehl()
 }
 
 // constant
-KSGSVariable *KSGSBefehl::ausführen( KSGScriptObj *zObj, KSGSFunktionInstanz *zFI, KSGSVariable *zKI ) const
+KSGSVariable *KSGSBefehl::ausführen( KSGScriptProcessor *zObj, KSGSFunktionInstanz *zFI, KSGSVariable *zKI ) const
 {
-	return 0;
+    return 0;
 }
 
 bool KSGSBefehl::hatFehler() const
 {
-	return fehler;
+    return fehler;
 }
 
 int KSGSBefehl::getReturnTyp() const
 {
-	return returnTyp;
+    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;
+    return typ == t;
 }
 
 // static
-KSGSVariable *KSGSBefehl::prozessVariable( KSGSVariable *zVorObj, KSGSBefehlVariable *zVar, KSGScriptObj *zObj, KSGSFunktionInstanz *zFI, KSGSVariable *zKI )
+KSGSVariable *KSGSBefehl::prozessVariable( KSGSVariable *zVorObj, KSGSBefehlVariable *zVar, KSGScriptProcessor *zObj, KSGSFunktionInstanz *zFI, KSGSVariable *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;
+    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, KSGSVariable *zKI )
+KSGSVariable *KSGSBefehl::prozessFunktion( KSGSVariable *zVorObj, KSGSBefehlFunktion *zFunk, KSGScriptProcessor *zObj, KSGSFunktionInstanz *zFI, KSGSVariable *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;
+    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, KSGSVariable *zKI )
+KSGSVariable *KSGSBefehl::prozessMember( KSGSVariable *zVorObj, KSGSBefehlMember *zMem, KSGScriptProcessor *zObj, KSGSFunktionInstanz *zFI, KSGSVariable *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;
+    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, KSGSVariable *zKI )
+KSGSVariable *KSGSBefehl::prozessParameter( KSGSBefehlParameter *zParam, KSGScriptProcessor *zObj, KSGSFunktionInstanz *zFI, KSGSVariable *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;
+    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, KSGSVariable *zKI )
+KSGSVariable *KSGSBefehl::prozessErstell( KSGSBefehlErstell *zErst, KSGScriptProcessor *zObj, KSGSFunktionInstanz *zFI, KSGSVariable *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 = KSGSKlasseInstanz::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;
+    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 = KSGSKlasseInstanz::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, (KSGSVariable *)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 )
+KSGSCallBefehl::KSGSCallBefehl( KSGScriptProcessor *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;
+    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, (Text *)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 );
+    int anz = objekt.getEintragAnzahl();
+    for( int i = 0; i < anz; i++ )
+        delete objekt.get( i );
 }
 
 // constant
-KSGSVariable *KSGSCallBefehl::ausführen( KSGScriptObj *zObj, KSGSFunktionInstanz *zFI, KSGSVariable *zKI ) const
+KSGSVariable *KSGSCallBefehl::ausführen( KSGScriptProcessor *zObj, KSGSFunktionInstanz *zFI, KSGSVariable *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;
+    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 = (KSGSVariable *)v->release();
+        v = tmp;
+    }
+    return v;
 }
 
 
 // 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 )
+KSGSOperatorBefehl::KSGSOperatorBefehl( KSGScriptProcessor *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;
+    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;
+    delete paramL;
+    delete paramR;
 }
 
 // constant
-KSGSVariable *KSGSOperatorBefehl::ausführen( KSGScriptObj *zObj, KSGSFunktionInstanz *zFI, KSGSVariable *zKI ) const
+KSGSVariable *KSGSOperatorBefehl::ausführen( KSGScriptProcessor *zObj, KSGSFunktionInstanz *zFI, KSGSVariable *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;
+    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 ? (KSGSVariable *)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, (KSGSVariable *)r->getThis() );
+            return r;
+        }
+        else if( !vS ) // Scriptvariable
+        {
+            if( lVObj )
+                lVObj->release();
+            zObj->setVariable( vId, (KSGSVariable *)r->getThis() );
+            return r;
+        }
+        else // Klassenvariable
+        {
+            if( !lVObj )
+            {
+                zKI->setVariable( vId, (KSGSVariable *)r->getThis() );
+                return r;
+            }
+            lVObj->setVariable( vId, (KSGSVariable *)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;
 }
 
 
 // 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 )
+KSGSIfBefehl::KSGSIfBefehl( KSGScriptProcessor *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 );
-	}
+    bedingung = 0;
+    int bTyp = -1;
+    bool b = 0;
+    bedingung = new KSGSBefehlParameter( zObj, (Text *)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 = (KSGSBefehl *)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 = (KSGSBefehl *)ret->release();
+        if( !ret )
+        {
+            fehler = 1;
+            return;
+        }
+        bFalse.add( ret );
+    }
 }
 
 // Destruktor
 KSGSIfBefehl::~KSGSIfBefehl()
 {
-	delete bedingung;
+    delete bedingung;
 }
 
 // constant
-KSGSVariable *KSGSIfBefehl::ausführen( KSGScriptObj *zObj, KSGSFunktionInstanz *zFI, KSGSVariable *zKI ) const
+KSGSVariable *KSGSIfBefehl::ausführen( KSGScriptProcessor *zObj, KSGSFunktionInstanz *zFI, KSGSVariable *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;
+    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;
 }
 
 
 // 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 )
+KSGSForBefehl::KSGSForBefehl( KSGScriptProcessor *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 );
-	}
+    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 = (KSGSBefehl *)ret->release();
+        if( !ret )
+        {
+            fehler = 1;
+            return;
+        }
+        schleife.add( ret );
+    }
 }
 
 // Destruktor
 KSGSForBefehl::~KSGSForBefehl()
 {
-	if( links )
-		links->release();
-	if( rechts )
-		rechts->release();
-	delete bedingung;
+    if( links )
+        links->release();
+    if( rechts )
+        rechts->release();
+    delete bedingung;
 }
 
 // constant
-KSGSVariable *KSGSForBefehl::ausführen( KSGScriptObj *zObj, KSGSFunktionInstanz *zFI, KSGSVariable *zKI ) const
+KSGSVariable *KSGSForBefehl::ausführen( KSGScriptProcessor *zObj, KSGSFunktionInstanz *zFI, KSGSVariable *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;
+    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;
 }
 
 
 // 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 )
+KSGSWhileBefehl::KSGSWhileBefehl( KSGScriptProcessor *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 );
-	}
+    bedingung = 0;
+    int bTyp = -1;
+    bool b = 0;
+    bedingung = new KSGSBefehlParameter( zObj, (Text *)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 = (KSGSBefehl *)ret->release();
+        if( !ret )
+        {
+            fehler = 1;
+            return;
+        }
+        schleife.add( ret );
+    }
 }
 
 // Destruktor
 KSGSWhileBefehl::~KSGSWhileBefehl()
 {
-	delete bedingung;
+    delete bedingung;
 }
 
 // constant
-KSGSVariable *KSGSWhileBefehl::ausführen( KSGScriptObj *zObj, KSGSFunktionInstanz *zFI, KSGSVariable *zKI ) const
+KSGSVariable *KSGSWhileBefehl::ausführen( KSGScriptProcessor *zObj, KSGSFunktionInstanz *zFI, KSGSVariable *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;
+    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;
 }
 
 
 // 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 )
+KSGSReturnBefehl::KSGSReturnBefehl( KSGScriptProcessor *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 )
-	{
+    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;
+    delete param;
 }
 
 // constant
-KSGSVariable *KSGSReturnBefehl::ausführen( KSGScriptObj *zObj, KSGSFunktionInstanz *zFI, KSGSVariable *zKI ) const
+KSGSVariable *KSGSReturnBefehl::ausführen( KSGScriptProcessor *zObj, KSGSFunktionInstanz *zFI, KSGSVariable *zKI ) const
 {
-	KSGSVariable *v = param ? prozessParameter( param, zObj, zFI, zKI ) : 0;
-	if( v )
-		zFI->setReturnVariable( v );
-	zFI->setEnde();
-	return 0;
+    KSGSVariable *v = param ? prozessParameter( param, zObj, zFI, zKI ) : 0;
+    if( v )
+        zFI->setReturnVariable( v );
+    zFI->setEnde();
+    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 )
-{
-}
+                                  KSGSCompVarTable *zVT, const char *klassName, const char *funktionName )
+    : KSGSBefehl( Typ::BREAK )
+{}
 
 // Destruktor
 KSGSBreakBefehl::~KSGSBreakBefehl()
@@ -1500,20 +1484,19 @@ KSGSBreakBefehl::~KSGSBreakBefehl()
 }
 
 // constant
-KSGSVariable *KSGSBreakBefehl::ausführen( KSGScriptObj *zObj, KSGSFunktionInstanz *zFI, KSGSVariable *zKI ) const
+KSGSVariable *KSGSBreakBefehl::ausführen( KSGScriptProcessor *zObj, KSGSFunktionInstanz *zFI, KSGSVariable *zKI ) const
 {
-	zFI->setBreak();
-	return 0;
+    zFI->setBreak();
+    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 )
-{
-}
+                                        KSGSCompVarTable *zVT, const char *klassName, const char *funktionName )
+    : KSGSBefehl( Typ::CONTINUE )
+{}
 
 // Destruktor
 KSGSContinueBefehl::~KSGSContinueBefehl()
@@ -1522,45 +1505,45 @@ KSGSContinueBefehl::~KSGSContinueBefehl()
 }
 
 // constant
-KSGSVariable *KSGSContinueBefehl::ausführen( KSGScriptObj *zObj, KSGSFunktionInstanz *zFI, KSGSVariable *zKI ) const
+KSGSVariable *KSGSContinueBefehl::ausführen( KSGScriptProcessor *zObj, KSGSFunktionInstanz *zFI, KSGSVariable *zKI ) const
 {
-	zFI->setContinue();
-	return 0;
+    zFI->setContinue();
+    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 )
+KSGSVariableBefehl::KSGSVariableBefehl( KSGScriptProcessor *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;
-	}
+    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;
+    delete erstell;
 }
 
 // constant
-KSGSVariable *KSGSVariableBefehl::ausführen( KSGScriptObj *zObj, KSGSFunktionInstanz *zFI, KSGSVariable *zKI ) const
+KSGSVariable *KSGSVariableBefehl::ausführen( KSGScriptProcessor *zObj, KSGSFunktionInstanz *zFI, KSGSVariable *zKI ) const
 {
-	return prozessErstell( erstell, zObj, zFI, zKI );
+    return prozessErstell( erstell, zObj, zFI, zKI );
 }

+ 235 - 238
ksgScript/Befehl/KSGSBefehl.h

@@ -8,270 +8,267 @@ 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 KSGSVariable; // KSGSKlasse.h
+    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 KSGSVariable; // KSGSKlasse.h
+    class KSGScriptProcessor;
 
-	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 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 KSGSBefehlFunktion
+    {
+        int funcId;
+        int funkSichtbar;
+        Array< KSGSBefehlParameter * > parameter;
+        // Konstruktor
+        __declspec( dllexport ) KSGSBefehlFunktion( KSGScriptProcessor *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 KSGSBefehlMember
+    {
+        enum Typ
+        {
+            BEFEHL,
+            FUNKTION,
+            VARIABLE
+        };
+        Typ typ;
+        KSGSBefehl *bef;
+        KSGSBefehlFunktion *funk;
+        KSGSBefehlVariable *var;
+        // Konstruktor
+        __declspec( dllexport ) KSGSBefehlMember( KSGScriptProcessor *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 KSGSBefehlParameter
+    {
+        enum Typ
+        {
+            WERT,
+            OBJEKT
+        };
+        Typ typ;
+        Text wert;
+        Array< KSGSBefehlMember * > objekt;
+        // Konstruktor
+        __declspec( dllexport ) KSGSBefehlParameter( KSGScriptProcessor *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();
-	};
+    struct KSGSBefehlErstell
+    {
+        int id;
+        int typId;
+        bool konstruktor;
+        KSGSBefehlParameter *param;
+        // Konstruktor
+        __declspec( dllexport ) KSGSBefehlErstell( KSGScriptProcessor *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
-		};
+    class KSGSBefehl : public virtual ReferenceCounter
+    {
+    public:
+        enum Typ
+        {
+            CALL,
+            OPERATOR,
+            IF,
+            FOR,
+            WHILE,
+            RETURN,
+            BREAK,
+            CONTINUE,
+            VARIABLE
+        };
 
-	protected:
-		Typ typ;
-		bool fehler;
-		int returnTyp;
-		int ref;
+    protected:
+        Typ typ;
+        bool fehler;
+        int returnTyp;
 
-	public:
-		// Konstruktor
-		__declspec( dllexport ) KSGSBefehl( Typ typ );
-		// Destruktor
-		__declspec( dllexport ) virtual ~KSGSBefehl();
-		// constant
-		__declspec( dllexport ) virtual KSGSVariable *ausführen( KSGScriptObj *zObj, KSGSFunktionInstanz *zFI, KSGSVariable *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, KSGSVariable *zKI );
-		__declspec( dllexport ) static KSGSVariable *prozessFunktion( KSGSVariable *zVorObj, KSGSBefehlFunktion *zFunk, KSGScriptObj *zObj, KSGSFunktionInstanz *zFI, KSGSVariable *zKI );
-		__declspec( dllexport ) static KSGSVariable *prozessMember( KSGSVariable *zVorObj, KSGSBefehlMember *zMem, KSGScriptObj *zObj, KSGSFunktionInstanz *zFI, KSGSVariable *zKI );
-		__declspec( dllexport ) static KSGSVariable *prozessParameter( KSGSBefehlParameter *zParam, KSGScriptObj *zObj, KSGSFunktionInstanz *zFI, KSGSVariable *zKI );
-		__declspec( dllexport ) static KSGSVariable *prozessErstell( KSGSBefehlErstell *zErst, KSGScriptObj *zObj, KSGSFunktionInstanz *zFI, KSGSVariable *zKI );
-	};
+    public:
+        // Konstruktor
+        __declspec( dllexport ) KSGSBefehl( Typ typ );
+        // Destruktor
+        __declspec( dllexport ) virtual ~KSGSBefehl();
+        // constant
+        __declspec( dllexport ) virtual KSGSVariable *ausführen( KSGScriptProcessor *zObj, KSGSFunktionInstanz *zFI, KSGSVariable *zKI ) const;
+        __declspec( dllexport ) bool hatFehler() const;
+        __declspec( dllexport ) int getReturnTyp() const;
+        __declspec( dllexport ) bool istTyp( Typ t ) const;
+        // static
+        __declspec( dllexport ) static KSGSVariable *prozessVariable( KSGSVariable *zVorObj, KSGSBefehlVariable *zVar, KSGScriptProcessor *zObj, KSGSFunktionInstanz *zFI, KSGSVariable *zKI );
+        __declspec( dllexport ) static KSGSVariable *prozessFunktion( KSGSVariable *zVorObj, KSGSBefehlFunktion *zFunk, KSGScriptProcessor *zObj, KSGSFunktionInstanz *zFI, KSGSVariable *zKI );
+        __declspec( dllexport ) static KSGSVariable *prozessMember( KSGSVariable *zVorObj, KSGSBefehlMember *zMem, KSGScriptProcessor *zObj, KSGSFunktionInstanz *zFI, KSGSVariable *zKI );
+        __declspec( dllexport ) static KSGSVariable *prozessParameter( KSGSBefehlParameter *zParam, KSGScriptProcessor *zObj, KSGSFunktionInstanz *zFI, KSGSVariable *zKI );
+        __declspec( dllexport ) static KSGSVariable *prozessErstell( KSGSBefehlErstell *zErst, KSGScriptProcessor *zObj, KSGSFunktionInstanz *zFI, KSGSVariable *zKI );
+    };
 
-	class KSGSCallBefehl : public KSGSBefehl
-	{
-	private:
-		Array< KSGSBefehlMember* > objekt;
+    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, KSGSVariable *zKI ) const override;
-	};
+    public:
+        // Konstruktor
+        __declspec( dllexport ) KSGSCallBefehl( KSGScriptProcessor *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( KSGScriptProcessor *zObj, KSGSFunktionInstanz *zFI, KSGSVariable *zKI ) const override;
+    };
 
-	class KSGSOperatorBefehl : public KSGSBefehl
-	{
-	private:
-		KSGSBefehlParameter *paramL;
-		int operatorId;
-		KSGSBefehlParameter *paramR;
+    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, KSGSVariable *zKI ) const override;
-	};
+    public:
+        // Konstruktor
+        __declspec( dllexport ) KSGSOperatorBefehl( KSGScriptProcessor *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( KSGScriptProcessor *zObj, KSGSFunktionInstanz *zFI, KSGSVariable *zKI ) const override;
+    };
 
-	class KSGSIfBefehl : public KSGSBefehl
-	{
-	private:
-		KSGSBefehlParameter *bedingung;
-		RCArray< KSGSBefehl > bTrue;
-		RCArray< KSGSBefehl > bFalse;
+    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, KSGSVariable *zKI ) const override;
-	};
+    public:
+        // Konstruktor
+        __declspec( dllexport ) KSGSIfBefehl( KSGScriptProcessor *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( KSGScriptProcessor *zObj, KSGSFunktionInstanz *zFI, KSGSVariable *zKI ) const override;
+    };
 
-	class KSGSForBefehl : public KSGSBefehl
-	{
-	private:
-		KSGSBefehl *links;
-		KSGSBefehlParameter *bedingung;
-		KSGSBefehl *rechts;
-		RCArray< KSGSBefehl > schleife;
+    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, KSGSVariable *zKI ) const override;
-	};
+    public:
+        // Konstruktor
+        __declspec( dllexport ) KSGSForBefehl( KSGScriptProcessor *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( KSGScriptProcessor *zObj, KSGSFunktionInstanz *zFI, KSGSVariable *zKI ) const override;
+    };
 
-	class KSGSWhileBefehl : public KSGSBefehl
-	{
-	private:
-		KSGSBefehlParameter *bedingung;
-		RCArray< KSGSBefehl > schleife;
+    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, KSGSVariable *zKI ) const override;
-	};
+    public:
+        // Konstruktor
+        __declspec( dllexport ) KSGSWhileBefehl( KSGScriptProcessor *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( KSGScriptProcessor *zObj, KSGSFunktionInstanz *zFI, KSGSVariable *zKI ) const override;
+    };
 
-	class KSGSReturnBefehl : public KSGSBefehl
-	{
-	private:
-		KSGSBefehlParameter *param;
+    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, KSGSVariable *zKI ) const override;
-	};
+    public:
+        // Konstruktor
+        __declspec( dllexport ) KSGSReturnBefehl( KSGScriptProcessor *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( KSGScriptProcessor *zObj, KSGSFunktionInstanz *zFI, KSGSVariable *zKI ) const override;
+    };
 
-	class KSGSBreakBefehl : public KSGSBefehl
-	{
-	private:
+    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, KSGSVariable *zKI ) const override;
-	};
+    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( KSGScriptProcessor *zObj, KSGSFunktionInstanz *zFI, KSGSVariable *zKI ) const override;
+    };
 
-	class KSGSContinueBefehl : public KSGSBefehl
-	{
-	private:
+    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, KSGSVariable *zKI ) const override;
-	};
+    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( KSGScriptProcessor *zObj, KSGSFunktionInstanz *zFI, KSGSVariable *zKI ) const override;
+    };
 
-	class KSGSVariableBefehl : public KSGSBefehl
-	{
-	private:
-		KSGSBefehlErstell *erstell;
+    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, KSGSVariable *zKI ) const override;
-	};
+    public:
+        // Konstruktor
+        __declspec( dllexport ) KSGSVariableBefehl( KSGScriptProcessor *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( KSGScriptProcessor *zObj, KSGSFunktionInstanz *zFI, KSGSVariable *zKI ) const override;
+    };
 }
 
 #endif

+ 14 - 29
ksgScript/Befehl/KSGSFunktion.cpp

@@ -10,7 +10,7 @@ using namespace KSGScript;
 
 // Inhalt der KSGSFunktionInstanz Klasse aus KSGSFunktion.h
 // Konstruktor
-KSGSFunktionInstanz::KSGSFunktionInstanz( RCArray< KSGSBefehl > *ba, int rt, KSGScriptObj *obj, KSGSVariable *klasse )
+KSGSFunktionInstanz::KSGSFunktionInstanz( RCArray< KSGSBefehl > *ba, int rt, KSGScriptProcessor *obj, KSGSVariable *klasse )
     : Thread()
 {
     lokaleVariablen = new RCArray< KSGSVariable >();
@@ -53,7 +53,7 @@ void KSGSFunktionInstanz::unlock()
 }
 
 // nicht constant
-void KSGSFunktionInstanz::setParameter( Array< KSGSVariableDef* > *zDef, RCArray< KSGSVariable > *vars )
+void KSGSFunktionInstanz::setParameter( Array< KSGSVariableDef * > *zDef, RCArray< KSGSVariable > *vars )
 {
     int anz = zDef->getEintragAnzahl();
     for( int i = 0; i < anz; i++ )
@@ -119,21 +119,21 @@ KSGSVariable *KSGSFunktionInstanz::startFunktion()
     if( run )
         return 0;
     if( threadVar )
-        threadVar = (KSGSThreadKlasse*)threadVar->release();
+        threadVar = (KSGSThreadKlasse *)threadVar->release();
     if( retVar )
-        retVar = retVar->release();
+        retVar = (KSGSVariable *)retVar->release();
     if( returnTyp == KSGS_THREAD )
     {
-        threadVar = new KSGSThreadKlasse( obj, (KSGSFunktionInstanz*)getThis() );
+        threadVar = new KSGSThreadKlasse( obj, (KSGSFunktionInstanz *)getThis() );
         start();
-        return threadVar->getThis();
+        return (KSGSVariable *)threadVar->getThis();
     }
     else
     {
         run = 1;
         thread();
         warteAufFunktion( INFINITE );
-        return retVar ? retVar->getThis() : 0;
+        return retVar ? (KSGSVariable *)retVar->getThis() : 0;
     }
 }
 
@@ -159,7 +159,7 @@ void KSGSFunktionInstanz::thread()
     if( threadVar )
     {
         threadVar->threadEnde();
-        threadVar = (KSGSThreadKlasse*)threadVar->release();
+        threadVar = (KSGSThreadKlasse *)threadVar->release();
     }
     release();
 }
@@ -219,13 +219,13 @@ bool KSGSFunktionInstanz::wirdAusgef
 // Inhalt der KSGSFunktion Klasse aus KSGSFunktion.h
 // Konstruktor
 KSGSFunktion::KSGSFunktion( int id, int sichtbar, int typ )
-    : typId( typ ),
+    : ReferenceCounter(),
+    typId( typ ),
     sichtbar( sichtbar ),
-    id( id ),
-    ref( 1 )
+    id( id )
 {
     befehle = new RCArray< KSGSBefehl >();
-    parameter = new Array< KSGSVariableDef* >();
+    parameter = new Array< KSGSVariableDef * >();
     name = "";
 }
 
@@ -257,9 +257,9 @@ void KSGSFunktion::addBefehl( KSGSBefehl *befehl )
     befehle->add( befehl );
 }
 
-KSGSFunktionInstanz *KSGSFunktion::erstellInstanz( KSGScriptObj *obj, KSGSVariable *klasse, RCArray< KSGSVariable > *params )
+KSGSFunktionInstanz *KSGSFunktion::erstellInstanz( KSGScriptProcessor *obj, KSGSVariable *klasse, RCArray< KSGSVariable > *params )
 {
-    KSGSFunktionInstanz *inst = new KSGSFunktionInstanz( befehle->getThis(), typId, obj, klasse );
+    KSGSFunktionInstanz *inst = new KSGSFunktionInstanz( ( RCArray< KSGSBefehl >* )befehle->getThis(), typId, obj, klasse );
     if( params )
         inst->setParameter( parameter, params );
     return inst;
@@ -284,19 +284,4 @@ int KSGSFunktion::getSichtbarkeit() const
 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;
 }

+ 69 - 73
ksgScript/Befehl/KSGSFunktion.h

@@ -7,88 +7,84 @@
 
 namespace KSGScript
 {
-	class KSGScriptObj; // ../Main/KSGScript.h
-	class KSGSKlasseInstanz; // KSGSKlasse.h
-	class KSGSThreadKlasse; // ../Klassen/KSGSThread.h
+    class KSGScriptObj; // ../Main/KSGScript.h
+    class KSGSKlasseInstanz; // KSGSKlasse.h
+    class KSGSThreadKlasse; // ../Klassen/KSGSThread.h
     class KSGSVariable;
     struct KSGSVariableDef;
 
-	class KSGSFunktionInstanz : public Thread
-	{
-	protected:
-		RCArray< KSGSVariable > *lokaleVariablen;
-		RCArray< KSGSBefehl > *befehle;
+    class KSGSFunktionInstanz : public Thread
+    {
+    protected:
+        RCArray< KSGSVariable > *lokaleVariablen;
+        RCArray< KSGSBefehl > *befehle;
         KSGSVariable *klasse;
-		KSGScriptObj *obj;
-		KSGSThreadKlasse *threadVar;
-		int returnTyp;
+        KSGScriptProcessor *obj;
+        KSGSThreadKlasse *threadVar;
+        int returnTyp;
 
-		KSGSVariable *retVar;
-		Critical cs;
-		bool pausiert;
-		bool beendet;
-		bool continueB;
-		bool breakB;
-		int scrId;
+        KSGSVariable *retVar;
+        Critical cs;
+        bool pausiert;
+        bool beendet;
+        bool continueB;
+        bool breakB;
+        int scrId;
 
-		// privat
-		__declspec( dllexport ) virtual void lock();
-		__declspec( dllexport ) virtual void unlock();
+        // privat
+        __declspec( dllexport ) virtual void lock();
+        __declspec( dllexport ) virtual void unlock();
 
-	public:
-		// Konstruktor
-		__declspec( dllexport ) KSGSFunktionInstanz( RCArray< KSGSBefehl > *ba, int rt, KSGScriptObj *obj, KSGSVariable *klasse );
-		// Destruktor
-		__declspec( dllexport ) virtual ~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;
-	};
+    public:
+        // Konstruktor
+        __declspec( dllexport ) KSGSFunktionInstanz( RCArray< KSGSBefehl > *ba, int rt, KSGScriptProcessor *obj, KSGSVariable *klasse );
+        // Destruktor
+        __declspec( dllexport ) virtual ~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;
+    };
 
-	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;
+    class KSGSFunktion : public virtual ReferenceCounter
+    {
+    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;
 
-	public:
-		// Konstruktor
-		__declspec( dllexport ) KSGSFunktion( int id, int sichtbar, int typ );
-		// Destruktor
-		__declspec( dllexport ) virtual ~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, KSGSVariable *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();
-	};
+    public:
+        // Konstruktor
+        __declspec( dllexport ) KSGSFunktion( int id, int sichtbar, int typ );
+        // Destruktor
+        __declspec( dllexport ) virtual ~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( KSGScriptProcessor *obj, KSGSVariable *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;
+    };
 }
 
 #endif

+ 323 - 354
ksgScript/Befehl/KSGSKlasse.cpp

@@ -21,482 +21,451 @@ 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 = dynamic_cast<KSGScriptO *>( 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( KSGSKlasseInstanz::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;
+KSGSKlasseInstanz::KSGSKlasseInstanz( int typ, Array< KSGSVariableDef * > *zVars, RCArray< KSGSFunktion > *funcs, KSGScriptProcessor *zObj )
+    : ReferenceCounter()
+{
+    lokaleVariablen = new RCArray< KSGSVariable >();
+    varPublic = new Array< bool >();
+    funktionen = funcs;
+    obj = zObj;
+    lokaleVariablen->add( (KSGSKlasseInstanz *)getThis(), 0 );
+    varPublic->set( 0, 0 );
+    int anz = zVars ? zVars->getEintragAnzahl() : 0;
+    for( int i = 0; i < anz; i++ )
+    {
+        lokaleVariablen->set( KSGSKlasseInstanz::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;
 }
 
 // Destruktor
 KSGSKlasseInstanz::~KSGSKlasseInstanz()
 {
-	lokaleVariablen->release();
-	if( funktionen )
-		funktionen->release();
-	varPublic->release();
-	obj->release();
+    lokaleVariablen->release();
+    if( funktionen )
+        funktionen->release();
+    varPublic->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( dynamic_cast<KSGScriptO *>( obj->getThis() ), (KSGSKlasseInstanz*)getThis(), parameter );
-	KSGSVariable *ret = inst->startFunktion();
-	inst->release();
-	return ret;
+    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, (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;
+    error( 21, {}, obj );
+    if( rechts )
+        rechts->release();
+    return 0;
 }
 
 void KSGSKlasseInstanz::setVariable( int id, KSGSVariable *var )
 {
-	lokaleVariablen->set( var, id );
+    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 );
+    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;
+    error( 16, {}, obj );
+    return 0;
 }
 
 int KSGSKlasseInstanz::getTyp() const
 {
-	return typ;
+    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;
-	}
+    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;
-	}
+    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;
-	}
+    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( "" );
-	}
+    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();
-	}
+    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, 1, 0, 0 };
-	}
+    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, 1, 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 };
-	}
+    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();
-	}
+    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();
-	}
+    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();
-	}
+    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();
-	}
+    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();
-	}
+    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();
-	}
+    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;
+    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;
+    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 >();
+    }
 }
 
 // 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;
+KSGSVariable *KSGSKlasseInstanz::erstellVariable( KSGScriptProcessor *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 )
+    : ReferenceCounter()
 {
-	var = new Array< KSGSVariableDef* >();
-	funktionen = new RCArray< KSGSFunktion >();
-	this->id = id;
-	ref = 1;
+    var = new Array< KSGSVariableDef * >();
+    funktionen = new RCArray< KSGSFunktion >();
+    this->id = id;
 }
 
 // Destruktor
 KSGSKlasse::~KSGSKlasse()
 {
-	int anz = var->getEintragAnzahl();
-	for( int i = 0; i < anz; i++ )
-		delete var->get( i );
-	var->release();
-	funktionen->release();
+    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 );
+    this->var->add( var );
 }
 
 void KSGSKlasse::addFunktion( KSGSFunktion *func )
 {
-	funktionen->add( func );
+    funktionen->add( func );
 }
 
-KSGSKlasseInstanz *KSGSKlasse::erstellInstanz( KSGScriptObj *zObj )
+KSGSKlasseInstanz *KSGSKlasse::erstellInstanz( KSGScriptProcessor *zObj )
 {
-	return new KSGSKlasseInstanz( id, var, funktionen->getThis(), zObj );
+    return new KSGSKlasseInstanz( id, var, ( RCArray<KSGSFunktion>* )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;
+    return id;
 }

+ 58 - 66
ksgScript/Befehl/KSGSKlasse.h

@@ -10,77 +10,69 @@
 
 namespace KSGScript
 {
-	class KSGSKlasse; // aus dieser Datei
+    class KSGSKlasse; // aus dieser Datei
 
-	class KSGSKlasseInstanz : public KSGSVariable
-	{
-	protected:
-		RCArray< KSGSVariable > *lokaleVariablen;
-		RCArray< KSGSFunktion > *funktionen;
-		Array< bool > *varPublic;
-		KSGScriptObj *obj;
-		int typ;
-		int ref;
+    class KSGSKlasseInstanz : public KSGSVariable
+    {
+    protected:
+        RCArray< KSGSVariable > *lokaleVariablen;
+        RCArray< KSGSFunktion > *funktionen;
+        Array< bool > *varPublic;
+        KSGScriptProcessor *obj;
+        int typ;
 
-	public:
-		// Konstruktor
-		KSGSKlasseInstanz( int typ, Array< KSGSVariableDef* > *zVars, RCArray< KSGSFunktion > *funcs, KSGScriptObj *zObj );
-		// Destruktor
-		virtual ~KSGSKlasseInstanz();
-		// nicht constant
-		virtual KSGSVariable *startFunktion( int id, bool zugriff, RCArray< KSGSVariable > *parameter ) override;
-		virtual KSGSVariable *doOperator( int id, KSGSVariable *rechts ) override;
-		virtual void setVariable( int id, KSGSVariable *var ) override;
-		// constant
-		virtual KSGSVariable *getVariable( int id, bool zugriff ) const override;
-		virtual KSGSVariable *umwandelnIn( int typ ) const override;
-		virtual int getTyp() const override;
-		// verarbeiten
-		virtual bool getBool() const override;
-		virtual int getInt() const override;
-		virtual double getDouble() const override;
-		virtual Text *getText() const override;
-		virtual Bild *getBild() const override;
-		virtual MausEreignis getMausEreignis() const override;
-		virtual TastaturEreignis getTastaturEreignis() const override;
-		virtual TextFeld *getTextFeld() const override;
-		virtual Knopf *getKnopf() const override;
-		virtual Fenster *getFenster() const override;
-		virtual BildZ *getBildZ() const override;
-		virtual Animation2DData *getAnimation2DData() const override;
-		virtual Animation2D *getAnimation2D() const override;
-		virtual Zeichnung *getZeichnung() const override;
+    public:
+        // Konstruktor
+        KSGSKlasseInstanz( int typ, Array< KSGSVariableDef * > *zVars, RCArray< KSGSFunktion > *funcs, KSGScriptProcessor *zObj );
+        // Destruktor
+        virtual ~KSGSKlasseInstanz();
+        // nicht constant
+        virtual KSGSVariable *startFunktion( int id, bool zugriff, RCArray< KSGSVariable > *parameter ) override;
+        virtual KSGSVariable *doOperator( int id, KSGSVariable *rechts ) override;
+        virtual void setVariable( int id, KSGSVariable *var ) override;
+        // constant
+        virtual KSGSVariable *getVariable( int id, bool zugriff ) const override;
+        virtual KSGSVariable *umwandelnIn( int typ ) const override;
+        virtual int getTyp() const override;
+        // verarbeiten
+        virtual bool getBool() const override;
+        virtual int getInt() const override;
+        virtual double getDouble() const override;
+        virtual Text *getText() const override;
+        virtual Bild *getBild() const override;
+        virtual MausEreignis getMausEreignis() const override;
+        virtual TastaturEreignis getTastaturEreignis() const override;
+        virtual TextFeld *getTextFeld() const override;
+        virtual Knopf *getKnopf() const override;
+        virtual Fenster *getFenster() const override;
+        virtual BildZ *getBildZ() const override;
+        virtual Animation2DData *getAnimation2DData() const override;
+        virtual Animation2D *getAnimation2D() const override;
+        virtual Zeichnung *getZeichnung() const override;
         virtual RCArray< KSGSVariable > *getArray() const override;
-		// Reference Counting
-		virtual KSGSVariable *getThis() override;
-		virtual KSGSVariable *release() override;
-		// static
-		static KSGSVariable *erstellVariable( KSGScriptObj *zObj, KSGSVariableDef *def );
-	};
+        // static
+        static KSGSVariable *erstellVariable( KSGScriptProcessor *zObj, KSGSVariableDef *def );
+    };
 
-	class KSGSKlasse
-	{
-	private:
-		Array< KSGSVariableDef* > *var;
-		RCArray< KSGSFunktion > *funktionen;
-		int id;
-		int ref;
+    class KSGSKlasse : public virtual ReferenceCounter
+    {
+    private:
+        Array< KSGSVariableDef * > *var;
+        RCArray< KSGSFunktion > *funktionen;
+        int id;
 
-	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();
-	};
+    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( KSGScriptProcessor *zObj );
+        // constant
+        __declspec( dllexport ) int getId() const;
+    };
 }
 
 #endif

+ 11 - 26
ksgScript/Editor/Editor.cpp

@@ -56,7 +56,7 @@ void Editor::doMausEreignis( MausEreignis &me, bool userRet )
         if( rahmen )
             rbr = rahmen->getRBreite();
         if( ( ( vertikalScrollBar && hatStyle( Style::VScroll ) ) ||
-            ( horizontalScrollBar && hatStyle( Style::HScroll ) ) ) &&
+              ( horizontalScrollBar && hatStyle( Style::HScroll ) ) ) &&
             me.mx > rbr && me.mx < gr.x - rbr &&
             me.my > rbr && me.my < gr.y - rbr )
         {
@@ -248,7 +248,7 @@ void Editor::updateVScroll( int pos )
 
 // Setzt die zu verwendende Schrift
 //  s: Die Schrift
-void Editor::setSchriftZ( Schrift * s )
+void Editor::setSchriftZ( Schrift *s )
 {
     if( !textRd )
         textRd = new TextRenderer( s );
@@ -258,7 +258,7 @@ void Editor::setSchriftZ( Schrift * s )
 
 // Setzt den zu verwendenden Text Renderer
 //  t: Der Text Renderer
-void Editor::setTextRendererZ( TextRenderer * t )
+void Editor::setTextRendererZ( TextRenderer *t )
 {
     if( textRd )
         textRd->release();
@@ -267,7 +267,7 @@ void Editor::setTextRendererZ( TextRenderer * t )
 
 // Setzt den Text (das Script was verändert werden soll)
 //  txt: Der Text
-void Editor::setText( Text * txt )
+void Editor::setText( Text *txt )
 {
     lockZeichnung();
     if( script )
@@ -283,7 +283,7 @@ void Editor::setText( Text * txt )
 }
 
 // Gibt den aktuellen Text zurück
-Text * Editor::zText() const
+Text *Editor::zText() const
 {
     return script;
 }
@@ -316,21 +316,19 @@ bool Editor::getWarningDetection() const
 
 // Verarbeitet ein Tastatur Ereignis. Wird vom Framework automatisch aufgerufen
 //  te: Das Ereignis
-void Editor::doTastaturEreignis( TastaturEreignis & te )
+void Editor::doTastaturEreignis( TastaturEreignis &te )
 {
     bool ntakc = !te.verarbeitet;
     if( te.verarbeitet || hatStyleNicht( Style::Fokus ) )
         return;
     if( !tak )
         return;
-    ++ref;
+    getThis();
     if( tak( takParam, this, te ) )
     {
         if( hatStyleNicht( Style::Erlaubt ) )
         {
-            --ref;
-            if( !ref )
-                delete this;
+            release();
             return;
         }
         if( te.id == TE_Press )
@@ -510,11 +508,9 @@ void Editor::doTastaturEreignis( TastaturEreignis & te )
         reloadCounter = (int)( zm.getSekunden() * 100 );
     }
     unlockZeichnung();
-    --ref;
     if( ntakc && te.verarbeitet && nTak )
         te.verarbeitet = nTak( ntakParam, this, te );
-    if( !ref )
-        delete this;
+    release();
 }
 
 // Updated den Editor
@@ -547,7 +543,7 @@ bool Editor::tick( double tickval )
 }
 
 // Zeichnet den Editor nach rObj
-void Editor::render( Bild & rObj )
+void Editor::render( Bild &rObj )
 {
     if( hatStyleNicht( Style::Sichtbar ) )
         return;
@@ -574,7 +570,7 @@ void Editor::render( Bild & rObj )
     if( hs )
         xxx -= horizontalScrollBar->getScroll();
     parser->reset();
-    auto colorF = [ this, &rObj ]( int x, int y, int pos ) -> int
+    auto colorF = [this, &rObj]( int x, int y, int pos ) -> int
     {
         if( !parser )
             return colors[ KSGScriptEditor::ColorType::NORMAL_TEXT ];
@@ -610,15 +606,4 @@ void Editor::setTextColor( int color, ColorType cType )
 {
     if( cType >= 0 && cType < ColorType::COLOR_ANZAHL )
         colors[ cType ] = color;
-}
-
-// Reference Counting
-Zeichnung *Editor::getThis()
-{
-    return ZeichnungHintergrund::getThis();
-}
-
-Zeichnung *Editor::release()
-{
-    return ZeichnungHintergrund::release();
 }

+ 0 - 3
ksgScript/Editor/Editor.h

@@ -75,8 +75,5 @@ namespace KSGScript
         //  color: Die Farbe in 0xAARRGGBB Format
         //  cType: Der Codetyp, der die Farbe bekommen soll
         void setTextColor( int color, ColorType cType ) override;
-        // Reference Counting
-        Zeichnung *getThis() override;
-        Zeichnung *release() override;
     };
 }

+ 9 - 9
ksgScript/Editor/Parser/ColorParser.cpp

@@ -2,7 +2,7 @@
 
 using namespace KSGScript;
 
-const char *(ColorParser::keyword[]) = { "lesen", "var", "func", "Rückruf", "class", "public", "private", "if", "else", "return", "break", "continue", "for", "while" };
+const char *( ColorParser::keyword[] ) = { "lesen", "var", "func", "Rückruf", "class", "public", "private", "if", "else", "return", "break", "continue", "for", "while" };
 const int ColorParser::keywordAnz = 14;
 const char *( ColorParser::type[] ) = { "void", "bool", "int", "double", "Array", "Thread", "Text", "Bild", "MausEreignis", "TastaturEreignis", "TextFeld", "Knopf", "Fenster", "BildZ", "Animation2DData", "Animation2D" };
 const int ColorParser::typeAnz = 16;
@@ -10,9 +10,9 @@ const int ColorParser::typeAnz = 16;
 // Konstructor
 //  zTxt: Der Text, der geparsed werden soll
 ColorParser::ColorParser( Text *zTxt )
+    : KSGSLeser()
 {
-    pfad = new Text( "" );
-    txt = zTxt->getThis();
+    txt = (Text *)zTxt->getThis();
     reset();
     reload();
 }
@@ -82,7 +82,7 @@ void ColorParser::reload()
     abschnitt.leeren();
     delete dat;
     dat = new KSGSLeseScript();
-    d = new TextReader( txt->getThis() );
+    d = new TextReader( (Text *)txt->getThis() );
     zeile = 1;
     while( !d->istEnde() )
     {
@@ -172,20 +172,20 @@ void ColorParser::reload()
                     break;
                 }
                 d->setLPosition( d->getLPosition() + 1, 0 );
-                Text *pf = new Text( pfad->getText() );
-                pfad->setText( dPf );
+                Text *pf = new Text( fileName );
+                fileName.setText( dPf );
                 Reader *tmp = d;
                 if( !ladeDatei() )
                 {
                     handleError( (int)d->getLPosition() - 1, (int)d->getLPosition() );
                     d = tmp;
-                    pfad->setText( pf );
+                    fileName.setText( pf );
                     //error( 6, { "Lade Anweisung", *pfad }, zObj );
                     br = 1;
                     break;
                 }
                 d = tmp;
-                pfad->setText( pf );
+                fileName.setText( pf );
             }
             break;
         default: // Fehler
@@ -202,7 +202,7 @@ void ColorParser::reload()
             break;
         }
     }
-    d = ( (TextReader*)d )->release();
+    d = (Reader *)( (TextReader *)d )->release();
 }
 
 KSGSLeseKlasse *ColorParser::leseKlasse()

+ 4 - 3
ksgScript/Error/Error.cpp

@@ -1,10 +1,11 @@
 #include "Error.h"
-#include "../Main/KSGScriptObj.h"
+#include "../Include/KSGScript.h"
 #include <iostream>
+#include <Text.h>
 
-void KSGScript::error( int num, std::initializer_list< char* > msg, KSGScript::KSGScriptObj *zObj )
+void KSGScript::error( int num, std::initializer_list< char* > msg, KSGScript::KSGScriptProcessor *zObj )
 {
-    Text logMsg;
+    Framework::Text logMsg;
  	switch( num )
 	{
 	case 0:

+ 2 - 2
ksgScript/Error/Error.h

@@ -2,7 +2,7 @@
 
 namespace KSGScript
 {
-    class KSGScriptObj; // KSGScriptO.h
+    class KSGScriptProcessor; // KSGScriptO.h
 
 #define KSGS_WARNING_CreateVar 0
 #define KSGS_WARNING_CreateVarTyp 1
@@ -28,5 +28,5 @@ namespace KSGScript
 #define KSGS_WARNING_OperatorUndefined 21
 #define KSGS_WARNING_WrongExecutionOfOrder 22
 
-	__declspec( dllexport ) void error( int num, std::initializer_list< char* > msg, KSGScript::KSGScriptObj *zObj );
+	__declspec( dllexport ) void error( int num, std::initializer_list< char* > msg, KSGScript::KSGScriptProcessor *zObj );
 }

+ 15 - 16
ksgScript/Funktionen/KSGSRückruf.cpp

@@ -8,44 +8,43 @@ 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 )
+    : KSGSFunktionInstanz( new RCArray< KSGSBefehl >(), KSGS_VOID, obj, 0 )
 {
-	parameter = 0;
+    parameter = 0;
 }
 
 // Destruktor
 KSGSRückrufInstanz::~KSGSRückrufInstanz()
 {
-	if( parameter )
-		parameter->release();
+    if( parameter )
+        parameter->release();
 }
 
 // nicht constant
-void KSGSRückrufInstanz::setParameter( Array< KSGSVariableDef* > *zDef, RCArray< KSGSVariable > *vars )
+void KSGSRückrufInstanz::setParameter( Array< KSGSVariableDef * > *zDef, RCArray< KSGSVariable > *vars )
 {
-	if( parameter )
-		parameter->release();
-	parameter = vars;
+    if( parameter )
+        parameter->release();
+    parameter = vars;
 }
 
 KSGSVariable *KSGSRückrufInstanz::startFunktion()
 {
-	return obj->rückruf( parameter ? parameter->getThis() : new RCArray< KSGSVariable >() );
+    return obj->rückruf( parameter ? ( RCArray< KSGSVariable >* )parameter->getThis() : new RCArray< KSGSVariable >() );
 }
 
 
 // Inhalt der KSGSRückrufFunktion Klasse aus KSGSRückruf.h
 // Konstruktor
 KSGSRückrufFunktion::KSGSRückrufFunktion()
-	: KSGSFunktion( 0, 0, KSGS_VOID )
-{
-}
+    : KSGSFunktion( 0, 0, KSGS_VOID )
+{}
 
 // nicht constant
 KSGSFunktionInstanz *KSGSRückrufFunktion::erstellInstanz( KSGScriptObj *obj, KSGSVariable *klasse, RCArray< KSGSVariable > *params )
 {
-	KSGSRückrufInstanz *inst = new KSGSRückrufInstanz( obj );
-	if( params )
-		inst->setParameter( 0, params );
-	return inst;
+    KSGSRückrufInstanz *inst = new KSGSRückrufInstanz( obj );
+    if( params )
+        inst->setParameter( 0, params );
+    return inst;
 }

+ 103 - 93
ksgScript/Include/KSGScript.h

@@ -5,18 +5,19 @@
 #include <Zeichnung.h>
 #include "../Klassen/KSGSTyp.h"
 #include <Schrift.h>
+#include <ReferenceCounter.h>
 
 namespace Framework
 {
-	class Bild;
-	class TextFeld;
-	class Knopf;
-	class Fenster;
-	class BildZ;
-	class Animation2DData;
-	class Animation2D;
-	class Schrift;
-	class Text;
+    class Bild;
+    class TextFeld;
+    class Knopf;
+    class Fenster;
+    class BildZ;
+    class Animation2DData;
+    class Animation2D;
+    class Schrift;
+    class Text;
     class TextFeld;
     class TextRenderer;
 }
@@ -31,89 +32,100 @@ namespace KSGScript
         Framework::Text wert;
     };
 
-	/*
-	* Vordefinition der KSGS Variable Klasse.
-	* Virtuelle Vordefinition der Klasse KSGSKlasseInstanz aus ../Befehl/KSGSKlasse.h
-	*/
+    /*
+    * 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;
+    class KSGSVariable : public virtual Framework::ReferenceCounter
+    {
+    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;
         virtual Framework::RCArray< KSGSVariable > *getArray() const = 0;
-		// Reference Counting
-		virtual KSGSVariable *getThis() = 0;
-		virtual KSGSVariable *release() = 0;
-	};
+    };
+
+    class KSGScriptProcessor : public virtual Framework::ReferenceCounter
+    {
+    public:
+        virtual void logNachricht( char *n ) = 0;
+        virtual Framework::Text *convertPfad( char *pf ) = 0;
+        virtual void setVariable( int id, KSGSVariable *var ) = 0;
+        virtual KSGSVariable *startFunktion( int id, Framework::RCArray< KSGSVariable > *parameter ) = 0;
+        virtual KSGSVariable *erstellKlassenInstanz( int id ) = 0;
+        virtual KSGSVariable *getVariable( int id ) const = 0;
+        virtual int getScriptId() const = 0;
+        virtual Framework::Bildschirm *zBildschirm() const = 0;
+        virtual Framework::Schrift *zSchrift() const = 0;
+        virtual int getFunktionId( const char *name ) const = 0;
+        virtual bool istBeendet( int scrId ) const = 0;
+        virtual KSGSVariable *rückruf( Framework::RCArray< KSGSVariable > *parameter ) const = 0;
+    };
 
+    /*
+    * Vordefinierte KSGS Expression Evaluator Klasse
+    */
 
-	/*
-	* Vordefinition der KSGS Zeichnung Klasse.
-	* Virtuelle Vordefinition der Klasse KSGScriptObj aus ../Main/KSGScriptObj.h
-	*/
+    class KSGSExpressionEvaluator : public KSGScriptProcessor
+    {
+    public:
+        virtual KSGSVariable *createParameter( Framework::Text name, int type ) = 0;
+        virtual KSGSVariable *getParameter( Framework::Text name ) = 0;
+        virtual void setExpression( Framework::Text expression ) = 0;
+        virtual KSGSVariable *evaluate() = 0;
+    };
 
-	class KSGScriptObj : virtual public Framework::Zeichnung
-	{
-	public:
-		// nicht constant
-		virtual void lock() = 0;
-		virtual void unlock() = 0;
-		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 doPublicMausEreignis( 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;
+    /*
+    * Vordefinition der KSGS Zeichnung Klasse.
+    * Virtuelle Vordefinition der Klasse KSGScriptObj aus ../Main/KSGScriptObj.h
+    */
+
+    class KSGScriptObj : virtual public Framework::Zeichnung, public KSGScriptProcessor
+    {
+    public:
+        // nicht constant
+        virtual void lock() = 0;
+        virtual void unlock() = 0;
+        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 doPublicMausEreignis( 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 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 Zeichnung *getThis() = 0;
-		virtual Zeichnung *release() = 0;
-	};
+        // constant
+        virtual Framework::Text *getScriptDateiPfad() const = 0;
+        virtual Framework::Text *zScriptDateiPfad() const = 0;
+        virtual Framework::Schrift *getSchrift() const = 0;
+        virtual Framework::Bildschirm *getBildschirm() const = 0;;
+    };
 
     // Ein Textfeld, das eine Entwicklungsumgebung für die KSG-Script Sprache darstellt
     class KSGScriptEditor : virtual public Framework::ZeichnungHintergrund
@@ -156,15 +168,13 @@ namespace KSGScript
         //  color: Die Farbe in 0xAARRGGBB Format
         //  cType: Der Codetyp, der die Farbe bekommen soll
         virtual void setTextColor( int color, ColorType cType ) = 0;
-        // Reference Counting
-        virtual Zeichnung *getThis() = 0;
-        virtual Zeichnung *release() = 0;
     };
-	// DLL Einstieg
+    // DLL Einstieg
     typedef KSGScriptEditor *( *KSGSGetEditor )( );
-	typedef KSGScriptObj *( *KSGSGetZeichnung )( );
-	typedef KSGSVariable *( *KSGSGetVariable )( KSGScriptObj *zObj, KSGSVariableDef *def );
-	typedef void ( *KSGSSetBild )( KSGSVariable *zBv, Framework::Bild *b );
+    typedef KSGScriptObj *( *KSGSGetZeichnung )( );
+    typedef KSGSVariable *( *KSGSGetVariable )( KSGScriptObj *zObj, KSGSVariableDef *def );
+    typedef KSGSExpressionEvaluator *( *KSGSGetExpressionEvaluator )( );
+    typedef void ( *KSGSSetBild )( KSGSVariable *zBv, Framework::Bild *b );
 }
 #define KSGS_START_FUNKTION "GetNewKSGScriptObj"
 #define KSGS_EDITOR_FUNKTION "GetNewKSGEditorObj"

+ 3 - 3
ksgScript/Klassen/KSGSAnimation2D.cpp

@@ -13,7 +13,7 @@ using namespace KSGScript;
 
 // Inhalt der KSGSAnimation2DKlasse aus KSGSAnimaion2D
 // Konstruktor
-KSGSAnimation2DKlasse::KSGSAnimation2DKlasse( KSGScriptObj *zObj, Animation2D *std )
+KSGSAnimation2DKlasse::KSGSAnimation2DKlasse( KSGScriptProcessor *zObj, Animation2D *std )
     : KSGSKlasseInstanz( KSGS_ANIMATION2D, 0, 0, zObj )
 {
     val = std;
@@ -164,7 +164,7 @@ KSGSVariable *KSGSAnimation2DKlasse::doOperator( int id, KSGSVariable *rechts )
         {
             val->release();
             val = rechts->getAnimation2D();
-            ret = getThis();
+            ret = (KSGSVariable *)getThis();
         }
         break;
     }
@@ -178,7 +178,7 @@ KSGSVariable *KSGSAnimation2DKlasse::doOperator( int id, KSGSVariable *rechts )
 // constant
 Animation2D *KSGSAnimation2DKlasse::getVal() const
 {
-    return (Animation2D*)val->getThis();
+    return (Animation2D *)val->getThis();
 }
 
 Animation2D *KSGSAnimation2DKlasse::zVal() const

+ 16 - 16
ksgScript/Klassen/KSGSAnimation2D.h

@@ -7,23 +7,23 @@
 
 namespace KSGScript
 {
-	class KSGSAnimation2DKlasse : public KSGSKlasseInstanz
-	{
-	private:
-		Animation2D *val;
+    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;
-	};
+    public:
+        // Konstruktor
+        __declspec( dllexport ) KSGSAnimation2DKlasse( KSGScriptProcessor *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;
+    };
 }
 
 #endif

+ 99 - 99
ksgScript/Klassen/KSGSAnimation2DData.cpp

@@ -12,127 +12,127 @@ using namespace KSGScript;
 
 // Inhalt der KSGSAnimation2DDataKlasse Klasse aus KSGSAnimation2DData.h
 // Konstruktor
-KSGSAnimation2DDataKlasse::KSGSAnimation2DDataKlasse( KSGScriptObj *zObj, Animation2DData *std )
-	: KSGSKlasseInstanz( KSGS_ANIMATION2DDATA, 0, 0, zObj )
+KSGSAnimation2DDataKlasse::KSGSAnimation2DDataKlasse( KSGScriptProcessor *zObj, Animation2DData *std )
+    : KSGSKlasseInstanz( KSGS_ANIMATION2DDATA, 0, 0, zObj )
 {
-	val = std;
+    val = std;
 }
 
 // Destruktor
 KSGSAnimation2DDataKlasse::~KSGSAnimation2DDataKlasse()
 {
-	val->release();
+    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 *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;
+    if( !rechts )
+    {
+        error( 3, {}, obj );
+        return 0;
+    }
+    KSGSVariable *ret = 0;
+    switch( id )
+    {
+    case KSGS_O_SET:
+        if( 1 )
+        {
+            val->release();
+            val = rechts->getAnimation2DData();
+            ret = (KSGSVariable *)getThis();
+        }
+        break;
+    }
+    if( !ret )
+        error( 21, {}, obj );
+    if( rechts )
+        rechts->release();
+    return ret;
 }
 
 // constant
 Animation2DData *KSGSAnimation2DDataKlasse::getVal() const
 {
-	return val->getThis();
+    return (Animation2DData *)val->getThis();
 }
 
 Animation2DData *KSGSAnimation2DDataKlasse::zVal() const
 {
-	return val;
+    return val;
 }

+ 16 - 16
ksgScript/Klassen/KSGSAnimation2DData.h

@@ -6,23 +6,23 @@
 
 namespace KSGScript
 {
-	class KSGSAnimation2DDataKlasse : public KSGSKlasseInstanz
-	{
-	private:
-		Animation2DData *val;
+    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;
-	};
+    public:
+        // Konstruktor
+        __declspec( dllexport ) KSGSAnimation2DDataKlasse( KSGScriptProcessor *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;
+    };
 }
 
 #endif

+ 86 - 86
ksgScript/Klassen/KSGSArray.cpp

@@ -9,114 +9,114 @@ using namespace KSGScript;
 
 // Inhalt der KSGSArrayKlasse Klasse aus KSGSArray.h
 // Konstruktor
-KSGSArrayKlasse::KSGSArrayKlasse( KSGScriptObj *zObj, RCArray< KSGSVariable > *std )
-	: KSGSKlasseInstanz( KSGS_ARRAY, 0, 0, zObj )
+KSGSArrayKlasse::KSGSArrayKlasse( KSGScriptProcessor *zObj, RCArray< KSGSVariable > *std )
+    : KSGSKlasseInstanz( KSGS_ARRAY, 0, 0, zObj )
 {
-	val = std;
+    val = std;
 }
 
 // Destruktor
 KSGSArrayKlasse::~KSGSArrayKlasse()
 {
-	val->release();
+    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 *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;
+    if( !rechts )
+    {
+        error( 3, {}, obj );
+        return 0;
+    }
+    KSGSVariable *ret = 0;
+    switch( id )
+    {
+    case KSGS_O_SET:
+        if( 1 )
+        {
+            val->release();
+            val = rechts->getArray();
+            ret = (KSGSVariable *)getThis();
+        }
+        break;
+    }
+    if( !ret )
+        error( 21, {}, obj );
+    rechts->release();
+    return ret;
 }
 
 // constant
 RCArray< KSGSVariable > *KSGSArrayKlasse::getVal() const
 {
-	return val->getThis();
+    return ( RCArray< KSGSVariable > * )val->getThis();
 }
 
 RCArray< KSGSVariable > *KSGSArrayKlasse::zVal() const
 {
-	return val;
+    return val;
 }

+ 16 - 16
ksgScript/Klassen/KSGSArray.h

@@ -6,23 +6,23 @@
 
 namespace KSGScript
 {
-	class KSGSArrayKlasse : public KSGSKlasseInstanz
-	{
-	private:
-		RCArray< KSGSVariable > *val;
+    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;
-	};
+    public:
+        // Konstruktor
+        __declspec( dllexport ) KSGSArrayKlasse( KSGScriptProcessor *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;
+    };
 }
 
 #endif

+ 275 - 275
ksgScript/Klassen/KSGSBild.cpp

@@ -9,49 +9,49 @@ using namespace KSGScript;
 
 // Inhalt der KSGSBildKlasse Klasse aus KSGSBild.h
 // Konstruktor
-KSGSBildKlasse::KSGSBildKlasse( KSGScriptObj *zObj, Bild *std )
-	: KSGSKlasseInstanz( KSGS_BILD, 0, 0, zObj )
+KSGSBildKlasse::KSGSBildKlasse( KSGScriptProcessor *zObj, Bild *std )
+    : KSGSKlasseInstanz( KSGS_BILD, 0, 0, zObj )
 {
-	val = std;
+    val = std;
 }
 
 // Destruktor
 KSGSBildKlasse::~KSGSBildKlasse()
 {
-	val->release();
+    val->release();
 }
 
 // nicht constant
 void KSGSBildKlasse::set( Bild *b )
 {
-	if( val )
-		val->release();
-	val = 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 );
+    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 );
         if( val->hasAlpha3D() )
         {
             val->alphaPixelDP3D( parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0,
@@ -64,264 +64,264 @@ KSGSVariable *KSGSBildKlasse::startFunktion( int id, bool access, RCArray< KSGSV
                                  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;
+        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;
+    if( !rechts )
+    {
+        error( 3, {}, obj );
+        return 0;
+    }
+    KSGSVariable *ret = 0;
+    switch( id )
+    {
+    case KSGS_O_SET:
+        if( 1 )
+        {
+            val->release();
+            val = rechts->getBild();
+            ret = (KSGSVariable *)getThis();
+        }
+        break;
+    }
+    if( !ret )
+        error( 21, {}, obj );
+    if( rechts )
+        rechts->release();
+    return ret;
 }
 
 // constant
 Bild *KSGSBildKlasse::getVal() const
 {
-	return val->getThis();
+    return (Bild *)val->getThis();
 }
 
 Bild *KSGSBildKlasse::zVal() const
 {
-	return val;
+    return val;
 }

+ 17 - 17
ksgScript/Klassen/KSGSBild.h

@@ -6,24 +6,24 @@
 
 namespace KSGScript
 {
-	class KSGSBildKlasse : public KSGSKlasseInstanz
-	{
-	private:
-		Bild *val;
+    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;
-	};
+    public:
+        // Konstruktor
+        __declspec( dllexport ) KSGSBildKlasse( KSGScriptProcessor *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;
+    };
 }
 
 #endif

+ 5 - 5
ksgScript/Klassen/KSGSBildZ.cpp

@@ -13,7 +13,7 @@ using namespace KSGScript;
 
 // Inhalt der KSGSBildZKlasse Klasse aus KSGSBildZ.h
 // Konstruktor
-KSGSBildZKlasse::KSGSBildZKlasse( KSGScriptObj *zObj, BildZ *std )
+KSGSBildZKlasse::KSGSBildZKlasse( KSGScriptProcessor *zObj, BildZ *std )
     : KSGSKlasseInstanz( KSGS_BILDO, 0, 0, zObj )
 {
     val = std;
@@ -116,7 +116,7 @@ KSGSVariable *KSGSBildZKlasse::startFunktion( int id, bool access, RCArray< KSGS
         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() );
+        ret = new KSGSBildZKlasse( obj, (BildZ *)val->dublizieren() );
         break;
     case 14: // void setToolTipText( Text )
         if( 1 )
@@ -176,7 +176,7 @@ KSGSVariable *KSGSBildZKlasse::doOperator( int id, KSGSVariable *rechts )
         {
             val->release();
             val = rechts->getBildZ();
-            ret = getThis();
+            ret = (KSGSVariable *)getThis();
         }
         break;
     }
@@ -206,7 +206,7 @@ bool KSGSBildZKlasse::doMausEreignis( MausEreignis &me )
 // constant
 BildZ *KSGSBildZKlasse::getVal() const
 {
-    return (BildZ*)val->getThis();
+    return (BildZ *)val->getThis();
 }
 
 BildZ *KSGSBildZKlasse::zVal() const
@@ -220,5 +220,5 @@ bool KSGScript::ksgsBildZME( void *var, void *obj, MausEreignis me )
 {
     if( !var )
         return 1;
-    return ( (KSGSBildZKlasse*)var )->doMausEreignis( me );
+    return ( (KSGSBildZKlasse *)var )->doMausEreignis( me );
 }

+ 20 - 20
ksgScript/Klassen/KSGSBildZ.h

@@ -7,28 +7,28 @@
 
 namespace KSGScript
 {
-	class KSGSBildZKlasse : public KSGSKlasseInstanz
-	{
-	private:
-		BildZ *val;
-		int mausF;
+    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;
-	};
+    public:
+        // Konstruktor
+        __declspec( dllexport ) KSGSBildZKlasse( KSGScriptProcessor *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;
+    };
 
-	// Ereignisse
-	__declspec( dllexport ) bool ksgsBildZME( void *var, void *obj, MausEreignis me );
+    // Ereignisse
+    __declspec( dllexport ) bool ksgsBildZME( void *var, void *obj, MausEreignis me );
 }
 
 #endif

+ 103 - 103
ksgScript/Klassen/KSGSBool.cpp

@@ -9,10 +9,10 @@ using namespace KSGScript;
 
 // Inhalt der KSGSBoolKlasse Klasse aus KSGSBool.h
 // Konstruktor
-KSGSBoolKlasse::KSGSBoolKlasse( KSGScriptObj *zObj, bool std )
-	: KSGSKlasseInstanz( KSGS_BOOL, 0, 0, zObj )
+KSGSBoolKlasse::KSGSBoolKlasse( KSGScriptProcessor *zObj, bool std )
+    : KSGSKlasseInstanz( KSGS_BOOL, 0, 0, zObj )
 {
-	val = std;
+    val = std;
 }
 
 // Destruktor
@@ -24,113 +24,113 @@ 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;
+    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 = (KSGSVariable *)getThis();
+        break;
+    case KSGS_O_PLUSSET:
+        val = ( val + rechts->getBool() ) != 0;
+        ret = (KSGSVariable *)getThis();
+        break;
+    case KSGS_O_MINUSSET:
+        val = ( val - rechts->getBool() ) != 0;
+        ret = (KSGSVariable *)getThis();
+        break;
+    case KSGS_O_MAHLSET:
+        val = ( val * rechts->getBool() ) != 0;
+        ret = (KSGSVariable *)getThis();
+        break;
+    case KSGS_O_UNDSET:
+        val &= rechts->getBool();
+        ret = (KSGSVariable *)getThis();
+        break;
+    case KSGS_O_ODERSET:
+        val |= rechts->getBool();
+        ret = (KSGSVariable *)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;
+    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;
+    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;
 }

+ 15 - 15
ksgScript/Klassen/KSGSBool.h

@@ -5,22 +5,22 @@
 
 namespace KSGScript
 {
-	class KSGSBoolKlasse : public KSGSKlasseInstanz
-	{
-	private:
-		bool val;
+    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;
-	};
+    public:
+        // Konstruktor
+        __declspec( dllexport ) KSGSBoolKlasse( KSGScriptProcessor *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;
+    };
 }
 
 #endif

+ 123 - 123
ksgScript/Klassen/KSGSDouble.cpp

@@ -9,10 +9,10 @@ using namespace KSGScript;
 
 // Inhalt der KSGSDoubleKlasse Klasse aus KSGSDouble.h
 // Konstruktor
-KSGSDoubleKlasse::KSGSDoubleKlasse( KSGScriptObj *zObj, double std )
-	: KSGSKlasseInstanz( KSGS_DOUBLE, 0, 0, zObj )
+KSGSDoubleKlasse::KSGSDoubleKlasse( KSGScriptProcessor *zObj, double std )
+    : KSGSKlasseInstanz( KSGS_DOUBLE, 0, 0, zObj )
 {
-	val = std;
+    val = std;
 }
 
 // Destruktor
@@ -24,137 +24,137 @@ KSGSDoubleKlasse::~KSGSDoubleKlasse()
 // nicht constant
 void KSGSDoubleKlasse::set( double d )
 {
-	val = 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;
+    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 = (KSGSVariable *)getThis();
+        break;
+    case KSGS_O_PLUSSET:
+        val += rechts->getDouble();
+        ret = (KSGSVariable *)getThis();
+        break;
+    case KSGS_O_MINUSSET:
+        val -= rechts->getDouble();
+        ret = (KSGSVariable *)getThis();
+        break;
+    case KSGS_O_MAHLSET:
+        val *= rechts->getDouble();
+        ret = (KSGSVariable *)getThis();
+        break;
+    case KSGS_O_GETEILTSET:
+        val /= rechts->getDouble();
+        ret = (KSGSVariable *)getThis();
+        break;
+    case KSGS_O_UNDSET:
+        val = (int)val & rechts->getInt();
+        ret = (KSGSVariable *)getThis();
+        break;
+    case KSGS_O_ODERSET:
+        val = (int)val | rechts->getInt();
+        ret = (KSGSVariable *)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;
+    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;
+    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;
 }

+ 16 - 16
ksgScript/Klassen/KSGSDouble.h

@@ -5,23 +5,23 @@
 
 namespace KSGScript
 {
-	class KSGSDoubleKlasse : public KSGSKlasseInstanz
-	{
-	private:
-		double val;
+    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;
-	};
+    public:
+        // Konstruktor
+        __declspec( dllexport ) KSGSDoubleKlasse( KSGScriptProcessor *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;
+    };
 }
 
 #endif

+ 8 - 8
ksgScript/Klassen/KSGSFenster.cpp

@@ -15,7 +15,7 @@ using namespace KSGScript;
 
 // Inahlt der KSGSFensterKlasse Klasse aus KSGSFenster.h
 // Konstruktor
-KSGSFensterKlasse::KSGSFensterKlasse( KSGScriptObj *zObj, Fenster *std )
+KSGSFensterKlasse::KSGSFensterKlasse( KSGScriptProcessor *zObj, Fenster *std )
     : KSGSKlasseInstanz( KSGS_FENSTER, 0, 0, zObj )
 {
     val = std;
@@ -24,7 +24,7 @@ KSGSFensterKlasse::KSGSFensterKlasse( KSGScriptObj *zObj, Fenster *std )
     val->setTastaturEreignisParameter( this );
     val->setTastaturEreignis( ksgsFensterTE );
     if( zObj->zSchrift() )
-        val->setTSchriftZ( zObj->getSchrift() );
+        val->setTSchriftZ( (Schrift *)zObj->zSchrift()->getThis() );
     mausF = -1;
     tastaturF = -1;
 }
@@ -212,7 +212,7 @@ KSGSVariable *KSGSFensterKlasse::startFunktion( int id, bool access, RCArray< KS
                 error( 20, {}, obj );
             Zeichnung *obj = parameter->z( 0 ) ? parameter->z( 0 )->getZeichnung() : 0;
             if( obj )
-                val->addMember( obj->getThis() );
+                val->addMember( (Zeichnung *)obj->getThis() );
         }
         break;
     case 33: // void removeMember( Zeichnung )
@@ -389,7 +389,7 @@ KSGSVariable *KSGSFensterKlasse::startFunktion( int id, bool access, RCArray< KS
         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() );
+        ret = new KSGSFensterKlasse( obj, (Fenster *)val->dublizieren() );
         break;
     case 72: // void setToolTipText( Text )
         if( 1 )
@@ -449,7 +449,7 @@ KSGSVariable *KSGSFensterKlasse::doOperator( int id, KSGSVariable *rechts )
         {
             val->release();
             val = rechts->getFenster();
-            ret = getThis();
+            ret = (KSGSVariable *)getThis();
         }
         break;
     }
@@ -495,7 +495,7 @@ bool KSGSFensterKlasse::doTastaturEreignis( TastaturEreignis &te )
 // constant
 Fenster *KSGSFensterKlasse::getVal() const
 {
-    return (Fenster*)val->getThis();
+    return (Fenster *)val->getThis();
 }
 
 Fenster *KSGSFensterKlasse::zVal() const
@@ -508,12 +508,12 @@ bool KSGScript::ksgsFensterME( void *var, void *obj, MausEreignis me )
 {
     if( !var )
         return 1;
-    return ( (KSGSFensterKlasse*)var )->doMausEreignis( me );
+    return ( (KSGSFensterKlasse *)var )->doMausEreignis( me );
 }
 
 bool KSGScript::ksgsFensterTE( void *var, void *obj, TastaturEreignis te )
 {
     if( !var )
         return 1;
-    return ( (KSGSFensterKlasse*)var )->doTastaturEreignis( te );
+    return ( (KSGSFensterKlasse *)var )->doTastaturEreignis( te );
 }

+ 23 - 23
ksgScript/Klassen/KSGSFenster.h

@@ -6,31 +6,31 @@
 
 namespace KSGScript
 {
-	class KSGSFensterKlasse : public KSGSKlasseInstanz
-	{
-	private:
-		Fenster *val;
-		int mausF;
-		int tastaturF;
+    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;
-	};
+    public:
+        // Konstruktor
+        __declspec( dllexport ) KSGSFensterKlasse( KSGScriptProcessor *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;
+    };
 
-	// Ereignisse
-	__declspec( dllexport ) bool ksgsFensterME( void *var, void *obj, MausEreignis me );
-	__declspec( dllexport ) bool ksgsFensterTE( void *var, void *obj, TastaturEreignis te );
+    // Ereignisse
+    __declspec( dllexport ) bool ksgsFensterME( void *var, void *obj, MausEreignis me );
+    __declspec( dllexport ) bool ksgsFensterTE( void *var, void *obj, TastaturEreignis te );
 }
 
 #endif

+ 123 - 123
ksgScript/Klassen/KSGSInt.cpp

@@ -9,10 +9,10 @@ using namespace KSGScript;
 
 // Inhalt der KSGSIntKlasse Klasse aus KSGSInt.h
 // Konstruktor
-KSGSIntKlasse::KSGSIntKlasse( KSGScriptObj *zObj, int std )
-	: KSGSKlasseInstanz( KSGS_INT, 0, 0, zObj )
+KSGSIntKlasse::KSGSIntKlasse( KSGScriptProcessor *zObj, int std )
+    : KSGSKlasseInstanz( KSGS_INT, 0, 0, zObj )
 {
-	val = std;
+    val = std;
 }
 
 // Destruktor
@@ -24,137 +24,137 @@ KSGSIntKlasse::~KSGSIntKlasse()
 // nicht constant
 void KSGSIntKlasse::set( int i )
 {
-	val = 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;
+    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 = (KSGSVariable *)getThis();
+        break;
+    case KSGS_O_PLUSSET:
+        val += rechts->getInt();
+        ret = (KSGSVariable *)getThis();
+        break;
+    case KSGS_O_MINUSSET:
+        val -= rechts->getInt();
+        ret = (KSGSVariable *)getThis();
+        break;
+    case KSGS_O_MAHLSET:
+        val = (int)( val * rechts->getDouble() );
+        ret = (KSGSVariable *)getThis();
+        break;
+    case KSGS_O_GETEILTSET:
+        val = (int)( val / rechts->getDouble() );
+        ret = (KSGSVariable *)getThis();
+        break;
+    case KSGS_O_UNDSET:
+        val &= rechts->getInt();
+        ret = (KSGSVariable *)getThis();
+        break;
+    case KSGS_O_ODERSET:
+        val |= rechts->getInt();
+        ret = (KSGSVariable *)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;
+    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;
+    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;
 }

+ 1 - 1
ksgScript/Klassen/KSGSInt.h

@@ -12,7 +12,7 @@ namespace KSGScript
 
 	public:
 		// Konstruktor
-		__declspec( dllexport ) KSGSIntKlasse( KSGScriptObj *zObj, int std = 0 );
+		__declspec( dllexport ) KSGSIntKlasse( KSGScriptProcessor *zObj, int std = 0 );
 		// Destruktor
 		__declspec( dllexport ) ~KSGSIntKlasse();
 		// nicht constant

+ 6 - 6
ksgScript/Klassen/KSGSKnopf.cpp

@@ -13,7 +13,7 @@ using namespace KSGScript;
 
 // Inhalt der KSGSKnopfKlasse Klasse aus KSGSKnopf.h
 // Konstruktor
-KSGSKnopfKlasse::KSGSKnopfKlasse( KSGScriptObj *zObj, Knopf *std )
+KSGSKnopfKlasse::KSGSKnopfKlasse( KSGScriptProcessor *zObj, Knopf *std )
     : KSGSKlasseInstanz( KSGS_KNOPF, 0, 0, zObj )
 {
     mausF = -1;
@@ -21,7 +21,7 @@ KSGSKnopfKlasse::KSGSKnopfKlasse( KSGScriptObj *zObj, Knopf *std )
     val->setMausEreignisParameter( this );
     val->setMausEreignis( ksgsKnopfME );
     if( zObj->zSchrift() )
-        val->setSchriftZ( zObj->getSchrift() );
+        val->setSchriftZ( (Schrift *)zObj->zSchrift()->getThis() );
 }
 
 // Destruktor
@@ -208,7 +208,7 @@ KSGSVariable *KSGSKnopfKlasse::startFunktion( int id, bool access, RCArray< KSGS
         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() );
+        ret = new KSGSKnopfKlasse( obj, (Knopf *)val->dublizieren() );
         break;
     case 36: // void setToolTipText( Text )
         if( 1 )
@@ -268,7 +268,7 @@ KSGSVariable *KSGSKnopfKlasse::doOperator( int id, KSGSVariable *rechts )
         {
             val->release();
             val = rechts->getKnopf();
-            ret = getThis();
+            ret = (KSGSVariable *)getThis();
         }
         break;
     }
@@ -298,7 +298,7 @@ bool KSGSKnopfKlasse::doMausEreignis( MausEreignis &me )
 // constant
 Knopf *KSGSKnopfKlasse::getVal() const
 {
-    return (Knopf*)val->getThis();
+    return (Knopf *)val->getThis();
 }
 
 Knopf *KSGSKnopfKlasse::zVal() const
@@ -312,5 +312,5 @@ bool KSGScript::ksgsKnopfME( void *var, void *obj, MausEreignis me )
 {
     if( !var )
         return 1;
-    return ( (KSGSKnopfKlasse*)var )->doMausEreignis( me );
+    return ( (KSGSKnopfKlasse *)var )->doMausEreignis( me );
 }

+ 20 - 20
ksgScript/Klassen/KSGSKnopf.h

@@ -6,28 +6,28 @@
 
 namespace KSGScript
 {
-	class KSGSKnopfKlasse : public KSGSKlasseInstanz
-	{
-	private:
-		Knopf *val;
-		int mausF;
+    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;
-	};
+    public:
+        // Konstruktor
+        __declspec( dllexport ) KSGSKnopfKlasse( KSGScriptProcessor *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;
+    };
 
-	// Ereignisse
-	__declspec( dllexport ) bool ksgsKnopfME( void *var, void *obj, MausEreignis me );
+    // Ereignisse
+    __declspec( dllexport ) bool ksgsKnopfME( void *var, void *obj, MausEreignis me );
 }
 
 #endif

+ 75 - 76
ksgScript/Klassen/KSGSMausEreignis.cpp

@@ -8,104 +8,103 @@ using namespace KSGScript;
 
 // Inhalt der KSGSMausEreignisKlasse Klasse aus KSGSMausEreignis.h
 // Konstruktor
-KSGSMausEreignisKlasse::KSGSMausEreignisKlasse( KSGScriptObj *zObj, MausEreignis std )
-	: KSGSKlasseInstanz( KSGS_MAUSEREIGNIS, 0, 0, zObj )
+KSGSMausEreignisKlasse::KSGSMausEreignisKlasse( KSGScriptProcessor *zObj, MausEreignis std )
+    : KSGSKlasseInstanz( KSGS_MAUSEREIGNIS, 0, 0, zObj )
 {
-	val = std;
+    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 setVerarbeitet( bool verarbeitet )
-		if( parameter->getEintragAnzahl() < 1 )
-			error( 20, {}, obj );
-		val.verarbeitet = parameter->z( 0 ) ? parameter->z( 0 )->getBool() : 0;
-		break;
+    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 setVerarbeitet( bool verarbeitet )
+        if( parameter->getEintragAnzahl() < 1 )
+            error( 20, {}, obj );
+        val.verarbeitet = parameter->z( 0 ) ? parameter->z( 0 )->getBool() : 0;
+        break;
     case 4: // void setInsideParent( bool verarbeitet )
         if( parameter->getEintragAnzahl() < 1 )
             error( 20, {}, obj );
         val.insideParent = parameter->z( 0 ) ? parameter->z( 0 )->getBool() : 0;
         break;
-	default: // unbekannt
-		error( 19, {}, obj );
-		break;
-	}
-	parameter->release();
-	return ret;
+    default: // unbekannt
+        error( 19, {}, obj );
+        break;
+    }
+    parameter->release();
+    return ret;
 }
 
 void KSGSMausEreignisKlasse::set( MausEreignis &me )
 {
-	val = 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;
+    if( !rechts )
+    {
+        error( 3, {}, obj );
+        return 0;
+    }
+    KSGSVariable *ret = 0;
+    switch( id )
+    {
+    case KSGS_O_SET:
+        if( 1 )
+        {
+            val = rechts->getMausEreignis();
+            ret = (KSGSVariable *)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: // bool verarbeitet
-		ret = new KSGSBoolKlasse( obj, val.verarbeitet );
-		break;
+    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: // bool verarbeitet
+        ret = new KSGSBoolKlasse( obj, val.verarbeitet );
+        break;
     case 4: // bool insideParent
         ret = new KSGSBoolKlasse( obj, val.insideParent );
         break;
@@ -115,13 +114,13 @@ KSGSVariable *KSGSMausEreignisKlasse::getVariable( int id, bool zugriff ) const
     case 6: // int originalY
         ret = new KSGSIntKlasse( obj, val.originalY );
         break;
-	}
-	if( !ret )
-		error( 17, {}, obj );
-	return ret;
+    }
+    if( !ret )
+        error( 17, {}, obj );
+    return ret;
 }
 
 MausEreignis KSGSMausEreignisKlasse::getVal() const
 {
-	return val;
+    return val;
 }

+ 17 - 17
ksgScript/Klassen/KSGSMausEreignis.h

@@ -6,24 +6,24 @@
 
 namespace KSGScript
 {
-	class KSGSMausEreignisKlasse : public KSGSKlasseInstanz
-	{
-	private:
-		MausEreignis val;
+    class KSGSMausEreignisKlasse : public KSGSKlasseInstanz
+    {
+    private:
+        MausEreignis val;
 
-	public:
-		// Konstruktor
-		__declspec( dllexport ) KSGSMausEreignisKlasse( KSGScriptObj *zObj, MausEreignis std = { 0, 0, 0, 0, 1, 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;
-	};
+    public:
+        // Konstruktor
+        __declspec( dllexport ) KSGSMausEreignisKlasse( KSGScriptProcessor *zObj, MausEreignis std = { 0, 0, 0, 0, 1, 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;
+    };
 }
 
 #endif

+ 67 - 68
ksgScript/Klassen/KSGSTastaturEreignis.cpp

@@ -8,98 +8,97 @@ using namespace KSGScript;
 
 // Inhalt der KSGSTastaturEreigninKlasse Klasse aus KSGSTastaturEreignis.h
 // Konstruktor
-KSGSTastaturEreignisKlasse::KSGSTastaturEreignisKlasse( KSGScriptObj *zObj, TastaturEreignis std )
-	: KSGSKlasseInstanz( KSGS_TASTATUREREIGNIS, 0, 0, zObj )
+KSGSTastaturEreignisKlasse::KSGSTastaturEreignisKlasse( KSGScriptProcessor *zObj, TastaturEreignis std )
+    : KSGSKlasseInstanz( KSGS_TASTATUREREIGNIS, 0, 0, zObj )
 {
-	val = std;
+    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;
+    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;
+    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;
+    if( !rechts )
+    {
+        error( 3, {}, obj );
+        return 0;
+    }
+    KSGSVariable *ret = 0;
+    switch( id )
+    {
+    case KSGS_O_SET:
+        if( 1 )
+        {
+            val = rechts->getTastaturEreignis();
+            ret = (KSGSVariable *)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;
+    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;
+    return val;
 }

+ 17 - 17
ksgScript/Klassen/KSGSTastaturEreignis.h

@@ -6,24 +6,24 @@
 
 namespace KSGScript
 {
-	class KSGSTastaturEreignisKlasse : public KSGSKlasseInstanz
-	{
-	private:
-		TastaturEreignis val;
+    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;
-	};
+    public:
+        // Konstruktor
+        __declspec( dllexport ) KSGSTastaturEreignisKlasse( KSGScriptProcessor *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;
+    };
 }
 
 #endif

+ 180 - 180
ksgScript/Klassen/KSGSText.cpp

@@ -9,212 +9,212 @@ using namespace KSGScript;
 
 // Inhalt der KSGSTextKlasse Klasse aus KSGSText.h
 // Konstruktor
-KSGSTextKlasse::KSGSTextKlasse( KSGScriptObj *zObj, char *std )
-	: KSGSKlasseInstanz( KSGS_TEXT, 0, 0, zObj )
+KSGSTextKlasse::KSGSTextKlasse( KSGScriptProcessor *zObj, char *std )
+    : KSGSKlasseInstanz( KSGS_TEXT, 0, 0, zObj )
 {
-	val = new Text( std );
+    val = new Text( std );
 }
 
 // Destruktor
 KSGSTextKlasse::~KSGSTextKlasse()
 {
-	val->release();
+    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 *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;
+    if( !rechts )
+    {
+        error( 3, {}, obj );
+        return 0;
+    }
+    KSGSVariable *ret = 0;
+    switch( id )
+    {
+    case KSGS_O_SET:
+        val->setText( rechts->getText() );
+        ret = (KSGSVariable *)getThis();
+        break;
+    case KSGS_O_PLUSSET:
+        val->append( rechts->getText() );
+        ret = (KSGSVariable *)getThis();
+        break;
+    case KSGS_O_MINUSSET:
+        val->append( rechts->getText() );
+        ret = (KSGSVariable *)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();
+    return (Text *)val->getThis();
 }
 
 Text *KSGSTextKlasse::zVal() const
 {
-	return val;
+    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;
+    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;
 }

+ 17 - 17
ksgScript/Klassen/KSGSText.h

@@ -5,24 +5,24 @@
 
 namespace KSGScript
 {
-	class KSGSTextKlasse : public KSGSKlasseInstanz
-	{
-	private:
-		Text *val;
+    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;
-	};
+    public:
+        // Konstruktor
+        __declspec( dllexport ) KSGSTextKlasse( KSGScriptProcessor *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;
+    };
 }
 
 #endif

+ 7 - 7
ksgScript/Klassen/KSGSTextFeld.cpp

@@ -15,7 +15,7 @@ using namespace KSGScript;
 
 // Inhalt der KSGSTextFeldKlasse Klasse aus KSGSTextFeld.h
 // Konstruktor
-KSGSTextFeldKlasse::KSGSTextFeldKlasse( KSGScriptObj *zObj, TextFeld *std )
+KSGSTextFeldKlasse::KSGSTextFeldKlasse( KSGScriptProcessor *zObj, TextFeld *std )
     : KSGSKlasseInstanz( KSGS_TEXTFELD, 0, 0, zObj )
 {
     val = std;
@@ -26,7 +26,7 @@ KSGSTextFeldKlasse::KSGSTextFeldKlasse( KSGScriptObj *zObj, TextFeld *std )
     val->setTastaturEreignisParameter( this );
     val->setTastaturEreignis( ksgsTextFeldTE );
     if( zObj->zSchrift() )
-        val->setSchriftZ( zObj->getSchrift() );
+        val->setSchriftZ( (Schrift *)zObj->zSchrift()->getThis() );
 }
 
 // Destruktor
@@ -253,7 +253,7 @@ KSGSVariable *KSGSTextFeldKlasse::startFunktion( int id, bool access, RCArray< K
         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() );
+        ret = new KSGSTextFeldKlasse( obj, (TextFeld *)val->dublizieren() );
         break;
     case 38: // void setToolTipText( Text )
         if( 1 )
@@ -335,7 +335,7 @@ KSGSVariable *KSGSTextFeldKlasse::doOperator( int id, KSGSVariable *rechts )
         {
             val->release();
             val = rechts->getTextFeld();
-            ret = getThis();
+            ret = (KSGSVariable *)getThis();
         }
         break;
     }
@@ -381,7 +381,7 @@ bool KSGSTextFeldKlasse::doTastaturEreignis( TastaturEreignis &te )
 // constant
 TextFeld *KSGSTextFeldKlasse::getVal() const
 {
-    return (TextFeld*)val->getThis();
+    return (TextFeld *)val->getThis();
 }
 
 TextFeld *KSGSTextFeldKlasse::zVal() const
@@ -395,12 +395,12 @@ bool KSGScript::ksgsTextFeldME( void *var, void *obj, MausEreignis me )
 {
     if( !var )
         return 1;
-    return ( (KSGSTextFeldKlasse*)var )->doMausEreignis( me );
+    return ( (KSGSTextFeldKlasse *)var )->doMausEreignis( me );
 }
 
 bool KSGScript::ksgsTextFeldTE( void *var, void *obj, TastaturEreignis te )
 {
     if( !var )
         return 1;
-    return ( (KSGSTextFeldKlasse*)var )->doTastaturEreignis( te );
+    return ( (KSGSTextFeldKlasse *)var )->doTastaturEreignis( te );
 }

+ 23 - 23
ksgScript/Klassen/KSGSTextFeld.h

@@ -6,31 +6,31 @@
 
 namespace KSGScript
 {
-	class KSGSTextFeldKlasse : public KSGSKlasseInstanz
-	{
-	private:
-		TextFeld *val;
-		int mausF;
-		int tastaturF;
+    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;
-	};
+    public:
+        // Konstruktor
+        __declspec( dllexport ) KSGSTextFeldKlasse( KSGScriptProcessor *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;
+    };
 
-	// Ereignisse
-	__declspec( dllexport ) bool ksgsTextFeldME( void *var, void *obj, MausEreignis me );
-	__declspec( dllexport ) bool ksgsTextFeldTE( void *var, void *obj, TastaturEreignis te );
+    // Ereignisse
+    __declspec( dllexport ) bool ksgsTextFeldME( void *var, void *obj, MausEreignis me );
+    __declspec( dllexport ) bool ksgsTextFeldTE( void *var, void *obj, TastaturEreignis te );
 }
 
 #endif

+ 46 - 46
ksgScript/Klassen/KSGSThread.cpp

@@ -8,65 +8,65 @@ using namespace KSGScript;
 
 // Inhalt der KSGSThreadKlasse Klasse aus KSGSThreadKlasse.h
 // Konstruktor
-KSGSThreadKlasse::KSGSThreadKlasse( KSGScriptObj *zObj, KSGSFunktionInstanz *f )
-	: KSGSKlasseInstanz( KSGS_THREAD, 0, 0, zObj )
+KSGSThreadKlasse::KSGSThreadKlasse( KSGScriptProcessor *zObj, KSGSFunktionInstanz *f )
+    : KSGSKlasseInstanz( KSGS_THREAD, 0, 0, zObj )
 {
-	func = f;
+    func = f;
 }
 
 // Destruktor
 KSGSThreadKlasse::~KSGSThreadKlasse()
 {
-	if( func )
-		func->release();
+    if( func )
+        func->release();
 }
 
 // nicht constant
 void KSGSThreadKlasse::threadEnde()
 {
-	if( func )
-		func = (KSGSFunktionInstanz*)func->release();
+    if( func )
+        func = (KSGSFunktionInstanz *)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;
+    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;
 }

+ 13 - 13
ksgScript/Klassen/KSGSThread.h

@@ -5,20 +5,20 @@
 
 namespace KSGScript
 {
-	class KSGSThreadKlasse : public KSGSKlasseInstanz
-	{
-	private:
-		KSGSFunktionInstanz *func;
+    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;
-	};
+    public:
+        // Konstruktor
+        __declspec( dllexport ) KSGSThreadKlasse( KSGScriptProcessor *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;
+    };
 }
 
 #endif

+ 453 - 498
ksgScript/Leser/KSGSCompile.cpp

@@ -6,598 +6,553 @@ using namespace KSGScript;
 // Compile Strukturen
 KSGSCompileVariable::KSGSCompileVariable( int t, int s )
 {
-	typ = t;
-	sichtbar = 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 );
+    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()
+    : ReferenceCounter()
 {
-	namen = new RCArray< Text >();
-	vars = new Array< KSGSCompileVariable* >();
-	ref = 1;
+    namen = new RCArray< Text >();
+    vars = new Array< KSGSCompileVariable * >();
 }
 
 // Destruktor
 KSGSCompVarTable::~KSGSCompVarTable()
 {
-	namen->release();
-	int anz = vars->getEintragAnzahl();
-	for( int i = 0; i < anz; i++ )
-		delete vars->get( i );
-	vars->release();
+    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;
+    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;
+    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;
+    int anz = namen->getEintragAnzahl();
+    for( int i = 0; i < anz; i++ )
+    {
+        if( namen->z( i )->istGleich( name ) )
+            return 1;
+    }
+    return 0;
 }
 
 
 // Inhalt der KSGSCompFuncTable Klasse aus KSGSCompile.h
 // Konstruktor
 KSGSCompFuncTable::KSGSCompFuncTable()
+    : ReferenceCounter()
 {
-	namen = new RCArray< Text >();
-	funks = new Array< KSGSCompileFunktion* >();
-	ref = 1;
+    namen = new RCArray< Text >();
+    funks = new Array< KSGSCompileFunktion * >();
 }
 
 // Destruktor
 KSGSCompFuncTable::~KSGSCompFuncTable()
 {
-	namen->release();
-	int anz = funks->getEintragAnzahl();
-	for( int i = 0; i < anz; i++ )
-		delete funks->get( i );
-	funks->release();
+    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;
+    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;
+    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;
+    int anz = namen->getEintragAnzahl();
+    for( int i = 0; i < anz; i++ )
+    {
+        if( namen->z( i )->istGleich( name ) )
+            return 1;
+    }
+    return 0;
 }
 
 
 // Inhalt der KSGSCompKlassTable Klasse aus KSGSCompile.h
 // Konstruktor
 KSGSCompKlassTable::KSGSCompKlassTable()
+    : ReferenceCounter()
 {
-	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( "verarbeitet", new KSGSCompileVariable( KSGS_BOOL, 1 ) );
+    namen = new RCArray< Text >();
+    klassen = new Array< KSGSCompileKlasse * >();
+    // 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( "verarbeitet", new KSGSCompileVariable( KSGS_BOOL, 1 ) );
     _MausEreignis->vars.addVariable( "insideParent", new KSGSCompileVariable( KSGS_BOOL, 1 ) );
     _MausEreignis->vars.addVariable( "originalX", new KSGSCompileVariable( KSGS_INT, 1 ) );
     _MausEreignis->vars.addVariable( "originalY", new KSGSCompileVariable( KSGS_INT, 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( "setVerarbeitet", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_BOOL } ) );
+    _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( "setVerarbeitet", new KSGSCompileFunktion( KSGS_VOID, 1, { KSGS_BOOL } ) );
     _MausEreignis->funcs.addFunktion( "setInsideParent", 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, {} ) );
+    // 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( "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, {} ) );
-	// 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, {} ) );
-	// 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, {} ) );
-	// 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, {} ) );
+    // 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, {} ) );
+    // 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, {} ) );
+    // 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, {} ) );
+    // 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, {} ) );
 }
 
 // Destruktor
 KSGSCompKlassTable::~KSGSCompKlassTable()
 {
-	namen->release();
-	int anz = klassen->getEintragAnzahl();
-	for( int i = 0; i < anz; i++ )
-		delete klassen->get( i );
-	klassen->release();
+    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;
+    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;
+    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;
+    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;
+    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;
+    int anz = klassen->getEintragAnzahl();
+    for( int i = 0; i < anz; i++ )
+    {
+        if( klassen->get( i )->id == id )
+            return 1;
+    }
+    return 0;
 }

+ 77 - 89
ksgScript/Leser/KSGSCompile.h

@@ -9,105 +9,93 @@ using namespace Framework;
 
 namespace KSGScript
 {
-	struct KSGSCompileVariable; // aus dieser Datei
-	struct KSGSCompileFunktion; // aus dieser Datei
-	struct KSGSCompileKlasse; // aus dieser Datei
+    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;
+    class KSGSCompVarTable : public virtual ReferenceCounter
+    {
+    private:
+        RCArray< Text > *namen;
+        Array< KSGSCompileVariable * > *vars;
 
-	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();
-	};
+    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
+    };
 
-	class KSGSCompFuncTable
-	{
-	private:
-		RCArray< Text > *namen;
-		Array< KSGSCompileFunktion* > *funks;
-		int ref;
+    class KSGSCompFuncTable : public virtual ReferenceCounter
+    {
+    private:
+        RCArray< Text > *namen;
+        Array< KSGSCompileFunktion * > *funks;
 
-	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();
-	};
+    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
+    };
 
-	class KSGSCompKlassTable
-	{
-	private:
-		RCArray< Text > *namen;
-		Array< KSGSCompileKlasse* > *klassen;
-		int ref;
+    class KSGSCompKlassTable : public virtual ReferenceCounter
+    {
+    private:
+        RCArray< Text > *namen;
+        Array< KSGSCompileKlasse * > *klassen;
 
-	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();
-	};
+    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
+    };
 
-	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 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 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;
-	};
+    struct KSGSCompileKlasse
+    {
+        int id;
+        KSGSCompVarTable vars;
+        KSGSCompFuncTable funcs;
+    };
 }
 
 #endif

+ 53 - 67
ksgScript/Leser/KSGSLeser.cpp

@@ -16,7 +16,7 @@ void KSGScript::removeLehr( Text *txt )
     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->getText()[ txt->getLength() - 1 ] == '\r' || txt->getText()[ txt->getLength() - 1 ] == '\t' ) )
         txt->remove( txt->getLength() - 1 );
 }
 
@@ -229,36 +229,34 @@ KSGSLeseScript::~KSGSLeseScript()
 
 // Inhalt der KSGSLeser klasse aus KSGSLeser.h
 // Konstruktor
-KSGSLeser::KSGSLeser( const char *pfad, KSGScriptO *zObj )
+KSGSLeser::KSGSLeser( Reader *reader, KSGScriptProcessor *zObj, Text fileName )
     : KSGSLeser()
 {
     this->zObj = zObj;
-    this->pfad = new Text( pfad );
+    d = reader;
+    this->fileName = fileName;
 }
 
 // Destruktor
 KSGSLeser::~KSGSLeser()
 {
     delete dat;
-    if( pfad )
-        pfad->release();
 }
 
 // protected
 KSGSLeser::KSGSLeser()
+    : ReferenceCounter()
 {
     errorIgnore = 0;
     this->zObj = 0;
     d = 0;
     dat = 0;
-    this->pfad = 0;
     zeile = 0;
     mainFuncId = -1;
     mausFuncId = -1;
     tastaturFuncId = -1;
     tickFuncId = -1;
     renderFuncId = -1;
-    ref = 1;
 }
 
 void KSGSLeser::handleError( int beginn, int ende )
@@ -274,15 +272,6 @@ void KSGSLeser::handleString( int beginn, int ende )
 bool KSGSLeser::ladeDatei()
 {
     bool ok = 1;
-    Datei *datei = new Datei();
-    datei->setDatei( *pfad );
-    if( !datei->open( Datei::Style::lesen ) )
-    {
-        datei->release();
-        error( 4, { *pfad }, zObj );
-        return 0;
-    }
-    d = datei;
     zeile = 1;
     while( !d->istEnde() )
     {
@@ -298,7 +287,7 @@ bool KSGSLeser::ladeDatei()
                 KSGSLeseKlasse *k = leseKlasse();
                 if( !k )
                 {
-                    error( 6, { "Klasse", *pfad }, zObj );
+                    error( 6, { "Klasse", fileName }, zObj );
                     br = 1;
                 }
                 else
@@ -311,7 +300,7 @@ bool KSGSLeser::ladeDatei()
                 KSGSLeseFunktion *f = leseFunktion();
                 if( !f )
                 {
-                    error( 6, { "Funktion", *pfad }, zObj );
+                    error( 6, { "Funktion", fileName }, zObj );
                     br = 1;
                 }
                 else
@@ -324,7 +313,7 @@ bool KSGSLeser::ladeDatei()
                 KSGSLeseVariable *v = leseVariable();
                 if( !v )
                 {
-                    error( 6, { "Variable", *pfad }, zObj );
+                    error( 6, { "Variable", fileName }, zObj );
                     br = 1;
                 }
                 else
@@ -336,14 +325,14 @@ bool KSGSLeser::ladeDatei()
             {
                 if( !leseBis( '(' ) )
                 {
-                    error( 6, { "Lade Anweisung", *pfad }, zObj );
+                    error( 6, { "Lade Anweisung", fileName }, zObj );
                     br = 1;
                     break;
                 }
                 d->setLPosition( d->getLPosition() + 1, 0 );
                 if( !leseBis( '"' ) )
                 {
-                    error( 6, { "Lade Anweisung", *pfad }, zObj );
+                    error( 6, { "Lade Anweisung", fileName }, zObj );
                     br = 1;
                     break;
                 }
@@ -351,7 +340,7 @@ bool KSGSLeser::ladeDatei()
                 __int64 end = nextPosOf( '"', 0 );
                 if( end < 0 )
                 {
-                    error( 6, { "Lade Anweisung", *pfad }, zObj );
+                    error( 6, { "Lade Anweisung", fileName }, zObj );
                     br = 1;
                     break;
                 }
@@ -362,28 +351,41 @@ bool KSGSLeser::ladeDatei()
                 delete[] datei;
                 if( !leseBis( ')' ) )
                 {
-                    error( 6, { "Lade Anweisung", *pfad }, zObj );
+                    error( 6, { "Lade Anweisung", fileName }, zObj );
                     br = 1;
                     break;
                 }
                 d->setLPosition( d->getLPosition() + 1, 0 );
-                Text *pf = new Text( pfad->getText() );
-                pfad->setText( dPf );
+                Text pf = fileName;
+                fileName.setText( dPf );
+                Datei *dat = new Datei();
+                dat->setDatei( fileName );
+                if( !dat->open( Datei::Style::lesen ) )
+                {
+                    dat->release();
+                    error( 4, { fileName }, zObj );
+                    br = 1;
+                    fileName.setText( pf );
+                    break;
+                }
                 Reader *tmp = d;
+                d = dat;
                 if( !ladeDatei() )
                 {
                     d = tmp;
-                    pfad->setText( pf );
-                    error( 6, { "Lade Anweisung", *pfad }, zObj );
+                    error( 6, { "Lade Anweisung", fileName }, zObj );
                     br = 1;
+                    fileName.setText( pf );
                     break;
                 }
+                dat->close();
+                dat->release();
                 d = tmp;
-                pfad->setText( pf );
+                fileName.setText( pf );
             }
             break;
         default: // Fehler
-            error( 5, { *pfad, Text() += zeile }, zObj );
+            error( 5, { fileName, Text() += zeile }, zObj );
             br = 1;
             break;
         }
@@ -395,8 +397,7 @@ bool KSGSLeser::ladeDatei()
             break;
         }
     }
-    datei->close();
-    d = datei->release();
+    d = 0;
     return ok;
 }
 
@@ -681,7 +682,7 @@ int KSGSLeser::leseNext()
 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 == 'ß' );
+              || c == '_' || c == 'ä' || c == 'ö' || c == 'ü' || c == 'Ä' || c == 'Ö' || c == 'Ü' || c == 'ß' );
 }
 
 bool KSGSLeser::istLehr( char c )
@@ -692,7 +693,7 @@ bool KSGSLeser::istLehr( char c )
 KSGSLeseKlasse *KSGSLeser::leseKlasse()
 {
     KSGSLeseKlasse *ret = new KSGSLeseKlasse();
-    ret->debug.datei.setText( *pfad );
+    ret->debug.datei.setText( fileName );
     ret->debug.zeile = zeile;
     d->setLPosition( d->getLPosition() + 5, 0 ); // 'class' überspringen
     if( !leseBisText() ) // Bis zum beginn des Klassennamens lesen
@@ -798,7 +799,7 @@ KSGSLeseKlasse *KSGSLeser::leseKlasse()
 KSGSLeseFunktion *KSGSLeser::leseFunktion()
 {
     KSGSLeseFunktion *ret = new KSGSLeseFunktion();
-    ret->debug.datei.setText( *pfad );
+    ret->debug.datei.setText( fileName );
     ret->debug.zeile = zeile;
     d->setLPosition( d->getLPosition() + 4, 0 ); // 'func' überspringen
     if( !leseBisText() )
@@ -879,7 +880,7 @@ KSGSLeseFunktion *KSGSLeser::leseFunktion()
 KSGSLeseVariable *KSGSLeser::leseVariable( bool param )
 {
     KSGSLeseVariable *ret = new KSGSLeseVariable();
-    ret->debug.datei.setText( *pfad );
+    ret->debug.datei.setText( fileName );
     ret->debug.zeile = zeile;
     if( !param )
         d->setLPosition( d->getLPosition() + 3, 0 ); // 'var' überspringen
@@ -994,7 +995,7 @@ KSGSLeseBefehl *KSGSLeser::leseBefehl()
     if( typ < 0 )
         return 0;
     KSGSLeseBefehl *ret = new KSGSLeseBefehl();
-    ret->debug.datei.setText( *pfad );
+    ret->debug.datei.setText( fileName );
     ret->debug.zeile = zeile;
     ret->typ = typ;
     switch( typ )
@@ -1213,12 +1214,12 @@ KSGSLeseBefehl *KSGSLeser::leseBefehl()
 // Script Compilieren
 bool KSGSLeser::compileKlasse( KSGSLeseKlasse *zLK, KSGSCompKlassTable *zKT )
 {
-    if( !zKT->hat( (char*)zLK->name ) )
+    if( !zKT->hat( (char *)zLK->name ) )
     {
         error( 10, {}, zObj );
         return 0;
     }
-    KSGSCompileKlasse *k = zKT->get( (char*)zLK->name );
+    KSGSCompileKlasse *k = zKT->get( (char *)zLK->name );
     int lFAnz = zLK->funktionen.getEintragAnzahl();
     for( int i = 0; i < lFAnz; i++ )
     {
@@ -1229,10 +1230,10 @@ bool KSGSLeser::compileKlasse( KSGSLeseKlasse *zLK, KSGSCompKlassTable *zKT )
     int lVAnz = zLK->variablen.getEintragAnzahl();
     for( int i = 0; i < lVAnz; i++ )
     {
-        auto tmp = zKT->get( (char*)zLK->variablen.get( i )->typ );
+        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 );
+            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 ) ) ) )
@@ -1246,11 +1247,11 @@ bool KSGSLeser::compileKlasse( KSGSLeseKlasse *zLK, KSGSCompKlassTable *zKT )
 
 bool KSGSLeser::compileFunktion( KSGSLeseFunktion *zLF, KSGSCompKlassTable *zKT, KSGSCompFuncTable *zFT, int s )
 {
-    KSGSCompileFunktion *f = new KSGSCompileFunktion( zKT->get( (char*)zLF->typ )->id, 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 );
+        auto tmp = zKT->get( (char *)zLF->parameter.get( j )->typ );
         if( tmp )
             f->parameterTyp.add( tmp->id );
         else
@@ -1269,7 +1270,7 @@ bool KSGSLeser::compileFunktion( KSGSLeseFunktion *zLF, KSGSCompKlassTable *zKT,
 
 KSGSVariableDef *KSGSLeser::compileVariable( KSGSLeseVariable *zLV, KSGSCompKlassTable *zKT, int id )
 {
-    if( !zKT->hat( (char*)zLV->typ ) )
+    if( !zKT->hat( (char *)zLV->typ ) )
     {
         error( 11, { zLV->debug.datei, Text() += zLV->debug.zeile, zLV->typ, zLV->name }, zObj );
         return 0;
@@ -1277,19 +1278,19 @@ KSGSVariableDef *KSGSLeser::compileVariable( KSGSLeseVariable *zLV, KSGSCompKlas
     KSGSVariableDef *ret = new KSGSVariableDef();
     ret->id = id;
     ret->sichtbar = 0;
-    ret->typId = zKT->get( (char*)zLV->typ )->id;
+    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 ) )
+    if( !zKT->hat( (char *)zLK->name ) )
     {
         error( 10, {}, zObj );
         return 0;
     }
-    KSGSKlasse *ret = new KSGSKlasse( zKT->get( (char*)zLK->name )->id );
+    KSGSKlasse *ret = new KSGSKlasse( zKT->get( (char *)zLK->name )->id );
     int anz = zLK->funktionen.getEintragAnzahl();
     for( int i = 0; i < anz; i++ )
     {
@@ -1326,7 +1327,7 @@ KSGSFunktion *KSGSLeser::buildFunktion( KSGSLeseFunktion *zLF, KSGSCompKlassTabl
         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 );
+    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++ )
@@ -1339,7 +1340,7 @@ KSGSFunktion *KSGSLeser::buildFunktion( KSGSLeseFunktion *zLF, KSGSCompKlassTabl
         }
         v->sichtbar = 3;
         ret->addParameter( v );
-        auto tmp = zKT->get( (char*)zLF->parameter.get( i )->typ );
+        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 );
@@ -1402,7 +1403,7 @@ KSGSBefehl *KSGSLeser::buildBefehl( KSGSLeseBefehl *zLB, KSGSCompKlassTable *zKT
     if( !ret )
         error( 13, { zLB->debug.datei, Text() += zLB->debug.zeile, zLB->befehl }, zObj );
     if( ret && ret->hatFehler() )
-        ret = ret->release();
+        ret = (KSGSBefehl *)ret->release();
     return ret;
 }
 
@@ -1415,7 +1416,7 @@ bool KSGSLeser::laden()
     return ok;
 }
 
-bool KSGSLeser::compile( RCArray< KSGSKlasse > *klassen, RCArray< KSGSFunktion > *funktionen, Array< KSGSVariableDef* > *variablen )
+bool KSGSLeser::compile( RCArray< KSGSKlasse > *klassen, RCArray< KSGSFunktion > *funktionen, Array< KSGSVariableDef * > *variablen )
 {
     // Klassen Tabelle
     KSGSCompKlassTable *klassT = new KSGSCompKlassTable();
@@ -1458,13 +1459,13 @@ bool KSGSLeser::compile( RCArray< KSGSKlasse > *klassen, RCArray< KSGSFunktion >
     int vAnz = dat->variablen.getEintragAnzahl();
     for( int i = 0; i < vAnz; i++ )
     {
-        auto tmp = klassT->get( (char*)dat->variablen.get( i )->typ );
+        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 ) ) )
+        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();
@@ -1559,19 +1560,4 @@ int KSGSLeser::getTickFuncId() const
 int KSGSLeser::getRenderFuncId() const
 {
     return renderFuncId;
-}
-
-// Reference Counting
-KSGSLeser *KSGSLeser::getThis()
-{
-    ref++;
-    return this;
-}
-
-KSGSLeser *KSGSLeser::release()
-{
-    ref--;
-    if( !ref )
-        delete this;
-    return 0;
 }

+ 108 - 111
ksgScript/Leser/KSGSLeser.h

@@ -9,141 +9,138 @@ using namespace Framework;
 
 namespace KSGScript
 {
-	class KSGScriptO;
-	class KSGSKlasse;
-	class KSGSFunktion;
-	struct KSGSVariableDef;
-	class KSGSCompVarTable;
-	class KSGSCompFuncTable;
-	class KSGSCompKlassTable;
-	class KSGSBefehl;
+    class KSGScriptO;
+    class KSGSKlasse;
+    class KSGSFunktion;
+    struct KSGSVariableDef;
+    class KSGSCompVarTable;
+    class KSGSCompFuncTable;
+    class KSGSCompKlassTable;
+    class KSGSBefehl;
+    class KSGScriptProcessor;
 
-	__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 );
+    __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 KSGSLeseDebug
+    {
+        Text datei;
+        int zeile;
+    };
 
-	struct KSGSLeseBefehl
-	{
-		int typ;
-		Text befehl;
-		Array< KSGSLeseBefehl* > listA;
-		Array< KSGSLeseBefehl* > listB;
-		KSGSLeseDebug debug;
-		// Destruktor
-		__declspec( dllexport ) ~KSGSLeseBefehl();
-	};
+    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 KSGSLeseVariable
+    {
+        Text typ;
+        Text name;
+        Text wert;
+        KSGSLeseDebug debug;
+    };
 
-	struct KSGSLeseFunktion
-	{
+    struct KSGSLeseFunktion
+    {
         int ref = 1;
-		Text name;
-		Text typ;
-		Array< KSGSLeseVariable* > parameter;
-		Array< KSGSLeseBefehl* > befehle;
-		KSGSLeseDebug debug;
+        Text name;
+        Text typ;
+        Array< KSGSLeseVariable * > parameter;
+        Array< KSGSLeseBefehl * > befehle;
+        KSGSLeseDebug debug;
         void release();
-		// Destruktor
-		__declspec( dllexport ) ~KSGSLeseFunktion();
-	};
+        // Destruktor
+        __declspec( dllexport ) ~KSGSLeseFunktion();
+    };
 
-	struct KSGSLeseKlasse
-	{
+    struct KSGSLeseKlasse
+    {
         int ref = 1;
-		Text name;
-		Array< KSGSLeseVariable* > variablen;
-		Array< bool > vSichtbar;
-		Array< KSGSLeseFunktion* > funktionen;
-		Array< bool > fSichtbar;
-		KSGSLeseDebug debug;
+        Text name;
+        Array< KSGSLeseVariable * > variablen;
+        Array< bool > vSichtbar;
+        Array< KSGSLeseFunktion * > funktionen;
+        Array< bool > fSichtbar;
+        KSGSLeseDebug debug;
         void release();
-		// Destruktor
-		__declspec( dllexport ) ~KSGSLeseKlasse();
-	};
+        // Destruktor
+        __declspec( dllexport ) ~KSGSLeseKlasse();
+    };
 
-	struct KSGSLeseScript
-	{
-		Array< KSGSLeseVariable* > variablen;
-		Array< KSGSLeseFunktion* > funktionen;
-		Array< KSGSLeseKlasse* > klassen;
-		// Destruktor
-		__declspec( dllexport ) ~KSGSLeseScript();
-	};
+    struct KSGSLeseScript
+    {
+        Array< KSGSLeseVariable * > variablen;
+        Array< KSGSLeseFunktion * > funktionen;
+        Array< KSGSLeseKlasse * > klassen;
+        // Destruktor
+        __declspec( dllexport ) ~KSGSLeseScript();
+    };
 
-	class KSGSLeser
-	{
-	private:
-		KSGScriptO *zObj;
-		int mainFuncId;
-		int mausFuncId;
-		int tastaturFuncId;
-		int tickFuncId;
-		int renderFuncId;
-		int ref;
+    class KSGSLeser : public virtual ReferenceCounter
+    {
+    private:
+        KSGScriptProcessor *zObj;
+        int mainFuncId;
+        int mausFuncId;
+        int tastaturFuncId;
+        int tickFuncId;
+        int renderFuncId;
 
     protected:
         bool errorIgnore;
-        Text *pfad;
         KSGSLeseScript *dat;
         int zeile;
         Reader *d;
+        Framework::Text fileName;
 
-		// Script Laden
+        // Script Laden
         KSGSLeser();
         virtual void handleError( int begin, int ende );
         virtual void handleKommentar( int beginn, int ende );
         virtual void handleString( int beginn, int ende );
-		__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 ) virtual KSGSLeseKlasse *leseKlasse();
-		__declspec( dllexport ) virtual 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 );
+        __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 ) virtual KSGSLeseKlasse *leseKlasse();
+        __declspec( dllexport ) virtual 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, KSGScriptO *zObj );
-		// Destruktor
-		__declspec( dllexport ) virtual ~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();
-	};
+    public:
+        // Konstruktor
+        __declspec( dllexport ) KSGSLeser( Reader *reader, KSGScriptProcessor *zObj, Text fileName );
+        // Destruktor
+        __declspec( dllexport ) virtual ~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;
+    };
 }
 
 #endif

+ 5 - 0
ksgScript/Main/Einstieg.cpp

@@ -2,6 +2,7 @@
 #include "../Editor/Editor.h"
 #include "../Befehl/KSGSKlasse.h"
 #include "../Klassen/KSGSBild.h"
+#include "../Main/KSGSExpressionEvaluator.h"
 
 using namespace KSGScript;
 
@@ -22,6 +23,10 @@ extern "C"
 		return KSGSKlasseInstanz::erstellVariable( zObj, def );
 	}
 
+	__declspec( dllexport ) KSGSExpressionEvaluator *GetNewKSGSExpressionEvaluator()
+	{
+		return new KSGSExpressionEvaluatorImpl();
+	}
 	__declspec( dllexport ) void SetKSGSBildVariable( KSGSVariable *zBv, Bild *b )
 	{
 		if( !b )

+ 243 - 0
ksgScript/Main/KSGSExpressionEvaluator.cpp

@@ -0,0 +1,243 @@
+#include "KSGSExpressionEvaluator.h"
+#include "..\Leser\KSGSLeser.h"
+#include "..\Befehl\KSGSKlasse.h"
+#include "..\Error\Error.h"
+#include <iostream>
+
+using namespace KSGScript;
+
+KSGSExpressionEvaluatorImpl::KSGSExpressionEvaluatorImpl()
+    : ReferenceCounter()
+{
+    functions = new RCArray< KSGSFunktion >();
+    classes = new RCArray< KSGSKlasse >();
+    params = new Framework::RCArray<KSGSVariable>();
+    variables = new RCArray< KSGSVariable >();
+    expression = "";
+}
+
+KSGSExpressionEvaluatorImpl::~KSGSExpressionEvaluatorImpl()
+{
+    params->release();
+    functions->release();
+    classes->release();
+    variables->release();
+}
+
+void KSGSExpressionEvaluatorImpl::compile()
+{
+    functions->leeren();
+    classes->leeren();
+    variables->leeren();
+    Framework::Text script = "func double start(";
+    Iterator<Text *> name = paramNames->getIterator();
+    for( Iterator<KSGSVariable *> it = params->getIterator(); it && name; it = it.next(), name = name.next() )
+    {
+        switch( it->getTyp() )
+        {
+        case KSGS_BOOL:
+            script += "bool " + name;
+            break;
+        case KSGS_INT:
+            script += "int " + name;
+            break;
+        case KSGS_DOUBLE:
+            script += "double " + name;
+            break;
+        case KSGS_ARRAY:
+            script += "Array " + name;
+            break;
+        case KSGS_THREAD:
+            script += "Thread " + name;
+            break;
+        case KSGS_TEXT:
+            script += "Text " + name;
+            break;
+        case KSGS_BILD:
+            script += "Bild " + name;
+            break;
+        case KSGS_MAUSEREIGNIS:
+            script += "MausEreignis " + name;
+            break;
+        case KSGS_TASTATUREREIGNIS:
+            script += "TastaturEreignis " + name;
+            break;
+        case KSGS_TEXTFELD:
+            script += "TextFeld " + name;
+            break;
+        case KSGS_KNOPF:
+            script += "Knopf " + name;
+            break;
+        case KSGS_FENSTER:
+            script += "Fenster " + name;
+            break;
+        case KSGS_BILDO:
+            script += "BildZ " + name;
+            break;
+        case KSGS_ANIMATION2DDATA:
+            script += "Animation2DData " + name;
+            break;
+        case KSGS_ANIMATION2D:
+            script += "Animation2D " + name;
+            break;
+        }
+        if( it.hasNext() )
+            script += ", ";
+    }
+    script += ") { return " + expression + Text( "; }" );
+    TextReader *expressionReader = new TextReader( new Text( script ) );
+    KSGSLeser *reader = new KSGSLeser( expressionReader, this, "expression" );
+    if( !reader->laden() )
+    {
+        expressionReader->release();
+        return;
+    }
+    Array< KSGSVariableDef * > *varDefs = new Array< KSGSVariableDef * >();
+    if( !reader->compile( classes, functions, varDefs ) )
+    {
+        varDefs->release();
+        expressionReader->release();
+        return;
+    }
+    reader->release();
+    int vAnz = varDefs->getEintragAnzahl();
+    for( int i = 0; i < vAnz; i++ )
+    {
+        KSGSVariable *var = KSGSKlasseInstanz::erstellVariable( this, varDefs->get( i ) );
+        if( var )
+            variables->add( var );
+        delete varDefs->get( i );
+    }
+    varDefs->release();
+    expressionReader->release();
+
+}
+
+KSGSVariable *KSGSExpressionEvaluatorImpl::createParameter( Framework::Text name, int type )
+{
+    this->paramNames->add( new Text( name ) );
+    KSGSVariable *var = KSGSKlasseInstanz::erstellVariable( this, new KSGSVariableDef{ type, 0, 0, "" } );
+    this->params->add( (KSGSVariable *)var->getThis() );
+    if( this->expression.getLength() > 0 )
+        compile();
+    return var;
+}
+
+KSGSVariable *KSGSExpressionEvaluatorImpl::getParameter( Framework::Text name )
+{
+    int vAnz = paramNames->getEintragAnzahl();
+    for( int i = 0; i < vAnz; i++ )
+    {
+        if( paramNames->z( i )->istGleich( name ) )
+            return params->get( i );
+    }
+    return 0;
+}
+
+void KSGSExpressionEvaluatorImpl::setExpression( Framework::Text expression )
+{
+    this->expression = expression;
+    compile();
+}
+
+KSGSVariable *KSGSExpressionEvaluatorImpl::evaluate()
+{
+    if( functions->getEintragAnzahl() > 0 )
+        return startFunktion( functions->z( 0 )->getId(), ( RCArray<KSGSVariable>* )params->getThis() );
+    return 0;
+}
+
+void KSGSExpressionEvaluatorImpl::logNachricht( char *n )
+{
+    std::cout << n << "\n";
+}
+
+Framework::Text *KSGSExpressionEvaluatorImpl::convertPfad( char *pf )
+{
+    Text *ret = new Text( pf );
+    ret->ersetzen( '\\', '/' );
+    if( ret->getText()[ 0 ] == '/' )
+    {
+        ret->remove( 0 );
+        return ret;
+    }
+    return ret;
+}
+
+void KSGSExpressionEvaluatorImpl::setVariable( int id, KSGSVariable *var )
+{
+    variables->set( var, id );
+}
+
+KSGSVariable *KSGSExpressionEvaluatorImpl::startFunktion( int id, Framework::RCArray< KSGSVariable > *parameter )
+{
+    if( !functions->z( id ) || functions->z( id )->getSichtbarkeit() != 0 )
+    {
+        error( 19, {}, this );
+        parameter->release();
+        return 0;
+    }
+    KSGSFunktionInstanz *inst = functions->z( id )->erstellInstanz( (KSGScriptProcessor *)getThis(), 0, parameter );
+    KSGSVariable *ret = inst->startFunktion();
+    inst->release();
+    return ret;
+}
+
+KSGSVariable *KSGSExpressionEvaluatorImpl::erstellKlassenInstanz( int id )
+{
+    int anz = classes->getEintragAnzahl();
+    for( int i = 0; i < anz; i++ )
+    {
+        if( classes->z( i ) && classes->z( i )->getId() == id )
+            return classes->z( i )->erstellInstanz( this );
+    }
+    error( 2, {}, this );
+    return 0;
+}
+
+KSGSVariable *KSGSExpressionEvaluatorImpl::getVariable( int id ) const
+{
+    if( !variables || !variables->z( id ) )
+    {
+        error( 17, {}, (KSGScriptProcessor *)this );
+        return 0;
+    }
+    return variables->get( id );
+}
+
+int KSGSExpressionEvaluatorImpl::getScriptId() const
+{
+    return 0;
+}
+
+Framework::Bildschirm *KSGSExpressionEvaluatorImpl::zBildschirm() const
+{
+    return 0;
+}
+
+Framework::Schrift *KSGSExpressionEvaluatorImpl::zSchrift() const
+{
+    return 0;
+}
+
+int KSGSExpressionEvaluatorImpl::getFunktionId( const char *name ) const
+{
+    int anz = functions->getEintragAnzahl();
+    for( int i = 0; i < anz; i++ )
+    {
+        if( functions->z( i )->hatName( name ) )
+            return i;
+    }
+    return -1;
+}
+
+bool KSGSExpressionEvaluatorImpl::istBeendet( int scrId ) const
+{
+    return false;
+}
+
+KSGSVariable *KSGSExpressionEvaluatorImpl::rückruf( Framework::RCArray< KSGSVariable > *parameter ) const
+{
+    parameter->release();
+    return 0;
+}

+ 49 - 0
ksgScript/Main/KSGSExpressionEvaluator.h

@@ -0,0 +1,49 @@
+#pragma once
+
+#include "../Include/KSGScript.h"
+#include "../Befehl/KSGSFunktion.h"
+
+#include <Trie.h>
+
+namespace KSGScript
+{
+
+    class KSGSKlasse;
+    class KSGSVariable;
+    class KSGSFunktion;
+
+    class KSGSExpressionEvaluatorImpl : public KSGSExpressionEvaluator
+    {
+    private:
+        Framework::RCArray<KSGSVariable> *params;
+        Framework::RCArray<Text> *paramNames;
+        Framework::Text expression;
+        RCArray< KSGSFunktion > *functions;
+        RCArray< KSGSKlasse > *classes;
+        RCArray< KSGSVariable > *variables;
+
+    private:
+        void compile();
+
+    public:
+        KSGSExpressionEvaluatorImpl();
+        ~KSGSExpressionEvaluatorImpl();
+
+        KSGSVariable *createParameter( Framework::Text name, int type ) override;
+        KSGSVariable *getParameter( Framework::Text name ) override;
+        void setExpression( Framework::Text expression ) override;
+        KSGSVariable *evaluate() override;
+        void logNachricht( char *n ) override;
+        Framework::Text *convertPfad( char *pf ) override;
+        void setVariable( int id, KSGSVariable *var ) override;
+        KSGSVariable *startFunktion( int id, Framework::RCArray< KSGSVariable > *parameter ) override;
+        KSGSVariable *erstellKlassenInstanz( int id ) override;
+        KSGSVariable *getVariable( int id ) const override;
+        int getScriptId() const override;
+        Framework::Bildschirm *zBildschirm() const override;
+        Framework::Schrift *zSchrift() const override;
+        int getFunktionId( const char *name ) const override;
+        bool istBeendet( int scrId ) const override;
+        KSGSVariable *rückruf( Framework::RCArray< KSGSVariable > *parameter ) const override;
+    };
+}

+ 38 - 34
ksgScript/Main/KSGScriptObj.cpp

@@ -13,6 +13,7 @@
 #include "../Error/Error.h"
 #include <Bildschirm.h>
 #include <Zeit.h>
+#include <Datei.h>
 
 using namespace KSGScript;
 
@@ -84,7 +85,7 @@ void KSGScriptO::setScriptDatei( const char *pfad )
         wd->setText( pfad, l );
 }
 
-void KSGScriptO::setScriptDatei( Text * pfad )
+void KSGScriptO::setScriptDatei( Text *pfad )
 {
     setScriptDatei( pfad->getText() );
     pfad->release();
@@ -98,12 +99,22 @@ bool KSGScriptO::neuLaden()
     if( geladen )
         zurücksetzen();
     scrId++;
-    KSGSLeser * reader = new KSGSLeser( *pfad, this );
-    ZeitMesser * zm = new ZeitMesser();
+    Datei *datei = new Datei();
+    datei->setDatei( *pfad );
+    if( !datei->open( Datei::Style::lesen ) )
+    {
+        datei->release();
+        error( 4, { *pfad }, this );
+        return 0;
+    }
+    KSGSLeser *reader = new KSGSLeser( datei, this, *pfad );
+    ZeitMesser *zm = new ZeitMesser();
     zm->messungStart();
     if( !reader->laden() )
     {
         reader->release();
+        datei->close();
+        datei->release();
         zm->release();
         gzm->release();
         unlock();
@@ -123,6 +134,8 @@ bool KSGScriptO::neuLaden()
     {
         varDefs->release();
         reader->release();
+        datei->close();
+        datei->release();
         zm->release();
         gzm->release();
         unlock();
@@ -156,13 +169,15 @@ bool KSGScriptO::neuLaden()
     tickId = reader->getTickFuncId();
     renderId = reader->getRenderFuncId();
     reader->release();
+    datei->close();
+    datei->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( dynamic_cast<KSGScriptO *>( getThis() ), 0, 0 );
+            KSGSFunktionInstanz *inst = funktionen->z( i )->erstellInstanz( (KSGScriptProcessor *)getThis(), 0, 0 );
             KSGSVariable *ret = inst->startFunktion();
             if( ret )
                 ret->release();
@@ -205,26 +220,26 @@ void KSGScriptO::setR
     rParam = p;
 }
 
-void KSGScriptO::setRückrufFunktion( void( *funktion )( void *, RCArray< KSGSVariable > *, KSGSVariable * * ) )
+void KSGScriptO::setRückrufFunktion( void( *funktion )( void *, RCArray< KSGSVariable > *, KSGSVariable ** ) )
 {
     rFunktion = funktion;
 }
 
-void KSGScriptO::setSchriftZ( Schrift * s )
+void KSGScriptO::setSchriftZ( Schrift *s )
 {
     if( schrift )
         schrift->release();
     schrift = s;
 }
 
-void KSGScriptO::setBildschirmZ( Bildschirm * s )
+void KSGScriptO::setBildschirmZ( Bildschirm *s )
 {
     if( screen )
         screen->release();
     screen = s;
 }
 
-void KSGScriptO::doPublicMausEreignis( MausEreignis & me )
+void KSGScriptO::doPublicMausEreignis( MausEreignis &me )
 {
     if( geladen != 2 )
         return;
@@ -237,7 +252,7 @@ void KSGScriptO::doPublicMausEreignis( MausEreignis & me )
         if( funktionen->z( i )->getId() == mausId )
         {
             ( (KSGSMausEreignisKlasse *)mausP->z( 0 ) )->set( me );
-            KSGSFunktionInstanz *inst = funktionen->z( i )->erstellInstanz( dynamic_cast<KSGScriptO *>( getThis() ), 0, mausP->getThis() );
+            KSGSFunktionInstanz *inst = funktionen->z( i )->erstellInstanz( (KSGScriptProcessor *)getThis(), 0, ( RCArray<KSGSVariable>* )mausP->getThis() );
             KSGSVariable *ret = inst->startFunktion();
             if( ret )
             {
@@ -255,7 +270,7 @@ void KSGScriptO::doPublicMausEreignis( MausEreignis & me )
     unlock();
 }
 
-void KSGScriptO::doTastaturEreignis( TastaturEreignis & te )
+void KSGScriptO::doTastaturEreignis( TastaturEreignis &te )
 {
     if( geladen != 2 )
         return;
@@ -266,7 +281,7 @@ void KSGScriptO::doTastaturEreignis( TastaturEreignis & te )
         if( funktionen->z( i )->getId() == tastaturId )
         {
             ( (KSGSTastaturEreignisKlasse *)tastaturP->z( 0 ) )->set( te );
-            KSGSFunktionInstanz *inst = funktionen->z( i )->erstellInstanz( dynamic_cast<KSGScriptO *>( getThis() ), 0, tastaturP->getThis() );
+            KSGSFunktionInstanz *inst = funktionen->z( i )->erstellInstanz( (KSGScriptProcessor *)getThis(), 0, ( RCArray<KSGSVariable>* )tastaturP->getThis() );
             KSGSVariable *ret = inst->startFunktion();
             if( ret )
             {
@@ -293,7 +308,7 @@ bool KSGScriptO::tick( double zeit )
         if( funktionen->z( i )->getId() == tickId )
         {
             ( (KSGSDoubleKlasse *)tickP->z( 0 ) )->set( zeit );
-            KSGSFunktionInstanz *inst = funktionen->z( i )->erstellInstanz( dynamic_cast<KSGScriptO *>( getThis() ), 0, tickP->getThis() );
+            KSGSFunktionInstanz *inst = funktionen->z( i )->erstellInstanz( (KSGScriptProcessor *)getThis(), 0, ( RCArray<KSGSVariable>* )tickP->getThis() );
             KSGSVariable *ret = inst->startFunktion();
             bool r = 0;
             if( ret )
@@ -312,7 +327,7 @@ bool KSGScriptO::tick( double zeit )
     return 0;
 }
 
-void KSGScriptO::render( Bild & zRObj )
+void KSGScriptO::render( Bild &zRObj )
 {
     if( geladen != 2 )
         return;
@@ -327,8 +342,8 @@ void KSGScriptO::render( Bild & zRObj )
     {
         if( funktionen->z( i )->getId() == renderId )
         {
-            ( (KSGSBildKlasse *)renderP->z( 0 ) )->set( zRObj.getThis() );
-            KSGSFunktionInstanz *inst = funktionen->z( i )->erstellInstanz( dynamic_cast<KSGScriptO *>( getThis() ), 0, renderP->getThis() );
+            ( (KSGSBildKlasse *)renderP->z( 0 ) )->set( (Bild *)zRObj.getThis() );
+            KSGSFunktionInstanz *inst = funktionen->z( i )->erstellInstanz( (KSGScriptProcessor *)getThis(), 0, ( RCArray<KSGSVariable>* )renderP->getThis() );
             KSGSVariable *ret = inst->startFunktion();
             if( ret )
                 ret->release();
@@ -342,7 +357,7 @@ void KSGScriptO::render( Bild & zRObj )
     unlock();
 }
 
-KSGSVariable *KSGScriptO::startFunktion( int id, RCArray< KSGSVariable > * parameter )
+KSGSVariable *KSGScriptO::startFunktion( int id, RCArray< KSGSVariable > *parameter )
 {
     if( !funktionen || !funktionen->z( id ) || funktionen->z( id )->getSichtbarkeit() != 0 )
     {
@@ -350,7 +365,7 @@ KSGSVariable *KSGScriptO::startFunktion( int id, RCArray< KSGSVariable > * param
         parameter->release();
         return 0;
     }
-    KSGSFunktionInstanz *inst = funktionen->z( id )->erstellInstanz( dynamic_cast<KSGScriptO *>( getThis() ), 0, parameter );
+    KSGSFunktionInstanz *inst = funktionen->z( id )->erstellInstanz( (KSGScriptProcessor *)getThis(), 0, parameter );
     KSGSVariable *ret = inst->startFunktion();
     inst->release();
     return ret;
@@ -368,7 +383,7 @@ KSGSVariable *KSGScriptO::erstellKlassenInstanz( int id )
     return 0;
 }
 
-void KSGScriptO::setVariable( int id, KSGSVariable * var )
+void KSGScriptO::setVariable( int id, KSGSVariable *var )
 {
     variablen->set( var, id );
 }
@@ -386,7 +401,7 @@ Text *KSGScriptO::convertPfad( char *pf )
     return ret;
 }
 
-void KSGScriptO::setLog( TextFeld * log )
+void KSGScriptO::setLog( TextFeld *log )
 {
     lock();
     if( this->log )
@@ -406,7 +421,7 @@ void KSGScriptO::logNachricht( char *n )
 }
 
 // constant
-KSGSVariable *KSGScriptO::rückruf( RCArray< KSGSVariable > * parameter ) const
+KSGSVariable *KSGScriptO::rückruf( RCArray< KSGSVariable > *parameter ) const
 {
     if( !rFunktion )
     {
@@ -421,7 +436,7 @@ KSGSVariable *KSGScriptO::r
 
 Text *KSGScriptO::getScriptDateiPfad() const
 {
-    return pfad->getThis();
+    return (Text *)pfad->getThis();
 }
 
 Text *KSGScriptO::zScriptDateiPfad() const
@@ -431,7 +446,7 @@ Text *KSGScriptO::zScriptDateiPfad() const
 
 Schrift *KSGScriptO::getSchrift() const
 {
-    return schrift ? schrift->getThis() : 0;
+    return schrift ? (Schrift *)schrift->getThis() : 0;
 }
 
 Schrift *KSGScriptO::zSchrift() const
@@ -441,7 +456,7 @@ Schrift *KSGScriptO::zSchrift() const
 
 Bildschirm *KSGScriptO::getBildschirm() const
 {
-    return screen ? screen->getThis() : 0;
+    return screen ? (Bildschirm *)screen->getThis() : 0;
 }
 
 Bildschirm *KSGScriptO::zBildschirm() const
@@ -478,15 +493,4 @@ KSGSVariable *KSGScriptO::getVariable( int id ) const
         return 0;
     }
     return variablen->get( id );
-}
-
-// Reference Counting
-Zeichnung *KSGScriptO::getThis()
-{
-    return Zeichnung::getThis();
-}
-
-Zeichnung *KSGScriptO::release()
-{
-    return Zeichnung::release();
 }

+ 65 - 68
ksgScript/Main/KSGScriptObj.h

@@ -11,77 +11,74 @@ 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
+    class KSGSFunktion; // ../Befehl/KSGSFunktion.h
+    class KSGSFunktionInstanz; // ../Befehl/KSGSFunktion.h
+    class KSGSKlasse; // ../Befehl/KSGSKlasse.h
+    class KSGSKlasseInstanz; // ../Befehl/KSGSKlasse.h
 
-	class KSGScriptO : public KSGScriptObj
-	{
-	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;
+    class KSGScriptO : public KSGScriptObj
+    {
+    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 mainId;
+        int mausId;
+        int tastaturId;
+        int tickId;
+        int renderId;
+        int geladen;
+        int scrId;
+        Critical cs;
 
-	public:
-		// Konstruktor
-		__declspec( dllexport ) KSGScriptO();
-		// Destruktor
-		__declspec( dllexport ) ~KSGScriptO();
-		// nicht constant
-		virtual void lock() override;
-		virtual void unlock() override;
-		virtual void setScriptDatei( const char *pfad ) override;
-		virtual void setScriptDatei( Text *pfad ) override;
-		virtual bool neuLaden() override;
-		virtual void zurücksetzen() override;
-		virtual void setRückrufParam( void *p ) override;
-		virtual void setRückrufFunktion( void( *funktion )( void *, RCArray< KSGSVariable > *, KSGSVariable ** ) ) override;
-		virtual void setSchriftZ( Schrift *s ) override;
-		virtual void setBildschirmZ( Bildschirm *s ) override;
-		virtual void doPublicMausEreignis( MausEreignis &me ) override;
-		virtual void doTastaturEreignis( TastaturEreignis &te ) override;
-		virtual bool tick( double zeit ) override;
-		virtual void render( Bild &zRObj ) override;
-		virtual KSGSVariable *startFunktion( int id, RCArray< KSGSVariable > *parameter ) override;
-		virtual KSGSVariable *erstellKlassenInstanz( int id ) override;
-		virtual void setVariable( int id, KSGSVariable *var ) override;
-		virtual Text *convertPfad( char *pf ) override;
+    public:
+        // Konstruktor
+        __declspec( dllexport ) KSGScriptO();
+        // Destruktor
+        __declspec( dllexport ) ~KSGScriptO();
+        // nicht constant
+        virtual void lock() override;
+        virtual void unlock() override;
+        virtual void setScriptDatei( const char *pfad ) override;
+        virtual void setScriptDatei( Text *pfad ) override;
+        virtual bool neuLaden() override;
+        virtual void zurücksetzen() override;
+        virtual void setRückrufParam( void *p ) override;
+        virtual void setRückrufFunktion( void( *funktion )( void *, RCArray< KSGSVariable > *, KSGSVariable ** ) ) override;
+        virtual void setSchriftZ( Schrift *s ) override;
+        virtual void setBildschirmZ( Bildschirm *s ) override;
+        virtual void doPublicMausEreignis( MausEreignis &me ) override;
+        virtual void doTastaturEreignis( TastaturEreignis &te ) override;
+        virtual bool tick( double zeit ) override;
+        virtual void render( Bild &zRObj ) override;
+        virtual KSGSVariable *startFunktion( int id, RCArray< KSGSVariable > *parameter ) override;
+        virtual KSGSVariable *erstellKlassenInstanz( int id ) override;
+        virtual void setVariable( int id, KSGSVariable *var ) override;
+        virtual Text *convertPfad( char *pf ) override;
         virtual void setLog( TextFeld *log ) override;
         virtual void logNachricht( char *n ) override;
-		// constant
-		virtual KSGSVariable *rückruf( RCArray< KSGSVariable > *parameter ) const override;
-		virtual Text *getScriptDateiPfad() const override;
-		virtual Text *zScriptDateiPfad() const override;
-		virtual Schrift *getSchrift() const override;
-		virtual Schrift *zSchrift() const override;
-		virtual Bildschirm *getBildschirm() const override;
-		virtual Bildschirm *zBildschirm() const override;
-		virtual int getScriptId() const override;
-		virtual bool istBeendet( int scrId ) const override;
-		virtual int getFunktionId( const char *name ) const override;
-		virtual KSGSVariable *getVariable( int id ) const override;
-		// Reference Counting
-		virtual Zeichnung *getThis() override;
-		virtual Zeichnung *release() override;
-	};
+        // constant
+        virtual KSGSVariable *rückruf( RCArray< KSGSVariable > *parameter ) const override;
+        virtual Text *getScriptDateiPfad() const override;
+        virtual Text *zScriptDateiPfad() const override;
+        virtual Schrift *getSchrift() const override;
+        virtual Schrift *zSchrift() const override;
+        virtual Bildschirm *getBildschirm() const override;
+        virtual Bildschirm *zBildschirm() const override;
+        virtual int getScriptId() const override;
+        virtual bool istBeendet( int scrId ) const override;
+        virtual int getFunktionId( const char *name ) const override;
+        virtual KSGSVariable *getVariable( int id ) const override;
+    };
 }

+ 2 - 0
ksgScript/ksgScript.vcxproj

@@ -202,6 +202,7 @@ copy "..\x64\Debug\ksgScript.dll" "..\..\..\Spiele Platform\Klient\Fertig\Debug\
     <ClInclude Include="Leser\KSGSCompile.h" />
     <ClInclude Include="Leser\KSGSLeser.h" />
     <ClInclude Include="Main\KSGScriptObj.h" />
+    <ClInclude Include="Main\KSGSExpressionEvaluator.h" />
   </ItemGroup>
   <ItemGroup>
     <ClCompile Include="Befehl\KSGSBefehl.cpp" />
@@ -230,6 +231,7 @@ copy "..\x64\Debug\ksgScript.dll" "..\..\..\Spiele Platform\Klient\Fertig\Debug\
     <ClCompile Include="Leser\KSGSLeser.cpp" />
     <ClCompile Include="Main\Einstieg.cpp" />
     <ClCompile Include="Main\KSGScriptObj.cpp" />
+    <ClCompile Include="Main\KSGSExpressionEvaluator.cpp" />
   </ItemGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
   <ImportGroup Label="ExtensionTargets">

+ 6 - 0
ksgScript/ksgScript.vcxproj.filters

@@ -99,6 +99,9 @@
     <ClInclude Include="Editor\Parser\ColorParser.h">
       <Filter>Headerdateien</Filter>
     </ClInclude>
+    <ClInclude Include="Main\KSGSExpressionEvaluator.h">
+      <Filter>Headerdateien</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <ClCompile Include="Befehl\KSGSFunktion.cpp">
@@ -179,5 +182,8 @@
     <ClCompile Include="Editor\Parser\ColorParser.cpp">
       <Filter>Quelldateien</Filter>
     </ClCompile>
+    <ClCompile Include="Main\KSGSExpressionEvaluator.cpp">
+      <Filter>Quelldateien</Filter>
+    </ClCompile>
   </ItemGroup>
 </Project>