Rev 13 | Blame | Compare with Previous | Last modification | View Log | RSS feed
<%'=====================================================' FORMATING'=====================================================%><%'-----------------------------------------------------------------------------------------------------------------------------Function EuroDate ( dDate )' Ensures Euro Date format DD/MM/YYYYIf IsNull(dDate) Then Exit FunctionEuroDate = Day(dDate) &"/"& Month(dDate) &"/"& Year(dDate)End Function'-----------------------------------------------------------------------------------------------------------------------------Function EuroDateTime ( dDate )' Ensures Euro DateTime format DD/MM/YYYY H24:MIN:SSIf IsNull(dDate) Then Exit FunctionEuroDateTime = Day(dDate) &"/"& Month(dDate) &"/"& Year(dDate) &" "& FormatDateTime( dDate, 4 )End Function'-----------------------------------------------------------------------------------------------------------------------------Function ToLongDate ( dDate )' DD/MM/YYYY -> Saturday, June 26, 1943If IsNull(dDate) Then Exit FunctionToLongDate = FormatDateTime(dDate, 1)End Function'-----------------------------------------------------------------------------------------------------------------------------Function TO_ORADATE ( SSdate )'DD/MM/YYYY -> ORADATETO_ORADATE = "TO_DATE( '"& SSdate &"','DD/MM/YYYY' )"End Function'-----------------------------------------------------------------------------------------------------------------------------Function ORA_SYSDATE ()ORA_SYSDATE = "TO_DATE( TO_CHAR( SYSDATE,'DD-MON-YYYY' ),'DD-MON-YYYY' )"End Function'-----------------------------------------------------------------------------------------------------------------------------Function ORA_SYSDATETIME ()ORA_SYSDATETIME = "TO_DATE( TO_CHAR( SYSDATE,'DD-MON-YYYY HH24:MI:SS' ),'DD-MON-YYYY HH24:MI:SS' )"End Function'-----------------------------------------------------------------------------------------------------------------------------Function Quotes( SSstr )If InStr(SSstr, "$") > 0 Then' PERL variableQuotes = """"& SSstr & """"Else' Not PERL variableQuotes = "'"& SSstr & "'"End IfEnd Function'-----------------------------------------------------------------------------------------------------------------------------Function To_JATS ( SSbt, SSpkg, SSver )If SSbt = "B" ThenSSbt = "BuildPkgArchive"ElseIf SSbt = "L" ThenSSbt = "LinkPkgArchive"End IfTo_JATS = SSbt &" ( "& Quotes( SSpkg ) &", "& Quotes( SSver ) &" );"End Function'-----------------------------------------------------------------------------------------------------------------------------Function To_ANT ( SSpkg, SSver )To_ANT = "<sandbox name="""& SSpkg &""" version="""& SSver &"""/>"End Function'-----------------------------------------------------------------------------------------------------------------------------Function To_ClearCase ( SSpkgLabel )To_ClearCase = "element * "& SSpkgLabelEnd Function'-----------------------------------------------------------------------------------------------------------------------------Function To_HTML ( sStr )If NOT IsNull(sStr) Then To_HTML = Server.HTMLEncode( sStr )End Function'-----------------------------------------------------------------------------------------------------------------------------Function SQLstring ( SSstr )If IsNull(SSstr) OR (SSstr = "") Then Exit FunctionSQLstring = Replace( Trim(SSstr), "'", "''")End Function'-----------------------------------------------------------------------------------------------------------------------------Function Format4Java ( SSstr )Dim tempSTRtempSTR = SSstrtempSTR = Replace( tempSTR, "'", "\'" )tempSTR = Replace( tempSTR, "<", "\<" )tempSTR = Replace( tempSTR, ">", "\>" )tempSTR = Replace( tempSTR, ";", "\;" )tempSTR = Replace( tempSTR, VBNEWLine, "\n" )Format4Java = tempSTREnd Function'-----------------------------------------------------------------------------------------------------------------------------Function Format4HTML ( SSstr )If IsNull(SSstr) Then Exit FunctionDim tempSTRtempSTR = SSstrtempSTR = Replace( tempSTR, "&", "&" )Format4HTML = tempSTREnd Function'-----------------------------------------------------------------------------------------------------------------------------Function Pipes2Commas ( SSstr )' replaces |1||2||3| to 1,2,3Pipes2Commas = Replace( SSstr, "||", "," )Pipes2Commas = Replace( Pipes2Commas, "|", "" )End Function'-----------------------------------------------------------------------------------------------------------------------------Function QuoteCSV ( SSstr )Dim tempStrtempStr = SSstrIf tempStr = "" ThenQuoteCSV = ""Exit FunctionEnd IftempStr = Replace(tempStr, " ", "") ' remove any spacesQuoteCSV = "'"& Replace( UCase(tempStr), ",", "','") &"'"End Function'-----------------------------------------------------------------------------------------------------------------------------Function QuoteCSVwithLIKE ( SSstr )Dim tempStrtempStr = SSstrIf tempStr = "" ThenQuoteCSVwithLIKE = ""Exit FunctionEnd IftempStr = Replace(tempStr, " ", "") ' remove any spacesQuoteCSVwithLIKE = "'%"& Replace( UCase(tempStr), ",", "','") &"'"End Function'-----------------------------------------------------------------------------------------------------------------------------Function SplitPipes ( SSstr )' split |val1||val2||val3| to arraySplitPipes = Split( Replace( Replace(SSstr,"||","%"), "|","") , "%" )End Function'-----------------------------------------------------------------------------------------------------------------------------Function SplitAmpasans ( SSstr )' split &val1&&val2&&val3& to arraySSstr = Left (SSstr, Len(SSstr)-1) 'remove last &SSstr = Right (SSstr, Len(SSstr)-1) 'remove first &SplitAmpasans = Split( SSstr , "&&" )End Function'-----------------------------------------------------------------------------------------------------------------------------Function URLEncode ( SSstr )Dim tmpStrtmpStr = SSstrtmpStr = Replace(tmpStr, "'", "%27") ' Encode 'tmpStr = Replace(tmpStr, """", "%22") ' Encode "tmpStr = Replace(tmpStr, ",", "%2C") ' Encode ,tmpStr = Replace(tmpStr, ";", "%3B") ' Encode ;tmpStr = Replace(tmpStr, VBNewLine, "%0D%0A") ' Encode new lineURLEncode = tmpStrEnd Function'-----------------------------------------------------------------------------------------------------------------------------Function URLDecode ( SSstr )Dim tmpStrtmpStr = SSstrtmpStr = Replace(tmpStr, "%27", "'") ' Decode 'tmpStr = Replace(tmpStr, "%22", """") ' Decode "tmpStr = Replace(tmpStr, "%2C", ",") ' Decode ,tmpStr = Replace(tmpStr, "%3B", ";") ' Decode ;tmpStr = Replace(tmpStr, "%0D%0A", VBNewLine) ' Decode new lineURLDecode = tmpStrEnd Function'-----------------------------------------------------------------------------------------------------------------------------Function WURLEncode ( sText )If (NOT IsNull(sText)) AND ( sText <> "" ) ThenWURLEncode = Server.URLEncode( sText )ElseWURLEncode = sTextEnd IfEnd Function'-----------------------------------------------------------------------------------------------------------------------------Function HTMLEncode ( sText )If (NOT IsNull(sText)) AND ( sText <> "" ) ThenHTMLEncode = Server.HTMLEncode( sText)ElseHTMLEncode = sTextEnd IfEnd Function'-----------------------------------------------------------------------------------------------------------------------------Function Highlight_Substring ( SSstr, SSsubstr )Dim leftSTR, startPosstartPos = InStr( 1, SSstr, SSsubstr, 1 )If startPos > 0 ThenleftSTR = Left ( SSstr, startPos - 1 )Highlight_Substring = leftSTR &"<SPAN style='background:#ffff99;'>"& Mid( SSstr, startPos, Len(SSsubstr) ) &"</SPAN>"& Right ( SSstr, Len(SSstr) - Len(leftSTR) - Len(SSsubstr) )Else' Subtring not foundHighlight_Substring = SSstrEnd IfEnd Function'-----------------------------------------------------------------------------------------------------------------------------Function NewLine_To_BR (SSstr)If SSstr = "" OR IsNull(SSstr) ThenExit FunctionElseNewLine_To_BR = Replace ( SSstr, VBNewLine, "<br>")End IfEnd Function'-----------------------------------------------------------------------------------------------------------------------------Function IsTicked ( ByVal nParId, ByVal sParList )' Used only with check boxes as they send comma-separated listnParId = ","& Replace(nParId, " ", "") &","sParList = ","& Replace(sParList, " ", "") &","If InStr( sParList, nParId ) > 0 ThenIsTicked = TRUEElseIsTicked = FALSEEnd IfEnd Function'------------------------------------------------------------------------------------------------------------------Function FormatVersion ( ByVal nVersion )Dim arrVersion, MajorVersion, MinorVersionIf IsNull( nVersion ) Then Exit FunctionIf NOT IsNumeric(nVersion) ThenFormatVersion = nVersionExit FunctionEnd IfnVersion = FormatNumber( nVersion, 3 )arrVersion = Split( CStr( nVersion ), ".")MajorVersion = arrVersion(0)MinorVersion = CInt(arrVersion(1))FormatVersion = MajorVersion &"."& MinorVersionEnd Function'-----------------------------------------------------------------------------------------------------------------------------Function GetBuildTypeString( enumBuildType )If (NOT IsNull(enumBuildType)) OR (NOT enumBuildType = "") ThenSelect Case CInt(enumBuildType)Case enumDB_BUILD_TYPE_NONEGetBuildTypeString = "Build type not applicable"Case enumDB_BUILD_TYPE_DEBUGGetBuildTypeString = "Debug"Case enumDB_BUILD_TYPE_PRODGetBuildTypeString = "Production"Case enumDB_BUILD_TYPE_PROD_AND_DEBUGGetBuildTypeString = "Production and Debug"Case enumDB_BUILD_TYPE_JAVA_1_4GetBuildTypeString = "Java 1.4"Case enumDB_BUILD_TYPE_JAVA_1_5GetBuildTypeString = "Java 1.5"End SelectElseGetBuildTypeString = "Build type not defined"End IfEnd Function'-----------------------------------------------------------------------------------------------------------------------------%>