M
Mike Wilmot
In converting a page from ASP to ASPX, I am getting the error:
BC30289: Statement cannot appear within a method body. End of method
assumed.
when running the code below. It has something to do with the:
sub DrawComponents(components)
line in the code. What can I do to fix this.
<%
Dim compList
compList = "<OPTION value='airframe'>Airframe - " &
o_aircraft.serial & "</OPTION>"
%>
<table style="display:none;" ALIGN="center" BORDER="0" CELLSPACING="0"
CELLPADDING="0" bgcolor="lightblue">
<%
'Set cmdCalc = Nothing
'Set paramCalc = Nothing
Dim compType, compPosition
DrawComponents (o_aircraft.getEngines())
Response.Write ("</TABLE></TD></TR>")
DrawComponents (o_aircraft.getPropellers())
Response.Write ("</TABLE></TD></TR>")
%>
<%
'****************************CODE BREAKS HERE!!!
sub DrawComponents(components)
dim comp, logbook, compPosition, compCount
compCount = components.count
for each comp in components
If logbook <> comp.logbook Then
If len(logbook) Then Response.Write
("</TABLE></TD></TR>")
logbook = comp.logbook
compPosition = comp.Position
%>
<tr onclick="toggleItem(tr<%=logbook%>,
<%=compCount%>);" class="compHeader">
<td width="100"
align="middle"><%=logbook%></td>
<td width="100"
align="middle"><b>Make</b></td>
<td width="150"
align="middle"><b>Model</b></td>
<td width="150"
align="middle"><b>Serial #</b></td>
<td width="50"
align="middle"><b>TSN</b></td>
<td width="50"
align="middle"><b>CSN</b></td>
<td width="100"
align="middle"><b>TSO/TS Core</b></td>
<td width="100"
align="middle"><b>CSO/CS Core</b></td>
<td width="100"> </td>
</tr>
<tr>
<td colspan="9"><table width="100%"
id="tr<%=logbook%>" style="display:none">
<% End If %>
<tr bgcolor="lightblue">
<td width="100" align="center"><%=
comp.logbook & " " & comp.Position%></td>
<td width="100" align="center"><%=
comp.Make%></td>
<td width="150" align="center"><%=
comp.Model%></td>
<td width="150" align="center"><%=
comp.SerialNumber %></td>
<td width="50" align="right"><%=
comp.CurrentHours%></td>
<td width="50" align="right"><%=
comp.CurrentCycles%></td>
<td width="100" align="right"><%=
comp.TimeSinceOverhaul%></td>
<td width="100" align="right"><%=
comp.CyclesSinceOverhaul%></td>
<td width="100"> </td>
</tr>
<%
compList = compList & "<OPTION value='" &
comp.componentID & "'>" & comp.logbook & " " & _
comp.Position & " - " & comp.SerialNumber &
"</OPTION>"
next
end sub
'*******************************************************************************************************
%>
</td></tr>
</table>
</table>
</body>
</html>
<%
' myConn.Close
%>
BC30289: Statement cannot appear within a method body. End of method
assumed.
when running the code below. It has something to do with the:
sub DrawComponents(components)
line in the code. What can I do to fix this.
<%
Dim compList
compList = "<OPTION value='airframe'>Airframe - " &
o_aircraft.serial & "</OPTION>"
%>
<table style="display:none;" ALIGN="center" BORDER="0" CELLSPACING="0"
CELLPADDING="0" bgcolor="lightblue">
<%
'Set cmdCalc = Nothing
'Set paramCalc = Nothing
Dim compType, compPosition
DrawComponents (o_aircraft.getEngines())
Response.Write ("</TABLE></TD></TR>")
DrawComponents (o_aircraft.getPropellers())
Response.Write ("</TABLE></TD></TR>")
%>
<%
'****************************CODE BREAKS HERE!!!
sub DrawComponents(components)
dim comp, logbook, compPosition, compCount
compCount = components.count
for each comp in components
If logbook <> comp.logbook Then
If len(logbook) Then Response.Write
("</TABLE></TD></TR>")
logbook = comp.logbook
compPosition = comp.Position
%>
<tr onclick="toggleItem(tr<%=logbook%>,
<%=compCount%>);" class="compHeader">
<td width="100"
align="middle"><%=logbook%></td>
<td width="100"
align="middle"><b>Make</b></td>
<td width="150"
align="middle"><b>Model</b></td>
<td width="150"
align="middle"><b>Serial #</b></td>
<td width="50"
align="middle"><b>TSN</b></td>
<td width="50"
align="middle"><b>CSN</b></td>
<td width="100"
align="middle"><b>TSO/TS Core</b></td>
<td width="100"
align="middle"><b>CSO/CS Core</b></td>
<td width="100"> </td>
</tr>
<tr>
<td colspan="9"><table width="100%"
id="tr<%=logbook%>" style="display:none">
<% End If %>
<tr bgcolor="lightblue">
<td width="100" align="center"><%=
comp.logbook & " " & comp.Position%></td>
<td width="100" align="center"><%=
comp.Make%></td>
<td width="150" align="center"><%=
comp.Model%></td>
<td width="150" align="center"><%=
comp.SerialNumber %></td>
<td width="50" align="right"><%=
comp.CurrentHours%></td>
<td width="50" align="right"><%=
comp.CurrentCycles%></td>
<td width="100" align="right"><%=
comp.TimeSinceOverhaul%></td>
<td width="100" align="right"><%=
comp.CyclesSinceOverhaul%></td>
<td width="100"> </td>
</tr>
<%
compList = compList & "<OPTION value='" &
comp.componentID & "'>" & comp.logbook & " " & _
comp.Position & " - " & comp.SerialNumber &
"</OPTION>"
next
end sub
'*******************************************************************************************************
%>
</td></tr>
</table>
</table>
</body>
</html>
<%
' myConn.Close
%>