%@ LANGUAGE="VBSCRIPT" %> <% Option Explicit %> <% On Error Resume Next Dim newFileDescription, newFilePaths, insRec, delRec, showText, _ updateRec, updRec, dropStr, spaces, remRecord, remDispRecord '----------Localization Variables----------------- Dim bckSlash, colon, semiColon, period bckSlash = chr(92) colon = chr(58) semiColon = chr(59) period = chr(46) '----------Query strings------------------------- newFileDescription = request.querystring("newDescription") newFilePaths = request.querystring("newFilePath") remRecord = request.querystring("remRecord") remDispRecord = request.querystring("remDispRecord") updateRec = request.querystring("updateRec") showText = Myinfo.ShowText dropStr = Myinfo.dropStr '------------Call Subs and Functions----------------- If remDispRecord <> "" Then 'Remove a record from the display removeDisplayRecords remDispRecord End If If updateRec <> "" Then 'Update a description updateRecords updateRec, newFileDescription End If If remRecord <> "" Then 'Remove a record removeRecords remRecord End If If newFilePaths <> "" Then 'Add records addRecords newFilePaths, newFileDescription End If '--------------Subs and Functions------------------- Sub removeDisplayRecords(Record) Dim strDisplay, strFull, n strFull = Myinfo.strFull strDisplay = Myinfo.strDisplay n = Myinfo.NumRecords strFull = ParseStr(strFull, Record) strDisplay = ParseStr(strDisplay, Record) n = n - 1 Myinfo.NumRecords = n Myinfo.strFull=strFull Myinfo.strDisplay=strDisplay Myinfo.sync = 0 End Sub Sub updateRecords(Records, Description) Dim strFull, strDisplay, updRec strFull = Myinfo.strFull strDisplay = Myinfo.strDisplay Description = " " + Description strFull = AddAttrib(strFull, Records, "UPDATE", Description) strDisplay = EditStr(strDisplay, Records, Description) updRec = 1 Myinfo.sync = 0 Myinfo.strFull = strFull Myinfo.strDisplay = strDisplay Myinfo.updRec = updRec Myinfo.Descrip = Description End Sub Sub addRecords(Records, Description) Dim strFull, strDisplay, n, posSemiCol, Record, FileName, FilePath, _ strAddDisplay, insRec, addDisplay, FileDescription strFull = Myinfo.strFull strDisplay = Myinfo.strDisplay n = Myinfo.NumRecords If instrRev(Records, bckSlash + bckSlash ) <> 0 Then Records = Trim(Left(Records, len(Records) - 1)) End If Do posSemiCol=instr(Records, semiColon) If posSemiCol = 0 Then Exit Do n = n + 1 Record = Left(Records, posSemiCol - 1) FileName = Trim(Right(Record,Len(Record) - InstrRev(Record,bckSlash))) FilePath = Trim(Right(Record, len(Record)-(instr(Record, bckSlash) - 3))) Records = Trim(Right(Records, len(Records) - posSemiCol)) If Description = "" Then Description = " " End If strAddDisplay = strAddDisplay + " " + FileName + " " + Description + semiColon strFull = strFull + " " + FileName + " " + Description + " " + FilePath + " INSERT;" Loop insRec = 1 addDisplay = 1 strDisplay = strDisplay + strAddDisplay Myinfo.sync = 0 Myinfo.insRec = insRec Myinfo.NumRecords = n Myinfo.strFull=strFull Myinfo.strDisplay=strDisplay Myinfo.addDisplay = addDisplay End Sub Sub removeRecords(Record) Dim strDisplay, strFull, n, none strFull = Myinfo.strFull strDisplay = Myinfo.strDisplay n = Myinfo.NumRecords none = "" strFull = AddAttrib(strFull, Record, "DELETE", none) strDisplay = ParseStr(strDisplay, Record) n = n - 1 Myinfo.NumRecords = n Myinfo.strFull=strFull Myinfo.strDisplay=strDisplay Myinfo.sync = 0 End Sub Function ParseStr(BigStr, SmallStr) Dim leftStr, rightStr BigStr = Trim(BigStr) SmallStr = Trim(SmallStr) leftStr = Left(BigStr, instr(BigStr, SmallStr) -1 ) rightStr = Right(BigStr, len(BigStr) - instr(instr(BigStr, SmallStr), BigStr, semiColon)) ParseStr = leftStr + rightStr End Function Function AddAttrib(BigStr, SmallStr, Attrib, addString) Dim leftStr, rightStr BigStr = Trim(BigStr) SmallStr = Trim(SmallStr) Attrib = Trim(Attrib) leftStr = Left(BigStr, instr(instr(BigStr, SmallStr), BigStr, semiColon) -1) rightStr = Right(BigStr, len(BigStr) - instr(instr(BigStr, SmallStr), BigStr, semiColon)) AddAttrib = leftStr + " " + Attrib + addString + semiColon + rightStr End Function Function EditStr(BigStr, SmallStr, newText) Dim leftStr, rightStr, rightStrPart, leftStrPart BigStr = Trim(BigStr) SmallStr = Trim(SmallStr) newText = Trim(newText) rightStrPart = Right(BigStr, len(BigStr) - (instr(BigStr, Trim(SmallStr))-1)) leftStrPart = Left(BigStr, instr(BigStr, Trim(SmallStr))-1) leftStr = Left(BigStr, len(leftStrPart) + (instr(rightStrPart, period) + 3)) rightStr = Right(rightStrPart, len(rightStrPart) - (instr(RightStrPart, semiColon))) EditStr = leftStr + " " + newText + semiColon + rightStr End Function Sub setSpaces Dim i, boxWidth, addDisplay boxWidth = Myinfo.Width addDisplay = Myinfo.addDisplay If addDisplay = 1 OR boxWidth = 1 Then For i = 1 to 107 spaces = spaces + "
" Next Else For i = 1 to 120 spaces = spaces + "
" Next End If End Sub %>