Using ASP combined with VBScript to simulate stock rolling screen

Source: Internet
Author: User
Tags stock prices
This is a simulation of the stock rolling screen Kanban program, the program will be 10 stock prices and information on the fall of 5 groups each time, the cycle alternating, different from the previous Roll screen left blank. Because of the simplicity of the code, there is no comment here.

<!--sunboy008@sina.com.cn-->
<script language= "VBScript" >
<!--
Dim J,arry1 (Arry2), Arry3 (a), Arry4 (10)

' Define the array of scroll segments, respectively

Arry1 (0) = "Digital Technology"
Arry1 (1) = "Prince Network"
Arry1 (2) = "Little Bang Club"
Arry1 (3) = "Zhengda Group"
Arry1 (4) = "Poly Friend Network"
Arry1 (5) = "All to Technology"
Arry1 (6) = "Tsinghua Violet"
Arry1 (7) = "Creative Technology"
Arry1 (8) = "Zhongguancun"
Arry1 (9) = "Tcl Electronics"

Arry2 (0) = "12.56"
Arry2 (1) = "56.50"
Arry2 (2) = "5.54"
Arry2 (3) = "23.11"
Arry2 (4) = "16.70"
Arry2 (5) = "14.00"
Arry2 (6) = "9.20"
Arry2 (7) = "12.30"
Arry2 (8) = "87.56"
Arry2 (9) = "12.30"


Arry3 (0) = "12.10"
Arry3 (1) = "55.70"
Arry3 (2) = "5.36"
Arry3 (3) = "22.80"
Arry3 (4) = "16.50"
Arry3 (5) = "13.60"
Arry3 (6) = "9.20"
Arry3 (7) = "12.89"
Arry3 (8) = "88.00"
Arry3 (9) = "12.56"


Arry4 (0) = "6.2%"
Arry4 (1) = "-5%"
Arry4 (2) = "1.2%"
Arry4 (3) = "8%"
Arry4 (4) = "-5.6%"
Arry4 (5) = "3%"
Arry4 (6) = "-3%"
Arry4 (7) = "4%"
Arry4 (8) = "-2.2%"
Arry4 (9) = "-6.3%"

' Scrolling program
Sub Toplay ()
J=j+1

For I=0 to 4
A (i). Innerhtml=show1 (J-1+i)
B (i). Innerhtml=show2 (J-1+i)
C (i). INNERHTML=SHOW3 (J-1+i)
D (i). INNERHTML=SHOW4 (J-1+i)
Next

If J>9 then j=0
SetTimeout "Toplay", 2000
End Sub

function Show1 (num)
If Num=>10 Then
Show1=arry1 (NUM-10)
Else
Show1=arry1 (num)
End If
End Function

function Show2 (num)
If Num=>10 Then
Show2=arry2 (NUM-10)
Else
Show2=arry2 (num)
End If
End Function

function show3 (num)
If Num=>10 Then
Show3=arry3 (NUM-10)
Else
Show3=arry3 (num)
End If
End Function

function show4 (num)
If Num=>10 Then
Show4=arry4 (NUM-10)
Else
Show4=arry4 (num)
End If
End Function
-->
</script>
<style>
<!--
td {FONT-SIZE:9PT}
-->
</style>

<body >

<table border= "0" cellpadding= "5" cellspacing= "1" >
<tr>
&LT;TD bgcolor= "#FFCC66" > Securities name </td>
&LT;TD bgcolor= "#FFCC66" > Deal </td>
&LT;TD bgcolor= "#FFCC66" > Opening </td>
&LT;TD bgcolor= "#FFCC66" > Ups </td>
</tr>
<%
For I=0 to 4
Dim bg
Bg= "F0ede6"
If I mod 2=0 then bg= "d2e0f0"
%>
<tr>
&LT;TD id= "A" bgcolor=<%=bg%> align= "right" ></td>
&LT;TD id= "B" bgcolor=<%=bg%> align= "right" ></td>
&LT;TD id= "C" bgcolor=<%=bg%> align= "right" ></td>
&LT;TD id= "D" bgcolor=<%=bg%> align= "right" ></td>
</tr>
<%next%>
</table>

</body>


Note: You can change the number of rows in each group showing the stock, which is set to 5.



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.