Greetings
I'm currently (trying not to scream...) working on an office project that was done in ASP ... I've come to enjoy ASP about as much as I enjoy being repeetedly stabbed with miscellanous randomly sharpened objects.
Anyhow...
Part ordering interface, takes parts from multiple vendors, and compiles them into seperate orders for each vendor. Hence the need for a multidimensional array - which has to be dynamic, because the parts list is ever changing.
I cannot for the life of me find a tutorial on working with multidimensional dynamic arrays that makes any sense/works/doesn't try to trivialize the insane amount of dificulty there (apparently) is in doing this with ASP. Christ, if I was working in C++ I'd have been done with this hours ago.
Here is a stripped down (non-working) example of what I'm trying to do. It currently is just trying to dump the array(s)(s) back into the page via response.write to avoid listing the SQL query stuff and keep the example simple:
While (this version of) the code runs without error there are no values output when run even tho all data pulled from the previous page is correct.
Note: this was a working production system before I started working on making it a bit more flexible/robust - I'm trying to get away from hardcoding the vendors.
Yes, I am working on (torching...) a Lab Clone of the production system.
Edit: reworked output code to make more sense out of what I'm doing - It was rather cryptic in retrospect.
I'm currently (trying not to scream...) working on an office project that was done in ASP ... I've come to enjoy ASP about as much as I enjoy being repeetedly stabbed with miscellanous randomly sharpened objects.
Anyhow...
Part ordering interface, takes parts from multiple vendors, and compiles them into seperate orders for each vendor. Hence the need for a multidimensional array - which has to be dynamic, because the parts list is ever changing.
I cannot for the life of me find a tutorial on working with multidimensional dynamic arrays that makes any sense/works/doesn't try to trivialize the insane amount of dificulty there (apparently) is in doing this with ASP. Christ, if I was working in C++ I'd have been done with this hours ago.
Here is a stripped down (non-working) example of what I'm trying to do. It currently is just trying to dump the array(s)(s) back into the page via response.write to avoid listing the SQL query stuff and keep the example simple:
Code: (asp)
<%
Dim ar_LAPN, iCount
Dim ar_vCode(), ar_vFName(), ar_vActive(), iVends
ar_LAPN = Split(Request.Form("LAPN"), ",")
iCount = Request.Form("iCount")
Dim ar_nVend00(10, 1000), ar_pVend00(10, 1000)
Dim MyConn, MyQuery, mRS '-----> SQL Query Variables
set MyConn = Server.CreateObject("ADODB.Connection")
MyConn.Open(MySQL)
MyQuery = "SELECT VendorCode, VendorFName, Active, BorderColor, FontClass FROM VendorNames"
Set mRS = MyConn.Execute(MyQuery)
If mRS.BOF And mRS.EOF Then
Response.Write("MySQL Query Failed! " & MyQuery)
Response.End
Else
iVends = 0
mRS.MoveFirst
WHILE NOT mRS.EOF
ReDim Preserve ar_vCode(iVends + 1)
ReDim Preserve ar_vFName(iVends + 1)
ar_vCode(iVends) = mRS("VendorCode")
ar_vFName(iVends) = mRS("VendorFName")
ar_vActive(iVends) = mRS("Active") '--+++--> Add Column for Vendor X Only if They're Active
if ar_vActive(iVends) Then '--------------------------------------+++-->
' ReDim Preserve ar_nVend00(iVends + 1)
' ReDim Preserve ar_pVend00(iVends + 1)
ar_nVend00(iVends, 0) = Split(Request.Form("nVend00" & iVends), ",")
ar_pVend00(iVends, 0) = Split(Request.Form("pVend00" & iVends), ",")
end if
iVends = iVends + 1
mRS.MoveNext
WEND
iVends = iVends - 1
End If
for i=0 to iCount
response.write("LAPN: " & ar_LAPN(i) & " ")
for iV=0 to iVends
response.write(" Qty: " & ar_nVend00(iVends, iCount) & " * Price: " & ar_pVend00(iVends, iCount) & " | ")
next
response.write("Vends-break;<br>")
nextWhile (this version of) the code runs without error there are no values output when run even tho all data pulled from the previous page is correct.
Note: this was a working production system before I started working on making it a bit more flexible/robust - I'm trying to get away from hardcoding the vendors.
Yes, I am working on (torching...) a Lab Clone of the production system.
Edit: reworked output code to make more sense out of what I'm doing - It was rather cryptic in retrospect.








...Fixed now, rest of code still broken
(..shit)

- carpe noctem