How to change 7 to 07 in VB Script?

  • Thread starter Thread starter Rider
  • Start date Start date
R

Rider

Hi experts,

Here is my code (test.vbs)
<<<<<<<<<Start

if CHour = 7 then
CHour2 = "07"
CurrentHour = cstr(CHour)
end if

MsgBox " Current Hour " & CurrentHour

If I have the number 7, I want to replace it with 07 in my code. What
is wrong in the above snippet?

In the MsgBox, I see only the Current Hour with no 07 :(

Can you kindly help me out here?

Thanks,
-J
 
You did not assign a value to CHour, so
CurrentHour has no value, so there's nothing
to show.

Also, you're in the wrong group. This group is for
VB.Net, which is not the same thing as VBScript.
For further questions try here:

microsoft.public.scripting.vbscript
 
Back
Top