Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Jul 2002
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Could this be done in JAVA?

    I have an event creator written in ASP which saves the current event as a HTML file...

    What needs to be done is to check the current events file to see if its older than 3 hours, if its is then it'll show no events or no_events.html, else show the current event etc.

    ...
    Last edited by Barabbas; 07-07-2002 at 10:33 AM.

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    Nashua, NH
    Posts
    1,724
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Why would you want to do it in JS when it can be easily accomplished server side in ASP, that you are using
    Vladdy | KL
    "Working web site is not the one that looks the same on common graphical browsers running on desktop computers, but the one that adequately delivers information regardless of device accessing it"

  • #3
    New to the CF scene
    Join Date
    Jul 2002
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thumbs up

    You know when you get to that stage when you just can't get your head around a peice of code and start pulling your hair out to look for alternatives...

    Well i've sorted it now, thanks for the reply, after the 60th view!!!!!!! lol

    Heres what i came up with:

    <%

    Dim MyFileObject, MyFile, MyFileTrue, TimeOut, RealTime
    Set MyFileObject=Server.CreateObject("Scripting.FileSystemObject")
    set MyFile=MyFileObject.GetFile(Server.MapPath("current_event.htm"))

    RealTime = hour(now)
    TimeOut = hour(MyFile.DateLastModified) + 3 ' Put timeout at 3 ours ahead of the creation date

    If RealTime < TimeOut AND day(now) = day(MyFile.DateLastModified)Then
    %>
    <!--#include file="current_event.htm"-->
    <%
    Else
    %>
    <!--#include file="none.htm"-->
    <%
    end if
    Set MyFileObject = nothing
    Set MyFile = nothing
    set RealTime = nothing
    set TimeOut = nothing

    %>


  •  

    Posting Permissions

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