using craftsReport.Interfaces;

namespace craftsReport.modules
{
	public class rsp221_xbs : IReportModule
	{
		public IReportHost HostObject { set; get; }

		public rsp221_xbs()
		{
		}

		// Artikelstammblatt
		public bool Execute()
		{


			//  Haupprogrammcode 
			// --------------------------------------------------
			HostObject.DefineVariable2("Zeile", "s,2,0");
			HostObject.DefineVariable2("ZlMax", "s,2,0");
			HostObject.DefineVariable2("Seite", "s,2,0");
			HostObject.DefineVariable2("RandX", "d,8,2");
			HostObject.DefineVariable2("RandY", "d,8,2");
			HostObject.DefineVariable2("SizeX", "d,8,2");
			HostObject.DefineVariable2("Heute", "D,10,0");
			HostObject.DefineVariable2("cyZeile", "d,8,6");

			if (!HostObject.IsVar("VonArtNr"))
				HostObject.DefineVariable2("VonArtNr", "u,20,0");
			if (!HostObject.IsVar("BisArtNr"))
				HostObject.DefineVariable2("BisArtNr", "u,20,0");

			HostObject.Set("ZlMax", @"     61", true);
			HostObject.Set("RandX", @"      1,80", true);
			HostObject.Set("RandY", @"      0,80", true);
			HostObject.Set("SizeX", @"      18,0", true);
			HostObject.Set("Seite", @"      1", true);
			HostObject.Set("Zeile", @"      0", true);
			HostObject.Set("cyZeile", @" 2,54/6", true);
			HostObject.Set("Heute", @"H", true);

			// **************************************************
			//  Datensatzschleife STAMMPOSITIONEN
			HostObject.DefineRecord("recART", "STAMMPOSITIONEN", 0, 0, HostObject.EvalString(@""));
			HostObject.FindRecord("recART", HostObject.EvalString("$[VonArtNr<20]"));
			//EOF_recART:
			// **************************************************
			HostObject.DefineRecord("recOPT", "OPTIONEN", 0, 0, HostObject.EvalString(@""));

			HostObject.DefineVariable2("mLohn", "N,6,2");
			HostObject.FindRecord("recOPT", HostObject.EvalString(" 7006"));
			HostObject.Set("mLohn", @"$[recOPT.OPTDATAD]", true);

			HostObject.WriteLine(HostObject.EvalString(@"INITPAGESIZE"));
			HostObject.WriteLine(HostObject.EvalString(@"STARTJOB Artikelstammblatt"));
			HostObject.WriteLine(HostObject.EvalString(@"TRANSPARENT"));
			while(!HostObject.TestEof("recART"))
			{
				SUB_loopMAIN();
				HostObject.SkipRecord("recART");
			}
			HostObject.WriteLine(HostObject.EvalString(@"ENDJOB"));

			return true;
		}

		bool SUB_loopMAIN()
		{
			HostObject.VariablesPush();

			//  Wird fuer jeden Satz von recMAIN aufgerufen
			// -------------------------------------------------
			if (HostObject.GetYieldResult(HostObject.EvalString("$[recART.Lkz]/$[recART.Artnr]")))
				goto NoBreak;
			HostObject.BreakRecord("recART");
			return HostObject.VariablesPop();
			NoBreak:


			if (HostObject.IsEmpty("BisArtNr"))
				goto DoIt;
			if (!HostObject.CompareString("BisArtNr", "<", HostObject.EvalString(@"$[recART.LKZ<2]$[recART.ARTNR]")))
				goto DoIt;
			HostObject.BreakRecord("recART");
			return HostObject.VariablesPop();
			DoIt:
			// -------------------------------------------------
			HostObject.DefineVariable2("mSaveZl", "s,2,0");
			HostObject.DefineVariable2("mCntZb", "s,2,0");
			HostObject.DefineVariable2("mPrsFak", "d,8,3");
			HostObject.DefineVariable2("mEkLohn", "d,8,2");
			HostObject.DefineVariable2("mEkZube", "d,8,2");
			HostObject.DefineVariable2("mEkNe100", "d,8,2");
			HostObject.DefineVariable2("mEkMat1", "d,8,2");
			HostObject.DefineVariable2("mCuZahl", "d,8,2");
			HostObject.DefineVariable2("mVk1L", "d,8,2");
			HostObject.DefineVariable2("mVk1M", "d,8,2");
			HostObject.DefineVariable2("mVkm21", "d,8,2");
			HostObject.DefineVariable2("mDb1", "d,8,2");
			HostObject.Set("Zeile", @"0", true);
			HostObject.WriteLine(HostObject.EvalString(@"STARTPAGE"));
			HostObject.ProcessResource("KopfSeite");
			// -------------------------------------------------

			// **************************************************
			//  Datensatzschleife MENGENEINHEITEN
			HostObject.DefineRecord("recME", "MENGENEINHEITEN", 0, 4, HostObject.EvalString(@"$[recART.EINHEIT>4]"));
			//EOF_recME:
			// **************************************************
			// **************************************************
			//  Datensatzschleife PREISEINHEITEN
			HostObject.DefineRecord("recPE", "PREISEINHEITEN", 0, 2, HostObject.EvalString(@"$[recART.PE>2]"));
			//EOF_recPE:
			// **************************************************
			HostObject.DefineRecord("recKGM", "KALKULATIONSGRUPPEN", 0, 2, HostObject.EvalString(@"$[recART.KGMAT>2]"));
			HostObject.DefineRecord("recKGL", "KALKULATIONSGRUPPEN", 0, 2, HostObject.EvalString(@"$[recART.KGLOHN>2]"));

			HostObject.Set("mPrsFak", @" $[recART.GEBINDE] * $[recPE.FAKTOR]", true);
			HostObject.Set("mEkLohn", @" $[mLohn] * $[recART.ZEIT]", true);
			HostObject.Set("mEkZube", @" $[recART.ZUBEHOERDM]", true);
			HostObject.Set("mEkNe100", @"0", true);
			HostObject.Set("mCuZahl", @" 0", true);
			HostObject.Set("mVk1L", @"   0", true);
			HostObject.Set("mVk1M", @"   0", true);
			HostObject.Set("mEkMat1", @" 0", true);
			HostObject.Set("mVkm21", @"  $[recART.VKM2] / $[mPrsFak]", true);

			// **************************************************
			//  Datensatzschleife NEZUSCHLAEGE
			HostObject.DefineRecord("recNEZ", "NEZUSCHLAEGE", 0, 20, HostObject.EvalString(@"$[recART.LKZ<2]$[recART.ARTNR<18]"));
			while(!HostObject.TestEof("recNEZ"))
			{
				SUB_loop_recNEZ();
				HostObject.SkipRecord("recNEZ");
			}
			// **************************************************


			// -------------------------------------------------
			HostObject.ProcessResource("BasisDaten");
			HostObject.ProcessResource("LagerDaten");

			HostObject.Set("mSaveZl", @"$[Zeile]", true);
			HostObject.ProcessResource("ZBHeader");
			HostObject.Set("Zeile", @"($[Zeile] * 8) / 6", true);
			HostObject.Set("cyZeile", @" 2,54/8", true);
			// **************************************************
			//  Datensatzschleife KLEINTEILE
			HostObject.DefineRecord("recZB", "KLEINTEILE", 0, 20, HostObject.EvalString(@"$[recART.LKZ<2]$[recART.ARTNR<18]"));
			while(!HostObject.TestEof("recZB"))
			{
				SUB_loop_recZB();
				HostObject.SkipRecord("recZB");
			}
			//EOF_recZB:
			// **************************************************
			HostObject.Set("cyZeile", @" 2,54/6", true);
			HostObject.Set("Zeile", @"$[mSaveZl]", true);

			// -------------------------------------------------

			HostObject.Set("mEkMat1", @" ($[recART.EKMAT] / $[mPrsFak]) + ($[mEkNe100] / 100) + $[mEkZube]", true);
			HostObject.Set("mVk1L", @"$[mEkLohn]  * (1 + ($[recKGL.VHLOHN]/100))", true);
			HostObject.Set("mVk1M", @"$[mEkMat1]  * (1 + ($[recKGM.VHMAT] /100))", true);

			if (HostObject.EvalBool("$[recART.ZEIT] > 0"))
				HostObject.Set("mDb1", @"60 * (  (($[mVk1L]+$[mVk1M])-($[mEkMat1]+$[mEkLohn]))/$[recART.ZEIT] )", true);
			else
				HostObject.Set("mDb1", @"0", true);

			HostObject.ProcessResource("EKDaten");
			HostObject.ProcessResource("VKDaten");

			// -------------------------------------------------
			HostObject.Set("mCntZb", @" (8 * ($[ZlMax] - $[Zeile])) / 6", true);
			HostObject.Set("Zeile", @"($[Zeile] * 8) / 6", true);
			HostObject.Set("cyZeile", @" 2,54/8", true);
			HostObject.Set("mSaveZl", @"$[Zeile]", true);
			HostObject.Set("mCntZb", @" $[Zeile] + $[mCntZb]", true);

			HostObject.DefineVariable2("tArt", "C,10,0");
			HostObject.DefineVariable2("tNr", "C,20,0");
			HostObject.DefineVariable2("tTxt", "C,100,0");
			HostObject.ProcessResource("HeadText");

			HostObject.Set("tArt", @"Ang.", true);
			if (HostObject.EvalBool("$[recART.TEXTKZ] <> 2"))
				SUB_Text11();

			HostObject.Set("tArt", @"Rng.", true);
			if (HostObject.EvalBool("$[recART.TEXTKZ] <> 2"))
				SUB_Text12();

			HostObject.Set("tArt", @"Priv", true);
			if (HostObject.EvalBool("$[recART.TEXTKZ] = 2"))
				SUB_Text13();

			HostObject.DefineRecord("recDIM", "DIMENSIONSTEXTE", 0, 20, HostObject.EvalString(@"$[recART.LKZ<2]$[recART.ARTNR<18]"));
			while(!HostObject.TestEof("recDIM"))
			{
				SUB_loopDIM();
				HostObject.SkipRecord("recDIM");
			}

			// -------------------------------------------------
			//  Text aufgelöst drucken
			HostObject.Set("Zeile", @"$[mSaveZl] + 2", true);
			switch(HostObject.EvalString("$[recART.KZDRK1]"))
            {
				case "0":
					SUB_TextSub0();
					break;
				case "1":
					SUB_TextSub1();
					break;
				case "2":
					SUB_TextSub2();
					break;
				case "3":
					SUB_TextSub3();
					break;
				case "4":
					SUB_TextSub4();
					break;
				case "5":
					SUB_TextSub5();
					break;
				case "6":
					SUB_TextSub6();
					break;
				case "7":
					SUB_TextSub7();
					break;
				case "8":
					SUB_TextSub8();
					break;
				case "9":
					SUB_TextSub9();
					break;
			}

			// -------------------------------------------------
			HostObject.Set("cyZeile", @" 2,54/6", true);
			HostObject.Set("Zeile", @"$[ZlMax]", true);
			HostObject.ProcessResource("FussSeite");
			HostObject.WriteLine(HostObject.EvalString(@"ENDPAGE"));
			// -------------------------------------------------

			return HostObject.VariablesPop();
		}

		bool SUB_loop_recZB()
		{
			HostObject.VariablesPush();

			//  Datensatzschleife KLEINTEILE
			//  Datensatzname = recZB

			if (HostObject.EvalBool("$[mCntZb] >= 16"))
				return HostObject.VariablesPop();

			// **************************************************
			//  Datensatzschleife STAMMPOSITIONEN
			HostObject.DefineRecord("recZBA", "STAMMPOSITIONEN", 0, 20, HostObject.EvalString(@"$[recZB.REFLKZ<2]$[recZB.REFARTNR<18]"));
			//EOF_recZBA:
			// **************************************************

			HostObject.ProcessResource("out_recZB");
			HostObject.Set("mCntZb", @"$[mCntZb] + 1", true);

			return HostObject.VariablesPop();
		}

		bool SUB_loop_recNEZ()
		{
			HostObject.VariablesPush();

			//  Datensatzschleife NEZUSCHLAEGE
			//  Datensatzname = recNEZ

			// **************************************************
			//  Datensatzschleife NICHTEISENDATEN
			HostObject.DefineRecord("recNEF", "NICHTEISENDATEN", 0, 2, HostObject.EvalString(@"$[recNEZ.NEKZ<2]"));
			if (HostObject.TestEof("recNEF"))
				return HostObject.VariablesPop();
			// **************************************************

			HostObject.DefineVariable2("TagesPrs", "d,8,6");
			HostObject.DefineVariable2("BasisPrs", "d,8,6");
			HostObject.DefineVariable2("NePrs", "d,8,6");

			HostObject.Set("TagesPrs", @"$[recNEF.TAGESPREIS] / $[recNEF.KGJEPREIS]", true);
			HostObject.Set("BasisPrs", @"$[recNEZ.BASISPREIS] / $[recNEZ.KGJEBASIS]", true);
			HostObject.Set("NePrs", @"   ($[recNEZ.GEWICHT] / $[recNEZ.GEBINDE]) * ($[TagesPrs]-$[BasisPrs])", true);
			HostObject.Set("mEkNe100", @"$[mEkNe100] + (100 * $[NePrs])", true);

			if (HostObject.CompareString("recNEZ.NEKZ", "=", HostObject.EvalString(@"CU")))
				HostObject.Set("mCuZahl", @" $[recNEZ.GEWICHT]", true);


			return HostObject.VariablesPop();
		}

		bool SUB_Text11()
		{
			HostObject.VariablesPush();

			//  TODO: beschreiben Sie hier die Verwendung

			if (HostObject.IsEmpty("recART.TEXTNR"))
				return HostObject.VariablesPop();

			if (HostObject.IsEmpty("recART.LKZTEXTNR"))
				HostObject.DefineRecord("recTXT", "LANGTEXTZEILEN", 0, 22, HostObject.EvalString(@"11$[recART.LKZ<2]$[recART.TEXTNR<18]"));
			else
				HostObject.DefineRecord("recTXT", "LANGTEXTZEILEN", 0, 22, HostObject.EvalString(@"11$[recART.LKZTEXTNR<2]$[recART.TEXTNR<18]"));

			while(!HostObject.TestEof("recTXT"))
			{
				SUB_loopTXT();
				HostObject.SkipRecord("recTXT");
			}


			return HostObject.VariablesPop();
		}

		bool SUB_Text12()
		{
			HostObject.VariablesPush();

			//  TODO: beschreiben Sie hier die Verwendung

			if (HostObject.IsEmpty("recART.TEXTNR"))
				return HostObject.VariablesPop();

			if (HostObject.IsEmpty("recART.LKZTEXTNR"))
				HostObject.DefineRecord("recTXT", "LANGTEXTZEILEN", 0, 22, HostObject.EvalString(@"12$[recART.LKZ<2]$[recART.TEXTNR<18]"));
			else
				HostObject.DefineRecord("recTXT", "LANGTEXTZEILEN", 0, 22, HostObject.EvalString(@"12$[recART.LKZTEXTNR<2]$[recART.TEXTNR<18]"));

			while(!HostObject.TestEof("recTXT"))
			{
				SUB_loopTXT();
				HostObject.SkipRecord("recTXT");
			}

			return HostObject.VariablesPop();
		}

		bool SUB_loopTXT()
		{
			HostObject.VariablesPush();

			//  TODO: beschreiben Sie hier die Verwendung

			if (HostObject.EvalBool("$[Zeile] >= $[mCntZb]"))
				return HostObject.VariablesPop();

			HostObject.Set("tTxt", @"$[recTXT.DATEN]", true);
			HostObject.ProcessResource("outText");

			return HostObject.VariablesPop();
		}

		bool SUB_Text13()
		{
			HostObject.VariablesPush();

			//  TODO: beschreiben Sie hier die Verwendung

			HostObject.DefineRecord("recTXT", "LANGTEXTZEILEN", 0, 22, HostObject.EvalString(@"13$[recART.LKZ<2]$[recART.ARTNR<18]"));
			while(!HostObject.TestEof("recTXT"))
			{
				SUB_loopTXT();
				HostObject.SkipRecord("recTXT");
			}

			return HostObject.VariablesPop();
		}

		bool SUB_loopDIM()
		{
			HostObject.VariablesPush();

			//  TODO: beschreiben Sie hier die Verwendung

			if (HostObject.EvalBool("$[Zeile] >= $[mCntZb]"))
				return HostObject.VariablesPop();

			HostObject.Set("tArt", @"D($[recDIM.KENNUNG])", true);
			HostObject.Set("tNr", @"$[recDIM.LKZTEXTNR]/$[recDIM.TEXTNR]", true);
			HostObject.Set("tTxt", @"$[recDIM.TEXTZEILE]", true);
			HostObject.ProcessResource("outText");

			return HostObject.VariablesPop();
		}

		/*
		bool SUB_outTextExt()
		{
			HostObject.VariablesPush();

			//  TODO: beschreiben Sie hier die Verwendung
			if (HostObject.EvalBool("$[Zeile] >= $[mCntZb]"))
				return HostObject.VariablesPop();


			return HostObject.VariablesPop();
		}

		bool SUB_PosTextSub()
		{
			HostObject.VariablesPush();

			//  TODO: beschreiben Sie hier die Verwendung

			return HostObject.VariablesPop();
		}
		*/

		bool SUB_TextSub0()
		{
			HostObject.VariablesPush();

			//  TODO: beschreiben Sie hier die Verwendung

			HostObject.Set("tTxt", @"$[recART.BEZ1]", true);
			HostObject.ProcessResource("TextExt");

			HostObject.Set("tTxt", @"$[recART.BEZ2]", true);
			HostObject.ProcessResource("TextExt");

			return HostObject.VariablesPop();
		}

		bool SUB_TextSub1()
		{
			HostObject.VariablesPush();

			//  TODO: beschreiben Sie hier die Verwendung

			SUB_Langtext();

			return HostObject.VariablesPop();
		}

		bool SUB_TextSub2()
		{
			HostObject.VariablesPush();

			//  TODO: beschreiben Sie hier die Verwendung

			HostObject.Set("tTxt", @"$[recART.BEZ1]", true);
			HostObject.ProcessResource("TextExt");

			SUB_DimText();

			return HostObject.VariablesPop();
		}

		bool SUB_TextSub3()
		{
			HostObject.VariablesPush();

			//  TODO: beschreiben Sie hier die Verwendung

			SUB_Langtext();
			SUB_DimText();

			return HostObject.VariablesPop();
		}

		bool SUB_TextSub4()
		{
			HostObject.VariablesPush();

			//  TODO: beschreiben Sie hier die Verwendung

			HostObject.Set("tTxt", @"$[recART.BEZ1]", true);
			HostObject.ProcessResource("TextExt");

			HostObject.Set("tTxt", @"$[recART.MERKMAL]", true);
			HostObject.ProcessResource("TextExt");

			SUB_Langtext();

			return HostObject.VariablesPop();
		}

		bool SUB_TextSub5()
		{
			HostObject.VariablesPush();

			//  TODO: beschreiben Sie hier die Verwendung

			HostObject.Set("tTxt", @"$[recART.BEZ1]", true);
			HostObject.ProcessResource("TextExt");

			HostObject.Set("tTxt", @"$[recART.MERKMAL]", true);
			HostObject.ProcessResource("TextExt");

			SUB_DimText();

			return HostObject.VariablesPop();
		}

		bool SUB_TextSub6()
		{
			HostObject.VariablesPush();

			//  TODO: beschreiben Sie hier die Verwendung

			HostObject.Set("tTxt", @"$[recART.BEZ1]", true);
			HostObject.ProcessResource("TextExt");

			HostObject.Set("tTxt", @"$[recART.MERKMAL]", true);
			HostObject.ProcessResource("TextExt");

			SUB_Langtext();
			SUB_DimText();

			return HostObject.VariablesPop();
		}

		bool SUB_TextSub7()
		{
			HostObject.VariablesPush();

			//  TODO: beschreiben Sie hier die Verwendung

			HostObject.Set("tTxt", @"$[recART.BEZ1]", true);
			HostObject.ProcessResource("TextExt");

			HostObject.Set("tTxt", @"$[recART.BEZ2]", true);
			HostObject.ProcessResource("TextExt");

			HostObject.Set("tTxt", @"$[recART.MERKMAL]", true);
			HostObject.ProcessResource("TextExt");

			return HostObject.VariablesPop();
		}

		bool SUB_TextSub8()
		{
			HostObject.VariablesPush();

			//  TODO: beschreiben Sie hier die Verwendung

			HostObject.Set("tTxt", @"$[recART.BEZ1]", true);
			HostObject.ProcessResource("TextExt");

			HostObject.Set("tTxt", @"$[recART.BEZ2]", true);
			HostObject.ProcessResource("TextExt");

			SUB_Langtext();

			if (HostObject.EvalBool("$[Zeile] >= $[mCntZb]"))
				return HostObject.VariablesPop();

			HostObject.Set("tTxt", @"$[recART.MERKMAL]", true);
			HostObject.ProcessResource("TextExt");

			return HostObject.VariablesPop();
		}

		bool SUB_TextSub9()
		{
			HostObject.VariablesPush();

			//  TODO: beschreiben Sie hier die Verwendung

			SUB_Langtext();

			if (HostObject.EvalBool("$[Zeile] >= $[mCntZb]"))
				return HostObject.VariablesPop();

			HostObject.Set("tTxt", @"$[recART.MERKMAL]", true);
			HostObject.ProcessResource("TextExt");

			return HostObject.VariablesPop();
		}

		bool SUB_Langtext()
		{
			HostObject.VariablesPush();

			//  TODO: beschreiben Sie hier die Verwendung

			if (HostObject.EvalBool("$[recART.TEXTKZ] = 2"))
				goto PrivText;

			if (HostObject.IsEmpty("recART.LKZTEXTNR"))
				HostObject.DefineRecord("recLTXT", "LANGTEXTZEILEN", 0, 22, HostObject.EvalString(@"11$[recART.LKZ<2]$[recART.TEXTNR<18]"));
			else
				HostObject.DefineRecord("recLTXT", "LANGTEXTZEILEN", 0, 22, HostObject.EvalString(@"11$[recART.LKZTEXTNR<2]$[recART.TEXTNR<18]"));
			goto DoIt;

			PrivText:
			HostObject.DefineRecord("recLTXT", "LANGTEXTZEILEN", 0, 22, HostObject.EvalString(@"13$[recART.LKZ<2]$[recART.ARTNR<18]"));

			DoIt:
			while(!HostObject.TestEof("recLTXT"))
			{
				SUB_loopLTXT();
				HostObject.SkipRecord("recLTXT");
			}

			return HostObject.VariablesPop();
		}

		bool SUB_loopLTXT()
		{
			HostObject.VariablesPush();

			//  TODO: beschreiben Sie hier die Verwendung

			if (HostObject.EvalBool("$[Zeile] >= $[mCntZb]"))
				return HostObject.VariablesPop();

			HostObject.Set("tTxt", @"$[recLTXT.DATEN]", true);
			HostObject.ProcessResource("TextExt");

			return HostObject.VariablesPop();
		}


		bool SUB_DimText()
		{
			HostObject.VariablesPush();

			//  TODO: beschreiben Sie hier die Verwendung

			HostObject.DefineRecord("recDTXT", "DIMENSIONSTEXTE", 0, 20, HostObject.EvalString(@"$[recART.LKZ<2]$[recART.ARTNR<18]"));
			while(!HostObject.TestEof("recDTXT"))
			{
				SUB_loopDTXT();
				HostObject.SkipRecord("recDTXT");
			}

			return HostObject.VariablesPop();
		}


		bool SUB_loopDTXT()
		{
			HostObject.VariablesPush();

			//  TODO: beschreiben Sie hier die Verwendung

			if (HostObject.EvalBool("$[Zeile] >= $[mCntZb]"))
				return HostObject.VariablesPop();

			// -----------------------------------------------------------------
			if (!HostObject.CompareString("recDTXT.KENNUNG", "=", HostObject.EvalString(@"F")))
				goto NoF;
			HostObject.Set("tTxt", @"$[recDTXT.TEXTZEILE]", true);
			HostObject.ProcessResource("TextExt");
			return HostObject.VariablesPop();
			NoF:

			// -----------------------------------------------------------------
			if (!HostObject.CompareString("recDTXT.KENNUNG", "=", HostObject.EvalString(@"T")))
				goto NoT;
			HostObject.DefineRecord("recLTXT", "LANGTEXTZEILEN", 0, 22, HostObject.EvalString(@"11$[recDTXT.LKZTEXTNR<2]$[recDTXT.TEXTNR<18]"));
			while(!HostObject.TestEof("recLTXT"))
			{
				SUB_loopLTXT();
				HostObject.SkipRecord("recLTXT");
			}
			return HostObject.VariablesPop();
			NoT:

			if (!HostObject.CompareString("recDTXT.KENNUNG", "=", HostObject.EvalString(@"E")))
				goto NoE;
			HostObject.Set("tTxt", @"(Werte: $[recDTXT.TEXTZEILE])", true);
			HostObject.ProcessResource("TextExt");
			HostObject.DefineRecord("recLTXT", "LANGTEXTZEILEN", 0, 22, HostObject.EvalString(@"14$[recDTXT.LKZTEXTNR<2]$[recDTXT.TEXTNR<18]"));
			while(!HostObject.TestEof("recLTXT"))
			{
				SUB_loopLTXT();
				HostObject.SkipRecord("recLTXT");
			}
			return HostObject.VariablesPop();
			NoE:

			return HostObject.VariablesPop();
		}
	}
}
