'/@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@/ Function FormatBytes(ByVal b) Dim bSize(8) Dim i bSize(0) = "Bytes" bSize(1) = "KB" 'Kilobytes bSize(2) = "MB" 'Megabytes bSize(3) = "GB" 'Gigabytes bSize(4) = "TB" 'Terabytes bSize(5) = "PB" 'Petabytes bSize(6) = "EB" 'Exabytes bSize(7) = "ZB" 'Zettabytes bSize(8) = "YB" 'Yottabytes b = CDbl(b) For i = UBound(bSize) To 0 Step -1 If b >= (1024 ^ i) Then FormatBytes = ThreeNonZeroDigits(b / (1024 ^ _ i)) & " " & bSize(i) Exit For End If Next End Function '/@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@/ Public Function nameHour(Value) Dim vHour vHour = DatePart("h",now()) If vHour > 12 and vHour < 19 then nameHour = "Buenas Tardes" end if If vHour > 18 then nameHour = "Buenas Noches" end if If vHour >= 0 and vHour < 13 then nameHour = "Buenos Dias" end if End Function '/@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@/ Public Function getToday() End Function '/@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@/ Function FormatNumberEx(Value, DecimalPlaces) FormatNumberEx = FormatNumber(nz(Value, 0),DecimalPlaces) End Function '/@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@/ Function FormatDateEx(value, mType) Dim month_ex, day_ex, year_ex If nz(value, "") <> "" Then Select Case mType Case 2: ' From value = value & " 00:00:01" value = NDPNTMJFNRNPXFFGL.getConvertLocalToUTC(cDate(value), cDbl(mTimeZoneValue)) FormatDateEx = value exit function Case 3: ' To value = value & " 23:59:59" value = NDPNTMJFNRNPXFFGL.getConvertLocalToUTC(cDate(value), cDbl(mTimeZoneValue)) FormatDateEx = value exit function Case 4: ' Mostrar value = NDPNTMJFNRNPXFFGL.getConvertUTCtoLocal(cDate(value), cDbl(mTimeZoneValue)) Case 5: ' Mostrar Date and Time value = NDPNTMJFNRNPXFFGL.getConvertLocalToUTC(cDate(value), cDbl(mTimeZoneValue)) FormatDateEx = value exit function End Select month_ex = Month(value) day_ex = Day(value) If Len(month_ex) = 1 Then month_ex = "0" & month_ex If Len(day_ex) = 1 Then day_ex = "0" & day_ex If mType = 6 Then FormatDateEx = month_ex & "/" & day_ex & "/" & right(Year(value), 2) else FormatDateEx = month_ex & "/" & day_ex & "/" & Year(value) End If End If End Function '/@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@/ Function FormatTimeEx(value) If nz(value, "") <> "" Then value = NDPNTMJFNRNPXFFGL.getConvertUTCtoLocal(cDate(value), cDbl(mTimeZoneValue)) FormatTimeEx=FormatDateTime(value,4) End If End Function '/@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@/ Function DateName(value, dateType) Dim month_ex, day_ex, year_ex If nz(value, "") <> "" Then value = NDPNTMJFNRNPXFFGL.getConvertUTCtoLocal(cDate(value), cDbl(mTimeZoneValue)) Select Case DateType Case 1: DateName = WeekdayName(Weekday(value)) & ", " & Day(value) & " " & MonthName(Month(value)) & " of " & Year(value) Case 2: DateName = Day(value) & " " & MonthName(Month(value)) Case 3: DateName = WeekdayName(Weekday(value)) & " " & Day(value) & ", " & MonthName(Month(value)) Case 4: DateName = WeekdayName(Weekday(value)) Case 5: DateName = MonthName(Month(value), True) & " " & Iif(len(Day(value)) = 1, "0", "") & Day(value) Case 6: DateName = MonthName(Month(value)) Case 7: DateName = Day(value) & " of " & MonthName(Month(value)) & " of " & Year(value) Case 8: DateName = WeekdayName(Weekday(value), True) & " " & Day(value) Case 9: DateName = "Today is " & MonthName(Month(value), True) & " " & Day(value) & ", " & Year(value) Case 10: DateName = MonthName(Month(value), True) & " " & Day(value) & ", " & Year(value) Case 11: DateName = MonthName(Month(value), True) & " " & Day(value) & ", " & Year(value) & " - " & FormatDateTime(value, vbShortTime) Case 12: DateName = FormatDateEx(value, 1) & " - " & FormatDateTime(value, vbShortTime) Case 13: value = TMJFNRNPXFFGL.getConvertLocaltoUTC(cDate(value), cDbl(mTimeZoneValue)) DateName = MonthName(Month(value), True) & " " & Day(value) & ", " & Year(value) & " - " & FormatDateTime(value, vbShortTime) Case 14: DateName = FormatDateEx(value, 6) Case 15: DateName = FormatDateEx(value, 1) & " " & FormatDateTime(value, vbShortTime) Case 16: DateName = WeekdayName(Weekday(value)) & ", " & MonthName(Month(value), false)& " " & Day(value) & ", " & Year(value) & ", " & FormatDateTime(value, vbShortTime) Case 17: DateName = cStr(Day(value)) & "/" & cStr(Month(value)) & "/" & cStr(Year(value)) & " " & cStr(FormatDateTime(value, vbShortTime)) End Select End If End Function '/@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@/ Function monthNameEx(month_ex) Dim month_Name Select Case month_ex Case 1: month_Name = "Enero" Case 2: month_Name = "Febrero" Case 3: month_Name = "Marzo" Case 4: month_Name = "Abril" Case 5: month_Name = "Mayo" Case 6: month_Name = "Junio" Case 7: month_Name = "Julio" Case 8: month_Name = "Agosto" Case 9: month_Name = "Setiembre" Case 10: month_Name = "Octubre" Case 11: month_Name = "Noviembre" Case 12: month_Name = "Diciembre" End Select monthNameEx = month_Name End Function '/@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@/ Public Function nameHour(Value) Dim vHour vHour = DatePart("h",now()) If vHour > 12 and vHour < 19 then nameHour = "Buenas Tardes" end if If vHour > 18 then nameHour = "Buenas Noches" end if If vHour >= 0 and vHour < 13 then nameHour = "Buenos Dias" end if End Function '/@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@/ Public Function ConvertDecimalToTime(DecimalValue) If IsNull(DecimalValue) Then Exit Function If Not IsNumeric(DecimalValue) Then Exit Function Dim mHour, mMinute, mNameTime mHour = Int(DecimalValue) If Len(mHour) <> 2 Then mHour = "0" & mHour mMinute = CInt((DecimalValue - Int(DecimalValue)) * 60) If Len(mMinute) <> 2 Then mMinute = "0" & mMinute ConvertDecimalToTime = mHour & ":" & mMinute End Function '/@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@/ Public Function getMainContact(mContactMethodTypeFormat, mPhoneCountryCode, mPhoneAreaCode, mPhoneNumber, mPhoneAnnex, mEmailAddress, mWebAdddress) Dim mGetMainContact Select Case nz(mContactMethodTypeFormat, 0) Case 1 If nz(mPhoneNumber, "") <> "" Then mGetMainContact = IIF(nz(mPhoneCountryCode, "") = "", "", "+" & mPhoneCountryCode) & " " & IIF(nz(mPhoneAreaCode, "") = "", "", "(" & mPhoneAreaCode & ")") & " " & mPhoneNumber & IIF(nz(mPhoneAnnex, "") = "", "", " x " & mPhoneAnnex) End If Case 2 mGetMainContact = mEmailAddress Case 3 mGetMainContact = mWebAdddress End Select getMainContact = mGetMainContact End Function '/@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@/ Public Function getPersonAddress(mPersonAddress1, mPersonAddress2, mPersonPostalCode, mPersonAddressCity, mStateName, mCountryName) Dim mGetPersonAddress mGetPersonAddress = IIF(nz(mPersonAddress1, "") = "", "", mPersonAddress1 & ", ") & IIF(nz(mPersonAddress2, "") = "", "", mPersonAddress2 & ", ") & IIF(nz(mPersonAddressCity, "") = "", "", mPersonAddressCity & ", ") & mCountryName getPersonAddress = mGetPersonAddress End Function '/@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@/ Public Function getPersonAddressShipDoc(mPersonAddress1, mPersonAddress2, mPersonPostalCode, mPersonAddressCity, mStateCode, mStateName, mCountryName) Dim mGetPersonAddressShipDoc mGetPersonAddressShipDoc = IIF(nz(mPersonAddress1, "") = "", "", mPersonAddress1 & " ") & IIF(nz(mPersonAddress2, "") = "", "", mPersonAddress2 & ", ") & IIF(nz(mPersonAddressCity, "") = "", "", mPersonAddressCity & ", ") & IIF(nz(mStateCode, "") = "" OR IsNumeric(nz(mStateCode, "")), IIF(nz(mStateName, "") = "", "", mStateName & ", "), mStateCode & ", ") & IIF(nz(mPersonPostalCode, "") = "", "", mPersonPostalCode & ", ") & mCountryName getPersonAddressShipDoc = mGetPersonAddressShipDoc End Function