Hopefully "ScriptingTipsAndTricks" helps you with your batch file or vbscript scripting :-)
[Bottom][Contents][Prev]: GetEnv() - Get Environment Variables[Next]: MkObject() - Create COM Object with Error Checking
\->VBSCRIPT Files->LPad0() - Pad a value with zeros but never truncate

[anchor]

The Code for: "LPad0() [Pad a value with zeros but never truncate].vbs.txt"

This is the example, a shortcut was installed to this code :

'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
' $Header:   C:/DBAREIS/Projects.PVCS/Win32/ScriptingTipsAndTricks/EXAMPLE[vbs].LPad0() [Pad a value with zeros but never truncate].vbs.txt.pvcs   1.0   29 Jun 2014 12:51:22   USER "Dennis"  $
'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@



'============================================================================
function LPad0(Str, PadLen)
'============================================================================
   if   len(Str) >= PadLen then
        LPad0 = Str
   else
       LPad0 = right(string(PadLen, "0") & Str, PadLen)
   end if
end function


Microsoft awarded me an MVP (Most Valuable Professional award) in 2004, 2005, 2006, 2007, 2008 & 2009 for the Windows SDK (Windows Installer) area.Please email me any feedback, additional information or corrections.
See this page online (look for updates)

[Top][Contents][Prev]: GetEnv() - Get Environment Variables[Next]: MkObject() - Create COM Object with Error Checking


ScriptingTipsAndTricks© is (C)opyright Dennis Bareis 2003-2008 (All rights reserved).
Sunday September 07 2014 at 12:50pm
Visit ScriptingTipsAndTricks's Home Page
Microsoft awarded me an MVP (Most Valuable Professional award) in 2004, 2005, 2006, 2007, 2008 & 2009 for the Windows SDK (Windows Installer) area.