Results 1 to 2 of 2

Thread: Minor concerns VBS script

  1. #1
    Adam Williams is offline Junior Member
    Join Date
    Oct 2009
    Posts
    14
    Rep Power
    0

    Default Minor concerns VBS script

    Hello,
    Voila, this morning I was amused to program a little script, especially for fun and learning, but I have a worry. Here is my script:

    msg = InputBox (msg, "What is your name?")
    Time = "It is" & Hour (Now) & "h" & Minute (Now) & "min" & Second (Now) & "sec."
    if Hour (Now) <= 18 then
    Message = "Hello"
    else
    Message = "Hello"
    end if
    if Hour (Now) <= 18 then
    Message2 = "Have a nice day!"
    else
    Message2 = "Have a good evening!"
    end if
    if msg <> "" then
    MsgBox Message & "" & msg & "!" & VbNewLine & vbNewLine & Time & Message2, vbInformation + vbOKOnly vbApplicationModal + + 0, ""
    end if
    if msg = "" then
    MsgBox "Please enter your first name.", VbCritical + vbOKOnly + vbApplicationModal + 0 ""
    end if

    As you can see, if in my inputbox, there is nothing marked the script announces a mistake, either, but I'd like to add a command to return to the top of my script, because then, after the errors in my script closes.

    I hope I was clear on my statement,

    Best regards.

  2. #2
    Adam Williams is offline Junior Member
    Join Date
    Oct 2009
    Posts
    14
    Rep Power
    0

    Default

    time that I meet, I found the solution, but thank you even when:

    Dim msg
    msg = ""
    While msg = ""
    msg = InputBox (msg, "What is your name?")
    Time = "It is" & Hour (Now) & "h" & Minute (Now) & "min" & Second (Now) & "sec."
    if Hour (Now) <= 18 then
    Message = "Hello"
    else
    Message = "Hello"
    end if
    if Hour (Now) <= 18 then
    Message2 = "Have a nice day!"
    else
    Message2 = "Have a good evening!"
    end if
    if msg <> "" then
    MsgBox Message & "" & msg & "!" & VbNewLine & vbNewLine & Time & Message2, vbInformation + vbOKOnly vbApplicationModal + + 0, ""
    end if
    if msg = "" then
    MsgBox "Please enter your first name.", VbCritical + vbOKOnly + vbApplicationModal + 0 ""
    end if

Similar Threads

  1. Seagate FreeAgent GoFlex Desk 3TB minor Hard Drive
    By ThomasBarnes in forum Hard Disk
    Replies: 0
    Last Post: 08-26-2010, 05:29 PM
  2. The end of the performance concerns at TSMC?
    By Geoffrey Boycott in forum Latest Hardware News
    Replies: 0
    Last Post: 01-21-2010, 06:22 AM
  3. Safari 4 fast, but only minor tweaks from beta
    By Cadmus4778 in forum Latest Hardware News
    Replies: 0
    Last Post: 06-09-2009, 05:41 AM
  4. E-Waste concerns and challenges
    By alfie57 in forum Everything Else
    Replies: 0
    Last Post: 02-18-2009, 05:42 AM
  5. Backup concerns
    By allster in forum Windows Vista
    Replies: 0
    Last Post: 01-07-2009, 07:47 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
SEO by SubmitEdge

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48