I wrote this function, and it is supposed to return a string that contains a nice looking table so that we can print it. However, response.write just prints out "False". Anyone run into this before ?
The output is this :
TIA
Code:
Function categoryTables()
response.write("categoryTables()")
'arrays
DIM mfgArray, skinTypeArray
'strings
DIM mfgName
'ints
DIM mfgCount, counter, iter, nOfCols
nOfCols = CINT(4) 'Number of Columns In our table
counter = CINT(0) 'Mod by nOfCols to figure out which col. were on
'grab global arrays so we don't have to tax the DB
mfgArray = APPLICATION("globalManufacturerArray")
skinTypesArray = APPLICATION("globalSkinTypesArray")
Response.write("mfg is a :" & TypeName(APPLICATION("globalManufacturerArray")) & "<br>")
Response.write("skintype is a :" & TypeName(APPLICATION("globalSkinTypesArray")) & "<br>")
'This section creates our mfg Table
categoryTables = categoryTables & "<table>" & VbCrLf
categoryTables = categoryTables & VbTab & "<tr>" & VbCrLf
categoryTables = categoryTables & VbTab & VbTab & "<td colspan='4'>Manufacturers:</td>" & VbCrLf
categoryTables = categoryTables & VbTab & "<tr>" & VbCrLf
FOR iter = LBOUND(mfgArray, 2) TO UBOUND(mfgArray, 2)
response.write("in counter: (" & counter & ")<br>")
mfgName = mfgArray(0, iter) 'make our code readable
mfgCount = mfgArray(1, iter)
response.write("mfgName: " & mfgName & "<br>")
response.write("mfgCount: " & mfgCount & "<br>")
'Populate Our Table
IF (counter Mod nOfCols) = 0 THEN
categoryTables = categoryTables & VbTab & "<tr>" & VbCrLf & VbTab & VbTab & "<td ><a href='DisplayProducts.asp?DispType=MFG&Criteria=" & mfgName & "&session_id=" & session_id & "'>" & mfgName & "</a> (" & mfgCount & ")</td>" & VbCrLf
ELSEIF (counter Mod nOfCols) = 3 THEN
categoryTables = categoryTables &VbTab & VbTab & "<td ><a href='DisplayProducts.asp?DispType=MFG&Criteria=" & mfgName & "&session_id=" & session_id & "'>" & mfgName & "</a> (" & mfgCount & ")</td>" & VbCrLf & VbTab & "<tr>" & VbCrLf
ELSE
categoryTables = categoryTables & VbTab & VbTab & "<td ><a href='DisplayProducts.asp?DispType=MFG&Criteria=" & mfgName & "&session_id=" & session_id & "'>" & mfgName & "</a> (" & mfgCount & ")</td>" & VbCrLf
END IF
counter = counter + 1 'increment our column counter
NEXT
'Add the required number of cells to balance our table row, then close the row.
IF NOT (counter Mod nOfCols) = 0 THEN
FOR iter = counter Mod nOfCols to 3
categoryTables = categoryTables &VbTab & VbTab & "<td></td>" & VbCrLf
NEXT
categoryTables = categoryTables &VbTab & "</tr>" & VbCrLf
ELSE
categoryTables = categoryTables &VbTab & "</tr>" & VbCrLf
END IF
categoryTables = categoryTables = "</table>" & VbCrLf
End Function
The output is this :
categoryTables()mfg is a :Variant()
skintype is a :Variant()
in counter: (0)
mfgName: manufactuer1
mfgCount: 1
in counter: (1)
mfgName: manufactuer2
mfgCount: 2
in counter: (2)
mfgName: manufactuer3
mfgCount: 1
False
TIA