Wartung / Maintencance - Upgrade Version 8.5.12 - Mittwoch/Wednesday - 2024-08-28 07:30-09:00 a.m.
Beschreibung
Neu: Die Funktion fügt die DDC-Gruppe 0 ans Ende des Datensatzes hinzu.
Historie
Datum |
geändert von |
Beschreibung |
---|---|---|
2011-03-05 |
Althaus |
neu erstellt |
Datei
dnb_scripts_01.js |
Code
function __DDCnotation(intNum) { if (application.activeWindow.getVariable("scr") != "MT") { application.activeWindow.command("k",false); } var strDDC = "54" + intNum + "0 \n54" + intNum + "1 \n54" + intNum + "2 \n54" + intNum + "3 -T1--\n54" + intNum + "3 -T2--\n54" + intNum + "3 -T2--\n"; var strDDCbegin = "54" + intNum + "1"; application.activeWindow.title.endOfBuffer(false); application.activeWindow.title.insertText(strDDC); application.activeWindow.title.findTag(strDDCbegin,0,false,true,false); } function ddc0() { __DDCnotation("0"); } function ddc1() { __DDCnotation("1"); } function ddc2() { __DDCnotation("2"); } function ddcEnde() { var Temp; var ddcNummer; var Kat54x1Inhalt; var Schleife = true; var i = 0; var substr1; var substr2; application.activeWindow.title.startOfField(false); do { Temp = application.activeWindow.title.tag; if ((Temp.substring(0,2) == "54") && (Temp.substring(3,4) == "0")) { /* Anfang der DDC-Gruppe gefunden */ //application.messageBox("0", "Anfang der DDC-Gruppe gefunden", ""); Schleife = false; Temp = application.activeWindow.title.currentField; //application.messageBox("1", Temp, ""); Temp = Temp.replace (/^\s+/, '').replace (/\s+$/, ''); //application.messageBox("2", Temp, ""); if (Temp.length > 5) { /* 54x0 mit Inhalt gefunden, also nur [DDC22ger] voranstellen */ //application.messageBox("0", "54x0 mit Inhalt gefunden, also nur [DDC22ger] voranstellen", ""); application.activeWindow.title.startOfField(false); application.activeWindow.title.wordRight(1,false); application.activeWindow.title.insertText("[DDC22ger]"); } else { /* ohne Inhalt, also [DDC22ger] + Inhalt der Kat 54x1 anfügen */ //application.messageBox("0", "ohne Inhalt, also [DDC22ger] + Inhalt der Kat 54x1 anfügen", ""); application.activeWindow.title.lineDown(1,false); /* zur Kat 54x1 */ application.activeWindow.title.startOfField(false); application.activeWindow.title.wordRight(1,false), application.activeWindow.title.endOfField(true), Temp = application.activeWindow.title.selection; Temp = Temp.replace (/^\s+/, '').replace (/\s+$/, ''); application.activeWindow.title.startOfField(false), application.activeWindow.title.lineUp(1 , false); application.activeWindow.title.endOfField(false); application.activeWindow.title.insertText("[DDC22ger]" + Temp); } } else { i = i + 1 application.activeWindow.title.lineUp(1, false); } } while ((Schleife == true) && (i <= 7)); //application.messageBox("", "löschen leere Kat54x3 - Zeilen (es steht nur -Tx-- da)", ""); application.activeWindow.title.startOfField(false); application.activeWindow.title.lineDown( 3,false); // nach kat54x0 immer drei Zeilen nach unten do { application.activeWindow.title.wordRight( 1, true); Temp = application.activeWindow.title.selection; if ((Temp.substring(0,2) == "54") && (Temp.substring(3,4) == "3")) { Schleife = true; Temp = application.activeWindow.title.currentField; application.activeWindow.title.endOfField(true); Temp = application.activeWindow.title.selection; application.activeWindow.title.startOfField(false); var intLength = Temp.length; var strEnde = Temp.substring(intLength-2,intLength); if (strEnde == "--") { // leere Zeile application.activeWindow.title.deleteLine(1); } else { application.activeWindow.title.lineDown( 1,false); } } else { Schleife = false; } } while (Schleife == true); application.activeWindow.title.endOfBuffer(false); }
VB-Code
Private Sub DDCnotation(strNum) '******************************************************************************** Dim Temp On error resume next If Application.ActiveWindow.Variable("scr") <> "MT" Then Application.ActiveWindow.Command "k", False End If Application.ActiveWindow.Title.EndOfBuffer False Application.ActiveWindow.Title.InsertText "54" & strNum & "0 " & vbLf &_ "54" & strNum & "1 " & vbLf &_ "54" & strNum & "2 " & vbLf &_ "54" & strNum & "3 -T1--" & vbLf &_ "54" & strNum & "3 -T2--" & vbLf &_ "54" & strNum & "3 -T2--" & vbLf Application.ActiveWindow.Title.FindTag "54" & strNum & "1",0,False,True End Sub '***************************************************************************** Sub ddc0() '***************************************************************************** DDCnotation("0") End Sub
Überblick
Inhalte