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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top