TIP: Click on subject to list as thread! ANSI
echo: visual_basic
to: All
from: Trevor Watson
date: 2004-06-14 13:01:00
subject: Re: Need vb code to trigg

Not sure why your code wouldn't work.  My best guess is that time elapsed
past the time you wanted while you were still getting the date (i.e. took
more than a second to do the 3 lines of code that get the date and compare).
But i could be wrong.

    I personally would (not that there probably isn't a better way to do
this) compare the time as a string doing all formatting on one line.  That
way everything is calculated and evalutated at the same time.  The code
snippet below shows what i did.

    You might also want to look into the DateDiff function.  This compares 2
dates, but you'd need to create a date for the exact time you wanted to
check, if you just give it a time, it defaults to Jan 01/1980 or some date.

Trevor Watson


---------- Start Code Snippet -----
Public Function time_compare(dTime As Date) As Boolean
 'Hh = Hours - 24-Hour clock with leading zeros
 'Nn = Minutes with Leading zeros
 'Ss = Seconds with leading zeros
 If Format(dTime, "Hh:Nn:Ss") = Format(Now, "Hh:Nn:Ss") Then
    time_compare = True
 Else
    time_compare = False
 End If
End Function

----- End Code Snippet -----
---
þ RIMEGate(tm)/RGXPost V1.14 at BBSWORLD * Info{at}bbsworld.com

---
 * RIMEGate(tm)V10.2áÿ* RelayNet(tm) NNTP Gateway * MoonDog BBS
 * RgateImp.MoonDog.BBS at 6/14/04 1:01:02 PM
* Origin: MoonDog BBS, Brooklyn,NY, 718 692-2498, 1:278/230 (1:278/230)
SEEN-BY: 633/267 270
@PATH: 278/230 10/345 106/1 2000 633/267

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.