From: Rider on
Hi experts,

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

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

MsgBox " Current Hour " & CurrentHour

>>>>>>End

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
From: mayayana on
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

>
> if CHour = 7 then
> CHour2 = "07"
> CurrentHour = cstr(CHour)
> end if
>
> MsgBox " Current Hour " & CurrentHour
>
> >>>>>>End
>
> 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