Seitenhistorie
...
Codeblock |
---|
function RetroBild() { var strBibliothek; var Bibliothek = "DBL"; var nrKasten; var nrBild; var boolOK = false; var strBoxTitel = "Funktion RetroBild"; var strBoxText = "BitteFolgende AngabenEingaben in der Form Xyyyy/zzzz eingebensind möglich:\n\n" + "Lxxxx/yyyy für Retro DNB-L\n" + "X = L für DBLFxxxx/yyyy für Retro DNB-F\n" + "Dxxxx/yyyy für Retro DNB-DMA\n" + "X = F für DBFxxxx/yyyy 1. vereinfachte Form für DNB-L, wird zu Lxxxx/yyyy\n" + "X = D für DMAxxxxyyyy 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 Desiderata = KastennummerRetro2\n" + "zzzz = BildnummerVereinfachte 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, ""); if (strEingabe) { var intLength = strEingabe.length; if ((strEingabe == "") || (intLength > 10)) { __dnbFehler("Funktion Retrobild","Falsche EingabeformstrBoxTitel,"Keine Eingabe oder Eingabe zu lang"); } else { /* Nach Rückfrage bei Harald Unger zu ergänzen: 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 */ var strBibliothek = strEingabe.substring(0,1); switch (strBibliothek) { case "L": Bibliothek = "DBL/ 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"; breaknrKasten = strEingabe.substring(1,4); nrBild = strEingabe.substring(5,9); case "F": BibliothekboolOK = "DBF"true; } else { break; // Eingabeform #xxx/yyyy case "D": Bibliothek = "DMA"regExp = /[A|B|C|D|E|M|S]\d\d\d\d\d\d\d/; regMatch = regExp.exec(strEingabe); break; if ((regMatch) && (intLength == 8)) { case//application.messageBox("regMatch5", regMatch, "R": "); Bibliothek = "Retro2"; breaknrKasten = strEingabe.substring(1,4); default: __dnbFehler("Funktion RetroBild","Erstes Zeichen muss L, F oder D sein!",""); nrBild = strEingabe.substring(4,8); boolOK = true; } else { __dnbFehler(strBoxTitel,"Falsches Eingabeformat"); } } var nrKasten = strEingabe.substring(1,5 } } //application.messageBox("Bibliothek", Bibliothek, ""); //application.messageBox("nrKasten", nrKasten, ""); var//application.messageBox("nrBild", nrBild = strEingabe.substring(6,10, ""); //application.messageBox("nrBildKontrolle","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 |
...
Überblick
Inhalte