ASP 数组值累加问题
ArrVal=""Sqlir1_RF=Split(Trim(Request.Form("型号")),",")Sqlir1_RS=Split(Rs("型号"),",")Fo...
ArrVal = ""
Sqlir1_RF = Split(Trim(Request.Form("型号")),",")
Sqlir1_RS = Split(Rs("型号"),",")
For Count1_RF = Lbound(Sqlir1_RF) To Ubound(Sqlir1_RF)
Sqlir2_RF = Split(Sqlir1_RF(Count1_RF),"/")
For Count1_RS = Lbound(Sqlir1_RS) To Ubound(Sqlir1_RS)
Sqlir2_RS = Split(Sqlir1_RS(Count1_RS),"/")
IF LCase(Sqlir2_RF(0)) = LCase(Sqlir2_RS(0)) Then
ArrVal = ArrVal & Sqlir2_RS(0) & "/" & Int(Sqlir2_RS(1)) + Int(Sqlir2_RF(1)) & ","
Else
ArrVal = ArrVal & Sqlir1_RF(Count1_RF) & ","
End IF
Next
Next
IF Right(ArrVal,1) = "," Then ArrVal = Left(ArrVal,Len(ArrVal) - 1) End IF
Rs("型号") = ArrVal
Rs("单价") = Request.Form("单价")
问题是:
比如 Request.Form("型号") = XS/1,S/3,M/1
数据表中的 Rs("型号") = XS/3,S/4,M/6,L/13,XL/6,XXL,2
ArrVal要得到 XS/4,S/7,M/7,L/13,XL/6,XXL,2
也就是 两个数组值的累加 这段代码无法实现,帮忙修改一下 展开
Sqlir1_RF = Split(Trim(Request.Form("型号")),",")
Sqlir1_RS = Split(Rs("型号"),",")
For Count1_RF = Lbound(Sqlir1_RF) To Ubound(Sqlir1_RF)
Sqlir2_RF = Split(Sqlir1_RF(Count1_RF),"/")
For Count1_RS = Lbound(Sqlir1_RS) To Ubound(Sqlir1_RS)
Sqlir2_RS = Split(Sqlir1_RS(Count1_RS),"/")
IF LCase(Sqlir2_RF(0)) = LCase(Sqlir2_RS(0)) Then
ArrVal = ArrVal & Sqlir2_RS(0) & "/" & Int(Sqlir2_RS(1)) + Int(Sqlir2_RF(1)) & ","
Else
ArrVal = ArrVal & Sqlir1_RF(Count1_RF) & ","
End IF
Next
Next
IF Right(ArrVal,1) = "," Then ArrVal = Left(ArrVal,Len(ArrVal) - 1) End IF
Rs("型号") = ArrVal
Rs("单价") = Request.Form("单价")
问题是:
比如 Request.Form("型号") = XS/1,S/3,M/1
数据表中的 Rs("型号") = XS/3,S/4,M/6,L/13,XL/6,XXL,2
ArrVal要得到 XS/4,S/7,M/7,L/13,XL/6,XXL,2
也就是 两个数组值的累加 这段代码无法实现,帮忙修改一下 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询