Seitenhistorie
...
Inhalt |
---|
Beschreibung
Auszug |
---|
Nach Aufruf der Funktion öffnet sich ein Eingabefeld zur Suche nach Scan-Nummern unterschiedlicher Retroprojekte. Folgende Eingaben sind möglich Vereinfachte Eingabeform: #xxxyyyy, aus #xxx/yyyy wird R#xxx/yyyy |
Standard-Konfiguration
Die Funktion ist im Pull-Down-Menü Retro... der Funktionsleiste Formalerschliessung enthalten.
Eingabemaske
Historie
Datum | geändert von | Beschreibung |
---|---|---|
2011-02-02 | Althaus | Neu implementiert |
2011-02-07 | Althaus | Ergänzungen für unterschiedliche Eingabeformate |
Datei
dnb_scripte_01.js |
Code
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;
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(1,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(1,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);
}
}
}
}
|
VB-Scriptcode
Codeblock |
---|
Sub RetroBild()
' 26.02.2009 un - Anpassung Retro 2
Dim Eingabetext, Bibo, Kastennr, Bildnr
On Error Resume Next
Eingabetext = InputBox("Bitte Angaben in der Form Xyyyy/zzzz eingeben" & vbCrLf & _
"X = L für DBL" & vbCrLf & _
"X = F für DBF" & vbCrLf & _
"X = D für DMA" & vbCrLf & "yyyy = Kastennummer" & vbCrLf & "zzzz = Bildnummer" & vbCrLf & vbCrLf & _
"Beispiel: L2746/0055","Funktion RetroBild")
If Len(Eingabetext) = 0 Then
Exit Sub
End If
If (Eingabetext = "") Or (Len(Eingabetext) > 10) Then
MsgBox "Falsche Eingabeform", vbOKOnly + vbCritical,"Funktion RetroBild"
Exit Sub
Else
If (Len(Eingabetext) = 9) And (Left(Eingabetext,1) >= "A") Then
Eingabetext = "R" & Eingabetext
ElseIf (Len(Eingabetext) = 8) And (Left(Eingabetext,1) >= "A") Then
Eingabetext = "R" & Eingabetext
ElseIf (Len(Eingabetext) = 8) And IsNumeric(Eingabetext) Then
Eingabetext = "L" & Left(Eingabetext,4) & Right(Eingabetext,4)
ElseIf Len(Eingabetext) = 9 Then
Eingabetext = "L" & Eingabetext
End If
Select Case UCase(Left(Eingabetext,1))
Case "L"
Bibo = "DBL"
Case "F"
Bibo = "DBF"
Case "D"
Bibo = "DMA"
Case "R"
Bibo = "Retro2"
Case Else
MsgBox "Erstes Zeichen muss L, F oder D sein",vbOKOnly + vbCritical,"Funktion RetroBild"
Exit Sub
End Select
End If
Kastennr = Mid(Eingabetext,2,4)
Bildnr = Right(Eingabetext,4)
Call Retro(Bibo,Kastennr,Bildnr)
End Sub
|
Testhinweise
Wurde mit dem im Hilfetext angegebenen Scan getestet.
2011-07-01 | Althaus | Fehler beim Aufruf von Scans aus dem Retro II-Projekt (z.B. B003/0064) behoben. |
Scriptdatei(en)
dnb_formalerschliessung.js, dnb_public.jsSeitenanfang
Überblick
Inhalte