home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DOS/V Power Report 1997 March
/
VPR9703A.ISO
/
MS_DEV
/
VID
/
SERVER
/
ASF
/
DATA.Z
/
fxn.asp
< prev
next >
Wrap
Text File
|
1996-09-20
|
1KB
|
59 lines
<FONT SIZE=1> Random number: <%=rnd()%> <BR>
Date/time: <%=now()%> <BR>
</font>
<SCRIPT Runat=Server Language=VBScript>
Function Junk
Junk = "Junque"
End Function
</SCRIPT>
<%N = 17%>
<H1>Fibonacci numbers through <%=N%></H1><BR>
<BR>
<BR>
<%Response.Write(Foo)%>
<BR>
<%=Junk%>
<BR>
<SCRIPT Runat=Server Language=VBScript>
Function Foo
Foo = "Foo" & " " & Bar & " " & Junk
End Function
</SCRIPT>
<BR>
<BR>
Computations done via function calls<BR>
<TABLE BORDER>
<%for i = 0 to N%>
<TR>
<TD ALIGN=RIGHT><FONT SIZE=1> <%=i%> </font></TD>
<TD ALIGN=RIGHT><FONT SIZE=2> <% = Fibonacci(i) & " " & Foo %> </font></TD>
</TR>
<%next%>
</TABLE>
<SCRIPT Runat=Server Language=VBScript>
Function Fibonacci(i)
fibA = 1
fibB = 1
if (i = 0) then
Fibonacci = fibA
elseif (i = 1) then
Fibonacci = fibB
elseif (i > 1) then
for j = 2 to i
fib = fibA + fibB
fibA = fibB
fibB = fib
next
Fibonacci = fib
end if
End Function
</SCRIPT>
<SCRIPT Runat=Server Language=VBScript>
Function Bar
Bar = "Bar"
End Function
</SCRIPT>