i really need to have things run more effecient. currently
i have a function that numbers cells on a page retreived by aspTear, this part of the code is fine:
Then since i need the infor from may cells, and need it so that each cell info is set to a variable, i have this ugly code:
then i need to take these variables of cell infomation and format the string so it excludes certain information and then i set the variable information into a table:
And i also have a "string formating script" and a "table layout" with the variable and formatted variable information in it representing for each block of code previously displayed liuke so:
variable57 = GetCell(57, "
i have a function that numbers cells on a page retreived by aspTear, this part of the code is fine:
Code:
<%
Function GetCell(cellnumber, extracturl)
Const Request_POST = 1
Const Request_GET = 2
Set xObj = Server.CreateObject("SOFTWING.AspTear")
strRetVal = xObj.Retrieve(extracturl,Request_GET,"","","")
set xobj = nothing
i = 1 ' HTML Text Location Start
q = 1 ' Cell Number Start
' Loop until we have processed the cell we're looking for
Do until q > cellnumber
' Look for <TD the start of a cell
i = InStr(i, UCase(strRetVal), "<TD")
' Find the location of the end of the <TD tag
r = InStr(i, strRetVal, ">")
' Let the next loop start looking after this <TD tag we found
i = r + 1
' increase the count of which cell we're at
q = q + 1
Loop
' The start of our cell text is right after the last found tag
StartCellText = i
If (InStr(r, UCase(strRetVal), "<TABLE") > 0) AND _
(InStr(r, UCase(strRetVal), "<TABLE") < _
InStr(r, UCase(strRetVal), "</TD>")) then
ThisCellText = mid(strRetVal, StartCellText, _
InStr(r, UCase(strRetVal),"<TABLE")- StartCellText )
Else
ThisCellText = mid(strRetVal, StartCellText, _
InStr(r, UCase(strRetVal), "</TD>")- StartCellText )
End If
GetCell = ThisCellText
End Function
%>
Then since i need the infor from may cells, and need it so that each cell info is set to a variable, i have this ugly code:
Code:
variable44 = GetCell(44, "[URL unfurl="true"]http://www.sec.gov/cgi-bin/browse-edgar?action=getcurrent")[/URL]
variable45 = GetCell(45, "[URL unfurl="true"]http://www.sec.gov/cgi-bin/browse-edgar?action=getcurrent")[/URL]
variable47 = GetCell(47, "[URL unfurl="true"]http://www.sec.gov/cgi-bin/browse-edgar?action=getcurrent")[/URL]
variable49 = GetCell(49, "[URL unfurl="true"]http://www.sec.gov/cgi-bin/browse-edgar?action=getcurrent")[/URL]
//i have a space here to indicate that the variables (44-49 for instance) is a set, i have blocked them like this for use later
variable57 = GetCell(57, "[URL unfurl="true"]http://www.sec.gov/cgi-bin/browse-edgar?action=getcurrent")[/URL]
variable58 = GetCell(58, "[URL unfurl="true"]http://www.sec.gov/cgi-bin/browse-edgar?action=getcurrent")[/URL]
variable60 = GetCell(60, "[URL unfurl="true"]http://www.sec.gov/cgi-bin/browse-edgar?action=getcurrent")[/URL]
variable62 = GetCell(62, "[URL unfurl="true"]http://www.sec.gov/cgi-bin/browse-edgar?action=getcurrent")[/URL]
.....all the way up to cell 1071......
variable1071 = GetCell(1071, "[URL unfurl="true"]http://www.sec.gov/cgi-bin/browse-edgar?action=getcurrent")[/URL]
then i need to take these variables of cell infomation and format the string so it excludes certain information and then i set the variable information into a table:
Code:
<%
strNumber = Mid(variable44, InStr(variable44, "(") + 1)
strNumber = Left(strNumber, InStrRev(strNumber, "(") - 1)
strNumber = Trim(Replace(strNumber, "(", ""))
strNumber = Trim(Replace(strNumber, ")", ""))
strText = Replace(variable44, "(" & strNumber & ")", "")
%>
<table width='100%'><tr>
<td width='10%' bgcolor="#FFFFFF"><%=variable49%></td>
<td width='10%' bgcolor="#FFFFFF"><%=variable45%></td>
<td width='10%' bgcolor="#FFFFFF"><%=(CLng(strNumber))%></td>
<td width='70%' bgcolor="#FFFFFF"><a href="todaysq.asp?t=<%=table2%>&head=cn&sort=<%=sort%>"><%=strText%></a><br><%=variable47%></td>
</tr></table>
<%
strNumber1 = Mid(variable57, InStr(variable57, "(") + 1)
strNumber1 = Left(strNumber1, InStrRev(strNumber1, "(") - 1)
strNumber1 = Trim(Replace(strNumber1, "(", "")) 'in case we pick up the first "(" &
strNumber1 = Trim(Replace(strNumber1, ")", "")) 'to make sure we get rid of the ")"
strText2 = Replace(variable57, "(" & strNumber1 & ")", "")
%>
<table width='100%'><tr>
<td width='10%' bgcolor="#FFFFFF"><%=variable62%></td>
<td width='10%' bgcolor="#FFFFFF"><%=variable58%></td>
<td width='10%' bgcolor="#FFFFFF"><%=(CLng(strNumber1))%></td>
<td width='70%' bgcolor="#FFFFFF"><a href="todaysq.asp?t=<%=table2%>&head=cn&sort=<%=sort%>"><%=strText2%></a><br><%=variable60%></td>
</tr></table>
And i also have a "string formating script" and a "table layout" with the variable and formatted variable information in it representing for each block of code previously displayed liuke so:
variable57 = GetCell(57, "