Forums before death by AOL, social media and spammers... "We can't have nice things"
|    alt.msdos.batch    |    Fun with MS-DOS batch files    |    42,547 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 41,865 of 42,547    |
|    Arlen Holder to All    |
|    Re: Found this speaking time vbs batch s    |
|    13 Jun 20 05:13:33    |
   
   XPost: alt.comp.freeware, alt.comp.os.windows-10   
   From: arlenholder@newmachine.com   
      
   On Thu, 11 Jun 2020 21:38:47 -0500, *Char Jackson* wrote:   
      
   > I spent 20 seconds...   
      
   This improvement takes into account common (Am)English vernacular.   
   o *As always, please improve so that all benefit from every post*.   
      
   Note: I tested that VBS below briefly for only four key conditions:   
   (1) Meridium indication (i.e., AM or PM)   
   (2) 'Oh clock' indication (i.e., at zero minutes)   
   (3) 'Oh' indication (i.e., from one to nine minutes)   
   (4) 'Oh No' indication (i.e., from ten to fifty-nine minutes)   
      
   Dim speaks, speech   
   hour_now=hour(time)   
      
   if hour_now > 12 or hour_now = 12 Then   
   hour12 = hour_now - 12   
   ampm = "PM"   
   Else   
   hour12 = hour_now   
   hourfinal = hour_now   
   ampm = "AM"   
   End If   
      
   If hour12 = 10 Then   
   hourfinal = "Ten"   
   Elseif hour12 = 11 Then   
   hourfinal = "Eleven"   
   Elseif hour12 = 12 Then   
   hourfinal = "Twelve"   
   Elseif hour12 = 0 Then   
   hourfinal = "Twelve"   
   Elseif hour12 > 0 and hour12 < 10 Then   
   hourfinal = hour12   
   End If   
      
   min_now=minute(time)   
      
   if min_now = 0 Then   
   ohno = " "   
   min_now = " "   
   Elseif min_now > 0 and min_now < 10 Then   
   ohno = " oh "   
   Else min_now=minute(time)   
   End If   
      
   speaks = "It is " & hourfinal & ohno & min_now & ampm   
   Set speech=CreateObject("sapi.spvoice")   
   speech.Speak speaks   
   --   
   Mostly based on this script but modified by me to add minutes:   
   
|
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca