here's my code. PLEASE HELP!, what am i typing wrong??
<%@dotnet.itags.org. Page Language="VB" %>
<script runat="server"
' Insert page code here
'
</script>
<html>
<head>
</head>
<body>
<form runat="server">
<%
Dim arrPrimeNos, arrNames
Sub subPrintArray(arrToPrint, iStartValue, iStopValue)
Dim iCounter
For iCounter = iStartValue to iStopValue
Response.Write(arrToPrint(iCounter))
Response.Write("<BR>")
Next
End Sub
arrPrimeNos=Array(2,3,5)
arrName=Array("John","Mary","Bolek")
'call subroutine
subPrintArray arrNames, 2, 3
%
</form>
</body>
</html>1. You'd better put the server side code in <script> tag if you use inline coding. Using <% %> is not a .net way.
2. You can only call a method (function, subrouting or event handler) from a method (function, subrouting or event handler), so your code need to change like this:
<%@. Page Language="VB" %>
<script runat="server"
Sub page_loadDim arrPrimeNos() As Integer = {2, 3, 5}
Dim arrNames() As String = {"John", "Mary", "Bolek"}'call subroutine
subPrintArray arrNames, 2, 3
End SubSub subPrintArray(arrToPrint, iStartValue, iStopValue)
Dim iCounter
For iCounter = iStartValue to iStopValue
Response.Write(arrToPrint(iCounter))
Response.Write("<BR>")
Next
End Sub</script>
<html>
<head>
</head>
<body>
<form runat="server">
</form>
</body>
</html>
thank you very much
0 comments:
Post a Comment