[thelist] VB question

Lee Martin lee at stumpymoose.com
Tue Jan 21 01:50:01 CST 2003


That's the one. Cheers Scott.

Lee

-----Original Message-----
From: thelist-admin at lists.evolt.org
[mailto:thelist-admin at lists.evolt.org] On Behalf Of Scott Webster
Sent: 21 January 2003 07:48
To: thelist at lists.evolt.org
Subject: Re: [thelist] VB question

Hi Lee

I'm not a VB script guy, but if you're casting second(),
this will return values between 0-59 not just 0-9.

So this means if the page is requested from the server
at any time where the second value is greater than
hh:mm:08, your client will be redirected to splashpage5.htm.
ie. ~84% of the time

What you probably want is to use the MOD operator on 't'.


t = second(time) MOD 10
select case t
    case 0,1,2
        window.open "splashpage1.htm"
    case 3,4
...

hope that helps
Scott

----- Original Message -----
From: "Lee Martin" <lee at stumpymoose.com>


: Rob
:
: Thanks for the help, but this still continues to go to page 5. Doesn't
: seem to make sense..
:
: Lee
:
: -----Original Message-----
: From: thelist-admin at lists.evolt.org
:
: Hi Lee, welcome to the list ::
:
: Try this..
: <script type="text/vbscript">
: Dim t
: t=second(time)
: select case t
: case 1,2
: window.open "splashpage1.htm"
: case 3,4
: window.open "splashpage2.htm"
: case 5,6
: window.open "splashpage3.htm"
: case 7,8
: window.open "splashpage4.htm"
: case 9
: window.open "splashpage5.htm"
: case else
: window.open "splashpage5.htm"
: end select
: t = ""
: </script>
:
:
: -----Original Message-----
: From: Lee Martin [mailto:lee at stumpymoose.com]
: Sent: Monday, January 20, 2003 3:36 PM
: To: thelist at lists.evolt.org
: Subject: [thelist] VB question
:
:
: Hello all. I'm new to this list. Been reading the list for a while,
and
: now I need a little help.
:
: This script works fine the first few times, but if I go back to the
: page, the value for the time appears to accumulate, forcing each
result
: into the final condition. After a few visits, you only get directed to
: splashpage5.htm. Is this what is happening? How can I reset this at
the
: end of the statement?
:
: <script type="text/vbscript">
: t=second(time)
: select case t
: case 1
: window.open "splashpage1.htm"
: case 2
: window.open "splashpage1.htm"
: case 3
: window.open "splashpage2.htm"
: case 4
: window.open "splashpage2.htm"
: case 5
: window.open "splashpage3.htm"
: case 6
: window.open "splashpage3.htm"
: case 7
: window.open "splashpage4.htm"
: case 8
: window.open "splashpage4.htm"
: case 9
: window.open "splashpage5.htm"
: case else
: window.open "splashpage5.htm"
: end select
: </script>


--
* * Please support the community that supports you.  * *
http://evolt.org/help_support_evolt/

For unsubscribe and other options, including the Tip Harvester
and archives of thelist go to: http://lists.evolt.org
Workers of the Web, evolt !





More information about the thelist mailing list