Versionen im Vergleich

Schlüssel

  • Diese Zeile wurde hinzugefügt.
  • Diese Zeile wurde entfernt.
  • Formatierung wurde geändert.

...

Datum

geändert von

Beschreibung

2011-02-02

Althaus

Neu implementiert

2011-02-07

Althaus

Ergänzungen für unterschiedliche Eingabeformate

2011-07-01

Althaus

Fehler beim Aufruf von Scans aus dem Retro II-Projekt (z.B. B003/0064) behoben.
gemeldet durch Petra Fischer am 18.05.2011

Code

dnb_scripte_01formalerschliessung.js

Codeblock
function RetroBild() {

	var strBibliothek;
	var Bibliothek = "DBL";
	var nrKasten;
	var nrBild;
	var boolOK = false;
	var strBoxTitel = "Funktion RetroBild";
	var strBoxText = "Folgende Eingaben sind möglich:\n\n"
					+ "Lxxxx/yyyy		für Retro DNB-L\n"
					+ "Fxxxx/yyyy		für Retro DNB-F\n"
					+ "Dxxxx/yyyy		für Retro DNB-DMA\n"
					+ "xxxx/yyyy		1. vereinfachte Form für DNB-L, wird zu Lxxxx/yyyy\n"
					+ "xxxxyyyy	    	2. Vereinfachte Form für DNB-L, wird zu Lxxxxyyyy\n"
					+ "#xxx/yyyy		# steht für A|B|C|D|E|M|S für Kontingente = Retro2\n"
					+ "Vereinfachte Eingabeform: #xxxyyyy, aus #xxx/yyyy wird R#xxx/yyyy\n\n"
					+ "Beispiel: L2746/0055";
					 
	var strEingabe = __dnbPrompter(strBoxTitel, strBoxText,"");

	if (strEingabe) {
			//application.messageBox("strEingabe", strEingabe, "");
			var intLength = strEingabe.length;
			//application.messageBox("intLength", intLength, "");
			if ((strEingabe == "") || (intLength > 10)) {
					__dnbFehler(strBoxTitel,"Keine Eingabe oder Eingabe zu lang");
			} else {
				
				// Standardeingabe
				var regExp = /[L|F|D]\d\d\d\d\/\d\d\d\d/;
					var regMatch = regExp.exec(strEingabe);
					if ((regMatch) && (intLength == 10)) {
						//application.messageBox("regMatch1", regMatch, "");
						strBibliothek = strEingabe.substring(0,1);
						switch (strBibliothek) {
							case "L":		Bibliothek = "DBL";
											break;
							case "F":		Bibliothek = "DBF";
											break;
							case "D": 		Bibliothek = "DMA";
											break;
							default:		__dnbFehler("Funktion RetroBild","Erstes Zeichen muss L, F oder D sein!","");
						}
						nrKasten = strEingabe.substring(1,5);
						//application.messageBox("nrKasten", nrKasten, "");
						nrBild = strEingabe.substring(6,10);
						//application.messageBox("nrBild", nrBild, "");
						boolOK = true;
					} else {
						// Eingabeform xxxx/yyyy
						regExp = /\d\d\d\d\/\d\d\d\d/;
						regMatch = regExp.exec(strEingabe);
						if ((regMatch) && (intLength == 9)) {
							//application.messageBox("regMatch2", regMatch, "");
							nrKasten = strEingabe.substring(0,4);
							nrBild = strEingabe.substring(5,9);
							boolOK = true;
						} else {
							// Eingabeform xxxxyyyy
							regExp = /\d\d\d\d\d\d\d\d/;
							regMatch = regExp.exec(strEingabe);
							if ((regMatch) && (intLength == 8)) {
								application.messageBox("regMatch3", regMatch, "");
								nrKasten = strEingabe.substring(0,4);
								nrBild = strEingabe.substring(4,8);
								boolOK = true;
							} else {
								// Eingabeform #xxx/yyyy
								regExp = /[A|B|C|D|E|M|S]\d\d\d\/\d\d\d\d/;
								regMatch = regExp.exec(strEingabe);
								if ((regMatch) && (intLength == 9)) {
									//application.messageBox("regMatch4", regMatch, "");
									Bibliothek = "Retro2";
									nrKasten = strEingabe.substring(0,4);
									nrBild = strEingabe.substring(5,9);
									boolOK = true;
								} else {
									// Eingabeform #xxx/yyyy
									regExp = /[A|B|C|D|E|M|S]\d\d\d\d\d\d\d/;
									regMatch = regExp.exec(strEingabe);
									if ((regMatch) && (intLength == 8)) {
										//application.messageBox("regMatch5", regMatch, "");
										Bibliothek = "Retro2";
										nrKasten = strEingabe.substring(0,4);
										nrBild = strEingabe.substring(4,8);
										boolOK = true;
									} else {
									__dnbFehler(strBoxTitel,"Falsches Eingabeformat");
									}
								}
							}
						}
				
						//application.messageBox("Bibliothek", Bibliothek, "");
						//application.messageBox("nrKasten", nrKasten, "");
						//application.messageBox("nrBild", nrBild, "");
						//application.messageBox("Kontrolle","Aufruf für " + Bibliothek + "\nKasten: " + nrKasten + "\nBild:   " + nrBild,"");
					}
				
					if (boolOK) {
						__retro(Bibliothek,nrKasten,nrBild);
					}
						
			}
		
	} 
}

...