求助,好像是vector下标越界~ [问题点数:100分]

Bbs1
本版专家分:0
结帖率 0%
Bbs5
本版专家分:2178
Blank
黄花 2019年5月 C/C++大版内专家分月排行榜第二
Blank
蓝花 2019年6月 C/C++大版内专家分月排行榜第三
Bbs1
本版专家分:0
Bbs5
本版专家分:3530
Blank
金牌 2019年7月 总版技术专家分月排行榜第一
2019年5月 总版技术专家分月排行榜第一
2019年4月 总版技术专家分月排行榜第一
Blank
银牌 2019年6月 总版技术专家分月排行榜第二
2019年3月 总版技术专家分月排行榜第二
Blank
红花 2019年7月 .NET技术大版内专家分月排行榜第一
2019年6月 .NET技术大版内专家分月排行榜第一
2019年5月 .NET技术大版内专家分月排行榜第一
2019年4月 C/C++大版内专家分月排行榜第一
2019年4月 .NET技术大版内专家分月排行榜第一
2019年3月 .NET技术大版内专家分月排行榜第一
Blank
蓝花 2019年7月 C/C++大版内专家分月排行榜第三
Bbs2
本版专家分:314
Bbs1
本版专家分:0
Bbs1
本版专家分:0
Bbs1
本版专家分:38
下标越界求助
Option ExplicitrnDim a(3) As Single '边长rnDim b(4) As SinglernrnPrivate Sub Command1_Click(Index As Integer)rnDim s As SinglernDim a() As SinglernSelect Case IndexrnCase 0 '计算rn a(3) = (Sqr((2 * a(0) * a(1)) / a(2)))rn b(4) = ((6 * a(0)) / 2)rn Text1(3).Text = Trim(a(3))rn Text1(4).Text = Trim(b(4))rn rnCase 1 '清除rn For s = 0 To 6rn Text1(s).Text = "": a(s) = 0rn NextrnCase 2 '退出rn EndrnEnd SelectrnEnd SubrnrnPrivate Sub Text1_Change(Index As Integer)rnIf Val(Text1(Index).Text) 赋值三边rnEnd Subrn
vector resize失败导致下标越界
介绍一种resize失败导致<em>vector</em><em>下标越界</em>的场景,供参考。
求助关于下标越界的解决办法
本人新手,写了一个将输入的5个数字按从小到大顺序排列的程序.想在最后结果中显示出排列好的5个数,可得到结果后总是提示我<em>下标越界</em>?请问该怎么解决这个问题呢?十分感谢!以下是我写的拙劣的程序:rnDim num(4),trnfor i=0 to 4rnnum(i)=Inputbox("input"&ctr+1&"number")rnnext rnfor i=0 to 4rnfor j=i+1 to 4rnif num(j)
求助:VBS下标越界
今天测试一个 批量修改域用户权限的脚本,运行时一直提示:<em>下标越界</em>;不知道这段VBS代码,哪里出的问题!rn请高手帮忙指出!将不胜感激rn VBS脚本如下:rnConst ForReading = 1rnSet unNamedArguments = WScript.Arguments.UnNamed rnSet objGroupAdm = GetObject("WinNT://" & unNamedArguments.Item(0) & "/Administrators,group") rnSet objGroupPower = GetObject("WinNT://" & unNamedArguments.Item(0) & "/Power Users,group") rn For Each objUser in objGroupAdm.Members rn If objUser.Name <> "Administrator" and objUser.Name <> "Domain Admins" Then rn objGroupAdm.Remove(objUser.ADsPath) rn objGroupPower.Add(objUser.ADsPath) rn WScript.Echo("The user "& unNamedArguments.Item(0)&":"&objUser.Name & " is changed to _ Power Users Group") rn End Ifrn Next ' end forrnrnrn rn
listviews下标越界问题求助
我用commondialog控件打开文件,然后放在listview中,然后再输出到一文件中。代码如下(部分):rn[code=VB]rnPrivate Sub Command5_Click()rn Dim DlgInfo As DlgFileInforn Dim I As Integerrn List1.ListItems.Clearrn rn With CommonDialog1rn .CancelError = Falsern .MaxFileSize = 32767rn .Flags = cdlOFNReadOnly Or cdlOFNAllowMultiselect Or cdlOFNExplorerrn .DialogTitle = "批量选择文件:)"rn .Filter = "所有文件类型(*.*)|*.*"rn .ShowOpenrn DlgInfo = GetDlgFileInfo(.FileName)rn End Withrn rn For I = 1 To DlgInfo.iCountrn List1.ListItems.Add.Text = DlgInfo.sFile(I)rn List1.ListItems.Item(I).SubItems(1) = DlgInfo.sPath & DlgInfo.sFile(I)rn Next IrnEnd SubrnPrivate Sub Command1_Click()rn For I = 1 To List1.ListItems.Count rn Dim bfile() rn bfile(I) = List1.ListItems.Item(I).SubItems(1) '就这里提示<em>下标越界</em> rn Open bfile(I) For output As #1rn Get #1, , ftb '将选择的文件输入到ftbrn Close #1rn Open App.Path & "/test.txt" For output As #2rn Print #2,ftbrn Close #2rn Next Irn End Subrn[/code]
菜鸟求助下标越界
菜鸟<em>求助</em><em>下标越界</em> js2 = get_json_from_url(method='post', url=url2, headers=headers2, cookies=cookies, datas=datas2) print(js2['rows'][0]) print(len(js2)) print(len(js2['row'][0]) get_json_from_url()是用requests...
vector<>下标越界,求较高手哪里越了?
[code=c]//lotto.cpp -- rn#includern#includern#includern#includern#includernusing namespace std;rnrn<em>vector</em> Lotto(int dot_num,int selected_num);rnint main()rnrn cout<>total>>selective;rn <em>vector</em> winner;rn winner=Lotto(total,selective);rn cout<);rn copy(winner.begin(),winner.end(),out);rn return 0;rnrnrn<em>vector</em> Lotto(int dot_num,int selected_num)rnrn <em>vector</em> temp[color=#FF0000](dot_num),[/color]winner[color=#FF0000](selected_num);[/color]rn for(int i=0;i
STL容器之vector下标越界是否报错
今天将程序在VS2015和g++ 5.4.0下运行,发现<em>vector</em>越界 VS会报错,而g++正常输出。故而查看了源码,看个究竟。例:#include &amp;lt;iostream&amp;gt; #include &amp;lt;<em>vector</em>&amp;gt; using namespace std; int main() { <em>vector</em> &amp;lt;int&amp;gt; a; a.push_back(6...
求助!!好像是病毒的问题!!!
最近我们公司的电脑出现一种奇怪的现象,所有电脑装的是WIN2000系统,前天无意中发现所有电脑的所有硬盘莫名其妙的被设为完全共享,不需要密码就能访问,并且是隐藏共享,不容易被发现,取消这些共享后,每次重新启动或者注销后再次被改。还有系统根目录下的WINNT目录也被设为共享,共享名为“ADMIN$”。公司上下都很震惊,下令我尽快解决。但是我用正版瑞星和金山毒霸都杀不到病毒,而且网上也找不到相关资料,所以现在很急,请各位帮忙,分数不是问题!
!!!求助好像是setcookie的问题
我下载的一段例程如下:rnrnrn Cookie CheckrnrnCookie Check Status:rn%s ;',rn $status ? "00FF00" : "FF0000",rn $status ? "PASSED!" : "FAILED!");rn?>rnrnrnrn运行后显示错误:rnNotice: Undefined variable: PHP_SELF in D:\phptest\sqladmin\cookietest.php on line 8rnrnWarning: Cannot add header information - headers already sent by (output started at D:\phptest\sqladmin\cookietest.php:8) in D:\phptest\sqladmin\cookietest.php on line 8rnrn上面一个信息好象是说变量没有定义rnrn可是下面一个警告就不明白什么意思了rn下载的另一个关于setcookie的例程也报相应错误而无法显示页面rnrn我从其他地方拷贝的一个mysql管理程序,也是包同样的错误rn我怀疑是不是载使用cookie的时候有什么问题rn因为我还不太懂cookie,可是程序用到,只好请各位帮帮忙,多谢!
下标越界
以下是金蝶ERP二次开发代码,有些是已经被封装好了的.rn[code=VB]rnPrivate Sub m_BillTransfer_BeforeSave(ByVal bNew As Boolean, ReturnCode As Long)rn rn 'TODO: 请在此处添加代码响应事件 BeforeSavern' ReturnCode 返回参数 -1: 失败,结束单据保存;rn'0:成功,继续单据保存rn'1:成功返回,结束单据保存rnrn Dim cnn As Stringrn Dim cn As New ADODB.Connectionrn '物料代码rn Dim StrItemNumber As Stringrn '成本对象代码rn Dim StrCostObj As Stringrn Dim Rs As New ADODB.Recordsetrn '成本对象内码rn Dim LngCostObjID As Longrn Dim IntI As Integerrn Dim LngA() As Longrn rn On Error GoTo Errrnrn cnn = "Provider=SQLOLEDB.1;Password=sa;Persist Security Info=True;User ID=sa;Initial Catalog=AIS20080807081820;Data Source=JINDEEE"rn With cnrn .ConnectionString = cnnrn .Openrn End Withrnrn StrItemNumber = m_BillTransfer.GetHeadNumber(11)rn StrCostObj = m_BillTransfer.GetHeadNumber(5)rn rn Set Rs = cn.Execute("Select FItemID from cbcostobj where FNumber = '" & StrCostObj & "'")rn rn LngCostObjID = Rs.Fields("FItemID")rn rnrn If LCase(Left(StrItemNumber, 1)) = "z" Or UCase(Left(StrItemNumber, 1)) = "Z" Thenrnrn '此SQL语句我在查询分析器里执行有4行记录,监视Rs时,只有第一条记录存在,后面三条都没有,请问是怎么回事? rn Set Rs = cn.Execute("Select FCostObjID From ICMO Where FTranType = 85") rn rn ReDim LngA(Rs.RecordCount) As Long '调试到此行报错为"<em>下标越界</em>",请问怎么回事?rn rn Rs.MoveFirstrn For IntI = 1 To Rs.RecordCountrn LngA(IntI) = Rs.Fields("FCostObjID")rn If LngCostObjID = LngA(IntI) Thenrn MsgBox """成本对象""已被引用,本次操作取消", vbInformation, "金蝶提示"rn ReturnCode = -1rn Exit Subrn End Ifrn Rs.MoveNextrn Nextrn rn End Ifrn rn cn.Closern Exit SubrnErr:rn If Err.Number <> 0 Thenrn MsgBox Err.Description, vbCritical, "错误提示"rn End IfrnrnEnd Subrn[/code]
下标越界
sunslo="101,102,103"rnDim bb(ubound(sunslo)+1,2)rnfor i=0 to ubound(sunslo)rn j=j+1rn bb(j,2)=conn.execute("Select 名称 from Departmen where 编号='"&sunslo(i)&"'")(0)rnnextrnrnrn<em>下标越界</em>: 'J'rnrnrn我只想得到数组rnbb(1,2)="名称1"rnbb(2,2)="名称2"rnbb(3,2)="名称3"
下标越界??
我从前一个菜单中获得一串sql查询字符,为以下格式:rn金额>='2000',金额对sql语句的每一部分赋值rnb(i)(1)=bbb(i)(ubound(bbb(i))-1)rnb(i)(2)=bbb(i)(ubound(bbb(i)))rnnextrn当执行到对sql语句的每一部分赋值时,错误提示“<em>下标越界</em>”。这是怎么回事??
下标越界!!!!
http://www.officefans.net/cdb/viewthread.php?tid=34984&page=1&sid=ggRDeq#pid307390rnrnDim i, number As Integerrnrn'思路是选取指定xls(工作簿)的指定sheet(工作表),在整个sheet(工作表)里对每行的h列赋值。值是和b列同名的文件名。rnSub test()rnrnWorkbooks("E:\jishu\图纸翻译检索.xls").Worksheets("sheet1").Activaternrn'Range("3:b,number:b").SelectrnrnFor i = 3 To 100rnPath = "e:\draw\" 把这行注释掉也没用 rn Cells(i, "k") = Path + Cells(i, "b") + ".tif" rn Next irnEnd Sub
求助:一个asp下标越界的问题
<em>求助</em>:我用asp写了个组合的算法,调试一直出现“ If b(i)=1 And b(i+1)=0 Then ”这段代码出现<em>下标越界</em>,可我想不管怎么算也运算不到最后一个数组,可能是我已经思维定势了,<em>求助</em>大神给我解惑rnrn[code=VBScript]rnFunction CreateResult(a,b,m)rn rn Dim resultrn result=""rn n=UBound(a)-1rn tempTest =""rn j=0rn For i=0 To nrn tempTest = tempTest & "," & b(i) rn j=j+1rn If b(i)=1 Then rn result = result & "+" & a(i)rn End If rn Next rn CreateResult = resultrnrnEnd Function rnrnFunction Combination(a,m) '从数组a中选取m个数进行组合rn Dim n,listrn Dim b()rn n = UBound(a)-1rn ReDim b(n) '辅助数组。首先初始化,将数组前m个元素置为1,表示第一个组合为m个数rn rn For i=0 To nrn rn If i1 Then rn For L=0 To i-krn b(L)=b(k+1)rn Next rn For L=i-k To irn b(L)=0rn Next rn End If rn If k=i And i=n-m Then rn tempEnd = "Y"rn End Ifrn End If rn If swap="Y" Then rn Exit For rn End If rn Next rn list = list & "|" & CreateResult(a,b,m)rnrn Loop rn Combination = list rnEnd Function [/code]
office vba 求助下标越界错误
本人新手,最近做一个比赛,从一篇论文上摘了一段vba程序,运行出现<em>下标越界</em>……rn请各路大神帮忙看看,多谢多谢~rn程序如下:rn本人新手,基本不会,最近做比赛用到的一个程序,是从网上一篇论文里摘的,但是运行时出现<em>下标越界</em>错误。rn程序如下:rn[code=vb][/code]Option Base 1rnSub 命名及公式()rnSet 名 = Namesrn 名.Add "A", " = Offset(图! $ D $ 4,0,0,M,1)"rn 名.Add "B", " = Offset(图! $ E $ 4,0,0,M,1)"rn 名.Add "K", " ="""""rn 名.Add "T", " = 图! $ D $4:$ D $ 63"rn 名.Add "M", " =Countif(T,"">""&xw)+1"rn 名.Add "N", " =Count(图! $ B $4:图! $ B $ 58)"rn 名.Add "E", " =图! RC[-1]"rn 名.Add "P", " =0,0;1,1"rn 名.Add "U", " =OFFSET(图! $ C $4,0,0,N,1)"rn 名.Add "V", " =OFFSET(图! $ B $4,0,0,N,1)"rn [L1:M2] = [P]: [F6:K7].CreateNames Top:=1rn [L3:M9,I9:J10].CreateNames Left:=1rn [F4:K4] = Array("0", "=J", "=xf", "=xf", "=xw", "=xw")rn [F5:K5] = Array( _rn "= xD", "= xD", "= _ xd", "= _yd", "= _xd", "= _yd")rn [F7:G7].FormulaArray = " = Linest(G4:G5,F4:F5)"rn [H7:I7] = Array("=g", "= -xF/(q-1)")rn [J7:K7].FormulaArray = "=Linest(K4:K5,J4:J5)"rn [ _ xd] = "=(φ0 - α0)/(α1 - φ1)": [ _ yd] = "=φ1 * _xd + φ0"rn [M8] = "=q/(q-1)": [M9] = "=xd/( _ R+1)"rn [D4] = "=xd": E4 = "=xd"rn [E5] = "=E4": [D6] = "=D5"rn [D5] = "=IF(E5>xw,插值(U,V,E5),0)"rn [E6] = "=IF(E>xw,IF(E> _ xd,α1*E+α0,γ1*E+γ0),0)"rn [D5:E6].AutoFill Destination:=[D5:E63], Type:=0rnEnd SubrnrnFunction 插值(X, Y, U)rnN = X.CountrnFor k = 1 To N - 1rn If (U - X(k)) * (U - X(k + 1)) < (U - X(N)) Then k = 1 Else k = N - 1rn10 G = (U - X(k)) < (U - X(k + 1))rnIf k = N - 1 Or k <> 1 And G Then k = k - 1rn V = 0rnFor I = k To k + 2rn L = 1rn For J = k To k + 2rn If I <> J Then L = L * (U - X(J)) / (X(I) - X(J))rn Next Jrn V = V + L * Y(I)rnNext Irn 插值 = VrnEnd FunctionrnrnSub 理论板数图()rn B = "图": Worksheets(B).Selectrn Range("I13").Selectrn Charts.Addrn xp = "B4:B23": yp = "C4:C23"rn Set 图 = ActiveChartrn 图.ChartType = 72rn For I = 1 To 6rn 图.SeriesCollection.NewSeriesrn Nextrn X = Array(xp, "d4:d63", "f4:f5", _rn "h4:h5", "j4:j5", "L1:L2")rn Y = Array(yp, "e4:e63", "g4:g5", _rn "i4:i5", "k4:k5", "m1:m2")rn For I = 1 To 6rn With ActiveChart.SeriesCollection(I)rn .XValues = Worksheets(B).Range(X(I))rn .Values = Worksheets(B).Range(Y(I))rn End Withrn Next Irn 图.SeriesCollection(2).Selectrn 图.SeriesCollection(2).ChartType = 75rn For I = 1 To 2rn 图.Axes(I).Selectrn With ActiveChart.Axes(I)rn .MinimumScale = 0rn .MaximumScale = 1rn .MinorUnit = 0.1rn .MajorUnit = 0.1rn End Withrn Next Irn W = Array("b", "a", "e-d 进料线", "", "c", "d")rn k = 1rn For I = 3 To 5rn With 图.SeriesCollection(I)rn For J = 1 To 2rn .Points(J).HasDataLabel = 1rn .Points(J).DataLabel.Text = W(k)rn k = k + 1rn Nextrn End Withrn Nextrn Set T = 图.SeriesCollection(2)rn For I = 1 To 28rn T.Points(I * 2).HasDataLabel = 1rn T.Points(I * 2).DataLabel.Text = Str(I)rn Nextrn '设置图标选项:标题,X,Yrn W = "图解法求理论板数": 图.HasTitle = 1rn 图.ChartTitle.Characters.Text = Wrn 图.Axes(1, 1).HasTitle = Truern 图.Axes(1, 1).AxisTitle.Characters.Text = "x"rn 图.Axes(2, 1).HasTitle = Truern 图.Axes(2, 1).AxisTitle.Characters.Text = "y"rn '设置图标区,区域无边框,白色,无网格。rn 图.PlotArea.Border.LineStyle = xlNonern 图.PlotArea.Interior.ColorIndex = 2rn 图.Axes(xlValue).MajorGridlines.Deletern 图.Legend.Deletern 图.Location Where:=2, Name:="图"rn V = Mid(ActiveChart.Name, 3, 18)rn ActiveSheet.Shapes(V).ScaleWidth 1.32, 0, 0rn ActiveSheet.Shapes(V).ScaleHeight 1.87, 0, 0rn ActiveChart.ChartArea.Font.Size = 12rn Set T = ActiveChart.SeriesCollection(2)rn T.DataLabels.Font.Size = 8rn T.DataLabels.Position = -4131rn T.XValues = "=图! A": T.Values = "=图! B"rn ActiveChart.PlotArea.Border.ColorIndex = 56rn For I = 1 To 6 Step 5rn ActiveChart.SeriesCollection(I).Selectrn With Selectionrn .MarkerBackgroundColorIndex = xlNonern .MarkerForegroundColorIndex = xlNonern End Withrn Nextrn Sheets(I).[A1].SelectrnEnd Subrnrn稍微有点长,请各路大神帮忙看看哪里有错误,代码是从一篇论文里摘的rn多谢多谢~
求助~VB动态数组下标越界问题
[code=vb]Private Sub Command1_Click()rn Dim strLen As Integerrn Dim hlstr As Stringrn Dim dataMe As Integerrn Dim mytext1 As Stringrn Dim nbyte() As Bytern Dim i As Integerrn Dim endchr As Integerrn rn strLen = Len(Text1.Text)rn mytext1 = Left(Text1.Text, Len(Text1.Text) - 2)rn i = 0rn For n = 1 To Len(mytext1)rn n = n - 1rn If n Mod 3 = 0 Thenrn hlstr = Mid(mytext1, 1, 2)rn nbyte(i) = Right(hlstr, 1) + Left(hlstr, 1) * 16rn i = i + 1rn n = n + 3rn End Ifrn Next nrn endchr = UBound(nbyte)rn endchr = endchr + 1rn nbyte(endchr) = &HArn MSComm1.Output = nbytern rnEnd Sub[/code]rn显示nbyte<em>下标越界</em>是什么原因,望大家支招~~
vb 高手求助下标越界问题
这是我编写的,调试时说下表越界,不知怎么回事,高手帮我啊!rnrnOption ExplicitrnDim xl, yt, xr, yb As DoublernDim i, x1, y1, j, k As VariantrnDim c As IntegerrnDim x(1 To 6000) As LongrnDim y(1 To 6000) As LongrnrnPrivate Sub Command1_Click()rnxl = Text1.Textrnyt = Text2.Textrnxr = Text3.Textrnyb = Text4.TextrnrnPicture1.Scale (Val(xl), Val(yt))-(Val(xr), Val(yb))rnPicture1.Line (-100, 0)-(100, 0)rnPicture1.Line (95, 3)-(100, 0)rnPicture1.Line (95, -3)-(100, 0)rnPicture1.CurrentX = 90rnPicture1.CurrentY = 15rnPicture1.Print "x"rn'画xrnPicture1.Line (0, 100)-(0, -100)rnPicture1.Line (3, 95)-(0, 100)rnPicture1.Line (-3, 95)-(0, 100)rnPicture1.CurrentX = 5rnPicture1.CurrentY = 95rnPicture1.Print "y"rn '画yrn Picture1.CurrentX = 2rnPicture1.CurrentY = 0rn Picture1.Print "o" '画圆点rnrnCommand1.Enabled = FalsernrnFor i = 1 To 6000 Step 1rnx(i) = 1 - 1.4 * x(i - 1) * x(i - 1) + y(i - 1)rny(i) = 0.3 * x(i - 1)rnPicture1.PSet (x(i), y(i))rnc = DoEvents()rnNext irnEnd Sub
下标越界....
代码:rnOption ExplicitrnrnDim MyID As LongrnDim FileNum As LongrnDim FileName As StringrnDim RCVAccept As BooleanrnDim Sentbyt As LongrnDim ByteSec As Long, Speed As LongrnDim Complete As BooleanrnrnPublic Function InitTransfer(ByVal ID As Long)rn MyID = IDrn FileName = Mid(ftSend(MyID).FileToSend, InStrRev(ftSend(MyID).FileToSend, "\") + 1)rn Caption = "Sending file to " & ftSend(MyID).Torn lblInfo = FileName & " to " & ftSend(MyID).Torn 'Attempt to connect to the Destinationrn wsSend.Connect ftSend(MyID).To, FT_USE_PORTrn Me.Visible = TruernEnd FunctionrnrnPrivate Sub cmdCancel_Click()rnOn Error Resume Nextrn Complete = Truern Close #FileNumrn If chkClose.Value = vbUnchecked Then Unload MernEnd SubrnrnPrivate Sub cmdCancelClose_Click()rn On Error Resume Nextrn 'Close the connection to stoprn Complete = Truern wsSend.Closern Close #FileNumrn Unload MernEnd SubrnrnrnrnPrivate Sub Form_Unload(Cancel As Integer)rn 'Remove the form from memoryrn Set ftSend(MyID).frmSend = NothingrnEnd SubrnrnPrivate Sub tmrSpeed_Timer()rn Speed = Format(ByteSec / 1024, "0.0")rn ByteSec = 0rnEnd SubrnrnPrivate Sub wsSend_Close()rn On Error Resume Nextrn If Not Complete Thenrn MsgBox "File Transfer Ended Unexpectedly!", vbCritical + vbOKOnly, "Error"rn Close #FileNumrn Unload Mern End IfrnEnd SubrnrnPrivate Sub wsSend_Connect()rn 'Send Information regarding the filern wsSend.SendData "FILE:" & FileName & ":" & ftSend(MyID).FileSize & ":" & ftSend(MyID).CommentrnEnd SubrnrnPrivate Sub wsSend_DataArrival(ByVal bytesTotal As Long)rnrn Dim Dat As Stringrn wsSend.GetData Dat, vbStringrn If Trim$(Dat$) = "ACCEPT" Thenrn Call SendChunkrn ElseIf Trim$(Dat$) = "DENIED" Thenrn MsgBox "文件被拒绝!", vbInformation + vbOKOnly, "提示:"rn 'Close the connectionrn wsSend.Closern 'unload the formrn Unload Mern End Ifrn rnEnd SubrnrnPrivate Sub wsSend_Error(ByVal Number As Integer, Description As String, ByVal Scode As Long, ByVal Source As String, ByVal HelpFile As String, ByVal HelpContext As Long, CancelDisplay As Boolean)rn Select Case Numberrn Case sckConnectionRefused, sckHostNotFound, sckHostNotFoundTryAgainrn 'couldnt connectrn MsgBox "Could Not Connect To Remote Host!", vbCritical + vbOKOnly, _rn "Error " & Numberrn 'Close the formrn Unload Mern End SelectrnEnd SubrnrnPublic Function SendChunk()rn 'This is where we send the file datarn Dim ChunkSize As Longrn Dim Chunk() As Bytern Dim arrHash() As Bytern rn If wsSend.State <> sckConnected Then Exit Functionrn rn ChunkSize = FT_BUFFER_SIZErn If FileNum = 0 Then 'No data has been sent yet, open the filern FileNum = FreeFilern Open ftSend(MyID).FileToSend For Binary As #FileNumrn End Ifrn rn 'determine chunk sizern If (LOF(FileNum) - Loc(FileNum)) < FT_BUFFER_SIZE Then _rn ChunkSize = (LOF(FileNum) - Loc(FileNum))rn 'set array size to fit chunkrn ReDim Chunk(0 To ChunkSize - 1)rn 'read the chunkrn Get #FileNum, , Chunkrn 'Send the datarn wsSend.SendData Chunkrn Sentbyt = Sentbyt + ChunkSizern ByteSec = ByteSec + ChunkSizern pgPercent.Value = (100 / ftSend(MyID).FileSize) * Sentbytrn lblSent = "Sent " & Int(pgPercent.Value) & "% of " & ftSend(MyID).FileSize / 1024 & _rn "Kb @ " & Speed & " Kb\Sec"rn rn 'See if file is sentrn If Sentbyt = ftSend(MyID).FileSize Thenrn Complete = Truern Close #FileNumrn cmdCancelClose.Caption = "&Close"rn End IfrnEnd FunctionrnrnPrivate Sub wsSend_SendComplete()rn DoEventsrn If FileNum > 0 Thenrn If Not Complete Thenrn SendChunkrn Elsern If chkClose.Value = Checked Thenrn wsSend.Closern Unload Mern End Ifrn End Ifrn End IfrnEnd Subrnrnrnrnrn错误如下:rnrn lblSent = "Sent " & Int(pgPercent.Value) & "% of " & ftSend(MyID).FileSize / 1024 & _rn "Kb @ " & Speed & " Kb\Sec"rnrn<em>下标越界</em> 实时错误9
下标越界
ASP文件出现这样的错误:rn错误类型:rnMicrosoft VBScript 运行时错误 (0x800A0009)rn<em>下标越界</em>: '[number: 7]'rn/asp/SaySave.asp, 第 257 行rnrn有人知道怎么解决吗?
下标越界
[code=vb]rsArray=FY_Conn.db("Select 章节名称,类别,编号,书卷编号 From 章节 where 小说编号="&FY_XSID&" order by 排序 asc,编号 asc","array",-1)rn if isArray(rsArray) thenrn FY_List_Contents_BY_I=1rn J=0rn For FeiYun_I = J To UBound(rsArray,2)rn Response.Write "章节"&J&":"&J&" "rn Juan_ID=rsArray(7,FeiYun_I)rn strList_B=strList_B&" "&Replace(FY_List_Contents_E,"$Z_章节名称",FY_Filters_S(rsArray(0,FeiYun_I),3,rsArray(1,FeiYun_I)))rn If Juan_ID>0 thenrn rsArray=FY_Conn.db("Select 章节名称,类别,编号,排序 From 章节 where 书卷编号="&Juan_ID&" And 小说编号="&FY_XSID&" order by 排序 asc,编号 asc","array",-1)rn If isArray(rsArray) thenrn K=Jrn For Fei_I = 0 To UBound(rsArray,2)rn K=K+1rn Response.Write "书卷"&K&":"&K&" "rn nextrn J=Krn End ifrn Elsern J=J+1rn End ifrn FY_List_Contents_BY_I=FY_List_Contents_BY_I+1rn nextrn strList_B=strList_B&""&FY_List_Contents_X2rn Elsern FY_JC_B=1rn End ifrn[/code]rn<em>下标越界</em>: '24'rnJuan_ID=rsArray(7,FeiYun_I) 这行
vector求助
<em>vector</em>data;rnprint() constrnrn int len=data.size();rn cout<<<>m_length;rn for(int i=1;i<<>s;rn my.AddBuf(s);rn rn my.print();rnrn为什么print()输出结果每条都是一样的内容啊?
vector 求助
[code=C/C++]rn#include rnusing namespace std;rn //代码段rntemplatern Message& operator << (const std::<em>vector</em>& val)rn rn ui16 vallen = val.size();rn *this << vallen;rn std::<em>vector</em>::const_iterator itend = val.end();rn for(std::<em>vector</em>::const_iterator it=val.begin();it!=itend;++it)rn rn *this << *it;rn rn return *this;rn rnrn[/code]rnlinux下编译error: expected `;' before "itend"rnrn我在windows下编译没问题,到linux下看<em>vector</em>文件和vc的差别很大,rnrnrn
下标越界
有组件上传:程序运行出现下述错误rnrnLyfUpload 错误 '80020009' rnrn<em>下标越界</em> rnrn/page/bh_jj/bdlc/vc_uploadpic.asp,行6rn (即set rs=server.createobject(……)这行)rnrn下面是源代码:rnrnrn
求助好像是jdom有错了~
description The server encountered an internal error () that prevented it from fulfilling this request.rnrnexception rnrnjavax.servlet.ServletException: Servlet.init() for servlet CommonServlet threw exceptionrn org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)rn org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)rn org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)rn org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)rn org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)rn java.lang.Thread.run(Thread.java:619)rnrnrnroot cause rnrnjava.lang.NoClassDefFoundError: org/jdom/Contentrn org.apache.commons.jxpath.ri.model.jdom.JDOMPointerFactory.createNodePointer(JDOMPointerFactory.java:45)rn org.apache.commons.jxpath.ri.model.NodePointer.newNodePointer(NodePointer.java:81)rn org.apache.commons.jxpath.ri.JXPathContextReferenceImpl.(JXPathContextReferenceImpl.java:193)rn org.apache.commons.jxpath.ri.JXPathContextReferenceImpl.(JXPathContextReferenceImpl.java:167)rn org.apache.commons.jxpath.ri.JXPathContextFactoryReferenceImpl.newContext(JXPathContextFactoryReferenceImpl.java:39)rn org.apache.commons.jxpath.JXPathContext.newContext(JXPathContext.java:416)rn ch07.servlet.CommonServlet.init(CommonServlet.java:55)rn javax.servlet.GenericServlet.init(GenericServlet.java:212)rn org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)rn org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)rn org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)rn org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)rn org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)rn java.lang.Thread.run(Thread.java:619)rnrnrnroot cause rnrnjava.lang.ClassNotFoundException: org.jdom.Contentrn org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1358)rn org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1204)rn java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)rn org.apache.commons.jxpath.ri.model.jdom.JDOMPointerFactory.createNodePointer(JDOMPointerFactory.java:45)rn org.apache.commons.jxpath.ri.model.NodePointer.newNodePointer(NodePointer.java:81)rn org.apache.commons.jxpath.ri.JXPathContextReferenceImpl.(JXPathContextReferenceImpl.java:193)rn org.apache.commons.jxpath.ri.JXPathContextReferenceImpl.(JXPathContextReferenceImpl.java:167)rn org.apache.commons.jxpath.ri.JXPathContextFactoryReferenceImpl.newContext(JXPathContextFactoryReferenceImpl.java:39)rn org.apache.commons.jxpath.JXPathContext.newContext(JXPathContext.java:416)rn ch07.servlet.CommonServlet.init(CommonServlet.java:55)rn javax.servlet.GenericServlet.init(GenericServlet.java:212)rn org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)rn org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)rn org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)rn org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)rn org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)rn java.lang.Thread.run(Thread.java:619)rnrnrnnote The full stack trace of the root cause is available in the Apache Tomcat/6.0.13 logs.rnrn
求助 为什么 我这句话下标越界。。。。
rnMsgBox newsheet.Cells.Find(what:="123", LookAt:=xlWhole).rowrnrnrn如果把 , LookAt:=xlWhole 去掉 就可以正常了。。。。但是我要单元格匹配啊。。。
asp求助下标越界如何解决?源代码如下:
网页点击链接后,提示如下:rn[color=#00FF00]Microsoft VBScript 运行时错误 错误 '800a0009' rn<em>下标越界</em>: '[number: 1]' rnpaper_List.asp,行 119 [/color]rnrn[color=#FF0000]哪位大侠帮忙看看,rn附:paper_List.asp源代码[/color]rnrnrnrnrn<>"" thenrn SearchStr=SearchStr&" and proUserName like '%"&KeyWord&"%' "rn parameter_now=parameter_now&"&KeyWord="&KeyWordrnend ifrnif visitTimeKeyWord<>"" thenrn SearchStr=SearchStr&" and publishDate='"&visitTimeKeyWord&"'"rn parameter_now=parameter_now&"&visitTimeKeyWord="&visitTimeKeyWordrnend ifrn'+++++++++++++++++++++++++++++++++++++++++++++++++rnShowSQL="select id,paperName,publishDate,proUserName,paperType,createHtml from tb_paper where deleted=0 " & SearchStr & "order by publishDate desc"rn'response.Write ShowSQL&" "rn'response.Write parameter_nowrn'response.endrnSystemNumberID_Now="id" '表中的主键rn'----------------------------rnopendatabasern'分页函数------------------rnRsPages_Good Mypage_now,ShowSQL,pagesizes_now,URL_now,parameter_now,SystemNumberID_Nowrn%>rnrnrn rn rn rn rnrnrnrn rn rn rn rn rn rn rn 搜索功能: rn 制作人:rn rn 出版日期:rn rn rn rn rn rnrnrnrn rn rnrnrn rn rn 选中rn IDrn 名称rn 目录rn 日期rn rn 操作rn rn rn rn rn rn rn rn 查看Flash|rn rn 查看Htmlrn rn 未生成Htmlrn |rn 删除rn |&publishDate=">生成htmlrn rn rn rn rn rnrnrn rn rn rn 选中本页显示的所有评论 rn rn rn rnrnrn rn rn rn rn rnrn rnrnrn
[求助]出错啦,下标越界,请帮我看看!
叶面上rnrnrnrnrn提交时就会有多个price 和 IDrn这样接受语句rnrn上面一切正常,我现在要再多加一个字段[是否显示]做成打勾和不打勾,意思是不打勾就不显示这行数据。rnrnrnrn问题是,我加上这段后在作相应修改,在提交数据时全选就正常,如果有几个没打勾就没有数据,会出错提示:i<em>下标越界</em>
求助】横向合并工作表提示下标越界
工作簿中所有工作表进行横向合并,代码见附件,运行的时候总是提示<em>下标越界</em>,麻烦各位大神看下问题出在哪里,非常感谢
求助 !!!!vector问题!
linux下使用map没点问题,但是一使用<em>vector</em>就出现编译错误。请各位高手分析指导!!!!!rn错误信息如下:rnrn/usr/include/c++/4.1.2/bits/stl_b<em>vector</em>.h: In member function 'void std::<em>vector</em>::_M_insert_range(std::_Bit_iterator, _ForwardIterator, _ForwardIterator, std::forward_iterator_tag)':rn/usr/include/c++/4.1.2/bits/stl_b<em>vector</em>.h:542: error: expected unqualified-id before '(' tokenrn/usr/include/c++/4.1.2/bits/stl_b<em>vector</em>.h: In member function 'void std::<em>vector</em>::_M_fill_insert(std::_Bit_iterator, size_t, bool)':rn/usr/include/c++/4.1.2/bits/stl_b<em>vector</em>.h:897: error: expected unqualified-id before '(' tokenrn/usr/include/c++/4.1.2/bits/<em>vector</em>.tcc: In member function 'void std::<em>vector</em>::_M_fill_insert(__gnu_cxx::__normal_iterator::_Tp_alloc_type::pointer, std::<em>vector</em> >, size_t, const _Tp&)':rn/usr/include/c++/4.1.2/bits/<em>vector</em>.tcc:353: error: expected unqualified-id before '(' tokenrn/usr/include/c++/4.1.2/bits/<em>vector</em>.tcc: In member function 'void std::<em>vector</em>::_M_range_insert(__gnu_cxx::__normal_iterator::_Tp_alloc_type::pointer, std::<em>vector</em> >, _ForwardIterator, _ForwardIterator, std::forward_iterator_tag)':rn/usr/include/c++/4.1.2/bits/<em>vector</em>.tcc:452: error: expected unqualified-id before '(' tokenrnrn
求助,关于vector的at操作
#includern#includernusing namespace std;rnint main()rn int a[]=8,6,7,8,9;rn <em>vector</em> vec(a,a+4);rn <em>vector</em>::size_type i=0;rn //把<em>vector</em>中的每个元素都插到当前<em>vector</em>的开头rn while(i!=vec.size())rn vec.insert(vec.begin(),vec.at(i));rn i+=2;rn rn return 0;rnrn为什么在插入过程中会有某几个的值变成-17891602
关于vector的push_back求助
编译没出错rn可是一直莫名的调用析构函数rn什么情况rnrn#include rn#include rnusing namespace std;rnclass Arn private:rn int num;rn int * array;rn static int count;rn public:rn A()rn num = count;rn cout << "Constructor is called!" << num << endl;rn ++count;rn array = new int[10]; rn rn ~A()rn delete[] array;rn cout << "Destructor is called!" << num << endl;rn rn int * GetAd()rn return array;rn rn;rnint A::count = 0;rnrnint main()rn int i;rn <em>vector</em> vec;rn A* arr[10];rn for(i = 0 ; i < 10; ++i)rn A *a = new A();rn cout << a << endl;rn //cout << a->GetAd() << endl;rn vec.push_back(*a); rnrn rn vec.clear();rnrn getchar();rn return 0;rnrn
求助vector的erase操作
我有一句代码是这么写的:rnrn[code=C/C++]words.erase(words.begin()+start,words.begin()+end+1)[/code]rnrnstart是要清除的开始下标,end是结束下标,测试的时候,words长度为16,然后start是2,end是4,按理应该删除第3个元素到第5个元素,可是执行完毕后删除的是最后末尾的三个元素(14、15、16),我后面还有一句insert,是插入到第2个元素后面的,但是也有问题,insert到了最后一个元素的后面。。。rnrn我跟进了一下erase函数,rnrn[code=C/C++]rniterator erase(const_iterator _First_arg,rn const_iterator _Last_arg)rn // erase [_First, _Last)rn iterator _First = _Make_iter(_First_arg);rn iterator _Last = _Make_iter(_Last_arg);rn.........rn[/code]rnrn发现_First和_Last都是正确的指向第3个和第5个元素,后面的看不太懂,所以不知道哪里出了问题。。?rnrn新手求解答!谢谢
求助vector的使用问题
<em>vector</em> vn;rnint i;rnint * pn1;rnint * pn2;rnrni = 1;rnvn.push_back(i);rnpn1 = vn.begin(); 此时pn1指向的值为1rnrni = 2;rnvn.push_back(i);rnpn2 = vn.begin(); 此时pn2指向的值为1,但pn1与pn2的地址值不相同??rnrn就是说<em>vector</em>每push_back一个元素,<em>vector</em>.begin()的地址就发生变化。我想问一下如何才能防止这种地址变化的情况,因为我希望有一个全局变量始终记着<em>vector</em>的第一个元素的地址,如何地址老发生变化,那这个全局变量就没用了!好惨,请大侠赐教!!rn谢谢!!!
vector 越界求助~~
#include "stdafx.h"rn#include "windows.h"rn#include rnusing namespace std;rntypedef struct _WindowsInfornrn HWND hWnd = 0;rn TCHAR pwszTitle[255];rn TCHAR pwszClassName[255];rnrnWindowsInfo;rnrnint _tmain(int argc, _TCHAR* argv[])rnrn <em>vector</em> Windows;rn Windows.clear();rn for (int i = 1; i < Windows.capacity (); t++)rn rn printf("[%d]\n\thWnd:[%d]\n\tTitle:[%ws]\n\tClassName:[%ws]\n", t, Windows[t].hWnd, Windows[t].pwszTitle, Windows[t].pwszClassName);rn rn getchar();rn return 0;rnrnrnrnrn情况是这样 我一次暴力枚举 到了 2390个窗口rn但是 我循环输出的时候 到了2349个的时候 提示数组越界了rn很烂的代码放上去了 希望大家能够帮帮我解决这个疑惑rn先谢谢大家了
求助vector iterator not dereferencable
在练习c++ primer第五版的习题,用迭代器实现输入一组整数,然后输出他们相邻相加的和。当我输入偶数个的元素的时候,编译没问题,然后能够显示正确结果,但是会弹出<em>vector</em> iterator not dereferencable。代码如下:rn#includern#includern#includernusing namespace std;rnusing std::cout; using std::cin; using std::endl;rnint main()rn <em>vector</em> text;rn int v;rn while (cin >> v)rn text.push_back(v);rn if (text.cbegin()==text.cend())rn cout << "error" << endl;rn return -1;rn rn for (auto it = text.cbegin(); it != text.cend() - 1;it++)rn cout << *it+*(++it) <<< *(text.cend() - 1) << endl;rn cout << endl;rn system("pause");rn return 0;rnrn请各位大神指教,谢谢!
[求助]Vector元素控制
需求:按文件名列表下载相应的文件,下载完后退出线程rn我的做法是这样的rn读取文件列表,将列表封装在Vector中rn循环,下载完后,从Vector中去除下载完的对象 removeElementAt(i)rn但是这样本来需要下载50个文件 不知道怎么调用removeElementAt(i)这个方法以后就变成下载26个文件了rn不解,求大侠指点rnpublic static void main(String[] args)rn rn String [] fileList;rn fileList = new Test1().getFileList();rn Vector vcr = new Vector(fileList.length);rn for(int i=0;i
求助 datagrid控件 Columns(2) 下标越界问题!!!
rn' ******************************************************************************rn'窗体公共变量定义rn' ******************************************************************************rnOption ExplicitrnDim txtSQL As String 'SQL语句rnDim txtTest As String '检验数据库中是否存在记录的SQL语句rnDim rstUser As ADODB.Recordset '用户信息数据集rnDim results As Boolean 'ExcuteSQL函数执行结果rnDim result As IntegerrnDim str As String '警告信息的返回值rnrnPrivate Sub cmdAdd_Click()rnIf txtIsNull(txtUser) Then '检验输入值不能为空rn MsgBox "用户名不能为空!", vbOKOnly + vbExclamation, "警告"rn Exit SubrnElsern If IsOverStringLen(txtUser.Text, 10) Thenrn MsgBox "用户名不能超过10位!", vbOKOnly + vbExclamation, "警告"rn txtUser.SetFocusrn txtUser.BackColor = BLUErn Exit Subrn End IfrnEnd IfrnIf txtIsNull(txtPassword) Thenrn MsgBox "为系统安全,请输入密码!", vbOKOnly + vbExclamation, "警告"rn Exit SubrnElsern If IsOverStringLen(txtPassword.Text, 8) Thenrn MsgBox "密码不能超过8位!", vbOKOnly + vbExclamation, "警告"rn txtPassword.SetFocusrn txtPassword.BackColor = BLUErn Exit Subrn End IfrnEnd IfrnIf cboUser.Text = "" Thenrn MsgBox "请选择用户类型!", vbOKOnly + vbExclamation, "警告"rn cboUser.SetFocusrn Exit SubrnElsern If IsOverStringLen(cboUser.Text, 20) Thenrn MsgBox "用户类型不能超过20位!", vbOKOnly + vbExclamation, "警告"rn txtUser.SetFocusrn txtUser.BackColor = BLUErn Exit Subrn End IfrnEnd Ifrn'检验此用户名是否已经存在rntxtTest = "select UserId from tbUser where UserId ='" + Trim(txtUser.Text) + "'"rnIf DBExist(txtTest) <> 0 Thenrn MsgBox "用户名重复,请重新输入!", vbOKOnly + vbExclamation, "警告"rn txtUser.BackColor = BLUErnElsern txtSQL = "insert into tbUser(UserId,UserPassword,UserKind)"rn txtSQL = txtSQL + "values('" + Trim(txtUser.Text) + "','"rn txtSQL = txtSQL + Trim(txtPassword.Text) + "','" + Trim(cboUser.Text) + "')"rn results = ExecuteSQL(txtSQL, rstUser, True)rn MsgBox "添加成功!", vbOKOnly + vbExclamation, "警告"rn Call viewDataUserrnEnd IfrnEnd SubrnPrivate Sub cmdDel_Click()rnIf txtIsNull(txtUser) Then '检验删除记录是否选定rn MsgBox "请选择删除的记录!", vbOKOnly + vbExclamation, "警告"rn Exit SubrnEnd Ifrn'提示警告信息rnstr = MsgBox("是否删除当前记录?", vbOKCancel, "删除当前记录")rnIf str = vbOK Thenrn txtTest = "select UserId from tbUser where UserId ='" + Trim(txtUser.Text) + "'"rn '检验此用户名是否已经存在rn If DBExist(txtTest) = 0 Thenrn MsgBox "无此用户!", vbOKOnly + vbExclamation, "警告"rn txtUser.BackColor = BLUErn Elsern txtSQL = "delete from tbUser where UserId='" + Trim(txtUser.Text) + "'"rn results = ExecuteSQL(txtSQL, rstUser, True)rn MsgBox "删除成功!", vbOKOnly + vbExclamation, "警告"rn txtUser.Text = ""rn txtPassword.Text = ""rn Call viewDataUserrn End IfrnEnd IfrnEnd SubrnPrivate Sub cmdExit_Click()rnUnload MernEnd SubrnPrivate Sub cmdModify_Click()rnIf txtIsNull(txtUser) Then '检验修改记录是否选定rn MsgBox "请选择需要修改的记录!", vbOKOnly + vbExclamation, "警告"rn Exit SubrnEnd Ifrnstr = MsgBox("是否修改当前记录?", vbOKCancel, "删除当前记录") '提示警告信息rnIf str = vbOK Thenrn txtTest = "select UserId from tbUser where UserId ='" + Trim(txtUser.Text) + "'"rn '检验此用户名是否已经存在rn If DBExist(txtTest) = 0 Thenrn MsgBox "无此用户,请添加此用户或重新输入用户名!", vbOKOnly + vbExclamation, "警告"rn txtUser.BackColor = BLUErn Elsern If IsOverStringLen(txtPassword.Text, 8) Or Trim(txtPassword.Text) = "" Thenrn MsgBox "密码不能为空且不能超过8位!", vbOKOnly + vbExclamation, "警告"rn txtPassword.SetFocusrn txtPassword.BackColor = BLUErn Exit Subrn End Ifrn txtSQL = "update tbUser set UserId = '" + Trim(txtUser.Text)rn txtSQL = txtSQL + "', UserPassword = '" + Trim(txtPassword.Text)rn txtSQL = txtSQL + "',UserKind = '" + Trim(cboUser.Text)rn txtSQL = txtSQL + "' where UserId='" + Trim(txtUser.Text) + "'"rn results = ExecuteSQL(txtSQL, rstUser, True)rn MsgBox " 修改成功!", vbOKOnly + vbExclamation, "警告"rn Call viewDataUserrn End IfrnEnd IfrnEnd SubrnPrivate Sub dgUser_RowColChange(LastRow As Variant, ByVal LastCol As Integer)rnIf result <> 0 Thenrn txtUser.Text = dgUser.Columns(0).Textrn txtPassword.Text = dgUser.Columns(1).Textrn cboUser.Text = dgUser.Columns(2).Textrn(就是这段,调试的时候显示<em>下标越界</em>,实时错误 9,我已经把Columns默认的2项改成三项了,还是这个问题,整个工程里均有这个问题,请大家帮帮忙,谢谢了....)rnEnd IfrnEnd SubrnPrivate Sub Form_Load()rn cboUser.AddItem ("系统管理员")rn cboUser.AddItem ("人力资源主管")rn cboUser.AddItem ("普通用户")rn Call viewDataUserrnEnd SubrnPrivate Sub txtPassword_Change()rntxtPassword.BackColor = WHITErnEnd SubrnPrivate Sub txtUser_Change()rntxtUser.BackColor = WHITErnEnd Subrn' ******************************************************************************rn'过程名:viewDataUserrn'说 明:将用户信息数据在dg中显示rn'参 数:无rn'返回值:无rn' ******************************************************************************rnPrivate Sub viewDataUser()rn'检索所有的用户信息rntxtSQL = "select UserId as 用户名,UserPassword as 用户密码,UserKind as 用户类型 "rntxtSQL = txtSQL + " from tbUser order by UserId"rnresult = viewData(txtSQL, dgUser)rnEnd Subrn
vector问题求助~!
在A.h里:rntypedef struct STrnrn int x;rnstr;rnrn在B.cpp里:rntypedef str arrStr[10];rnarrStr wc;rnrn<em>vector</em>< str > vec;rnrnfor( int i = 0; i < 10; i++ )rn vec.push_back( wc[i] );rnrnfor( <em>vector</em>< str >::iterator i = vec.begin(); i != vec.end(); i++ )rnrn if( (*i).x == 1 )rn rn vec.erase( i ); //为什么这样进不来?rn rnrnrn当我在逻辑函数里监控到wc[i].x == 1 的时候, vec里为什么不满足(*i).x == 1这个条件?rn
菜鸟求助,,有关vector
请问这个为什么运行不出结果呢?rnrn string s1;rn <em>vector</em> s;rnrn//从键盘输入几个string到vetor中rnrn while (cin >> s1)rn rn s.push_back(s1);rn rnrn//由屏幕输出<em>vector</em>中的内容rnrn for(<em>vector</em>::iterator iter = s.begin(); iter != s.end(); ++iter)rn rn cout << *iter<
vector问题求助
我有一个plate类,生成了一些plate对象。为了便于管理,我把这些对象放入<em>vector</em>中。但是我从<em>vector</em>中取出相应位置的对象的时候,<em>vector</em>的返回值是object对象,而不是我需要的plate对象。我该如何才能获得plate对象了?
求助:vector中间值
rn有一个Vector 假设其中的值为(1,2,3,4,5,6,7,8) //已经使用SORT方法rnrn设一参考值 int res;rnrn求得位置使得 res的值大于前面的值,小于或等于后面的值?rnrn有这样的算法吗?rnrn谢谢帮助rnrn~~rnrnrnrn
求助vector的partial_sort的用法?
下面是我的程序:rnrn#include rnusing namespace std;rn#include rnrntypedef struct VectorItemrn int nIndex;rn double dPower;rnVectorItem;rnrnpartial_sort(<em>vector</em>item.begin(),<em>vector</em>item.begin()+20,<em>vector</em>item.end(),rule);rnrnbool CMyTestDefineDlg::rule( const VectorItem& p1, const VectorItem& p2 )rnrn return p1.dPower > p2.dPower;rnrnrn我想取出<em>vector</em>item中dpower在前20的数,上面是我的代码,可是运行有错误,请高手指点。
关于vector的问题,求助!!!!!!!!!
比如我有个<em>vector</em>,里面是这样的[2 17 4 2 0 , 1 2 0 , 3 0 ],我想把后面两个里的与最长的那个不相同的都后面用0补齐,就是变成[2 17 4 2 0 , 1 2 0 0 0 , 3 0 0 0 0 ]这样,请问该怎么操作呢????谢谢啊rn
求助vector的输入
rnrn#includern#includernusing namespace std;rnrnint main()rn <em>vector</em> length(3);rn for(int i=0;i>length[i];rn// length[9]=1.2;rn rn cout<
Opencv图像拼接出错vector subscript out of range下标越界
[code=c]#include "opencv2/opencv.hpp"rn#include rn#include rn#include rn#include rn#include rn#include rn#include rn#define __BEGIN__ 50rnrnrnusing namespace std;rnusing namespace cv;rnrnrnchar img1_file[] = "27.jpg"; //读取原图像rnchar img2_file[] = "28.jpg";rnrnrnIplImage* stack_imgs1( IplImage* img1, IplImage* img2 )rnrn IplImage* stacked = cvCreateImage( cvSize( img1->width + img2->width,rn MAX (img1->height , img2->height) ),rn IPL_DEPTH_8U, 3 );rnrn cvZero( stacked ); //清空数组rn cvSetImageROI( stacked, cvRect( 0, 0, img1->width, img1->height ) ); //基于给定的矩形设置感兴趣区域rn cvAdd( img1, stacked, stacked, NULL ); //计算两个数组中每个元素的和rn cvSetImageROI( stacked, cvRect(img1->width, 0, img2->width, img2->height) );rn cvAdd( img2, stacked, stacked, NULL );rn cvResetImageROI( stacked ); //释放图像的ROI rnrn return stacked;rnrnrnint main(int argc, char* argv[])rnrn IplImage* img1_cvLoadImage, * img2_cvLoadImage, * stacked; //表示图像的结构体 声明结构体指针,指向图像rnrnrn //图像融合时用到的参数rn unsigned char* data1; //temp_xformed_2rn int step1;rn int channels1;rnrn unsigned char* data2 ; //img2rn int step2;rn int channels2;rnrn unsigned char* data3 ; //temp_xformed_1rn int step3;rn int channels3;rnrn double w; //使用加权平均法进行图像融合时的权值rnrnrn img1_cvLoadImage = cvLoadImage( img1_file, 1 ); //从文件中读取图像 从指定文件读入图像,返回读入图像的指针rn if( ! img1_cvLoadImage )rn printf( "unable to load image from %s", img1_file );rn img2_cvLoadImage = cvLoadImage( img2_file, 1 );rn if( ! img2_cvLoadImage )rn printf( "unable to load image from %s", img2_file );rnrn cvNamedWindow( "原图1 img1_cvLoadImage ", 1 ); rn cvShowImage( "原图1 img1_cvLoadImage ", img1_cvLoadImage );rnrn cvNamedWindow( "原图2 img2_cvLoadImage ", 1 );rn cvShowImage( "原图2 img2_cvLoadImage ", img2_cvLoadImage );rnrn //stacked = stack_imgs( img2_cvLoadImage, img1_cvLoadImage ); //上下组合两幅图像rn stacked = stack_imgs1( img2_cvLoadImage, img1_cvLoadImage ); //左右组合两幅图像rnrn rn <em>vector</em> keys1, keys2; //存储关键点rn Mat descriptors1, descriptors2;rn rn SurfFeatureDetector detector_Freak(2000);rn BruteForceMatcher> matcher;rn std::<em>vector</em>< DMatch > matches;rn rn FREAK freak;rn int64 st, et;rn st = cvGetTickCount();rn rn double t = (double)getTickCount();rn // detectrn t = (double)getTickCount();rn detector_Freak.detect(img1_cvLoadImage,keys1);rn detector_Freak.detect(img2_cvLoadImage, keys2);rn t = ((double)getTickCount() - t)/getTickFrequency();rn cout << "FREAK detection time [s]: " << t/1.0 << endl;rnrn // extractrn t = (double)getTickCount();rn freak.compute(img1_cvLoadImage, keys1, descriptors1);rn freak.compute(img2_cvLoadImage, keys2, descriptors2);rn t = ((double)getTickCount() - t)/getTickFrequency();rn cout << "FREAK extraction time [s]: " << t << endl;rn matcher.match(descriptors1, descriptors2, matches);rn rn double max_dist = 0;rn double min_dist = 100;rn rn for (int i=0; i max_dist) max_dist = dist;rn rn printf("-- Max dist : %f \n", max_dist);rn printf("-- Min dist : %f \n", min_dist);rn rn <em>vector</em> good_matches_Freak;rn for (int i=0; i(), DrawMatchesFlags::NOT_DRAW_SINGLE_POINTS);rnrn // displayrn imshow("matchFREAK", imgMatch_Freak);rnrn rn //waitKey();rn rn <em>vector</em> pt1,pt2; //定义点容器,存储匹配的那些特征点rn pt1.resize(good_matches_Freak.size());rn pt2.resize(good_matches_Freak.size());//设置断点于此,前面运行正确rn for(int i = 0; i < (int)good_matches_Freak.size(); i++)rn pt1.push_back(Point2f(keys2[good_matches_Freak[i].queryIdx].pt.x, keys2[good_matches_Freak[i].queryIdx].pt.y)); rnrn pt2.push_back(Point2f(keys1[good_matches_Freak[i].trainIdx].pt.x, keys1[good_matches_Freak[i].trainIdx].pt.y));rn rnrnrn Mat homo;rnrn //st = cvGetTickCount();rn homo = findHomography(pt1, pt2,CV_RANSAC); //寻找单应变换矩阵rn //et = cvGetTickCount();rn //printf("ransac time: %f\n", (et-st)/(double)cvGetTickFrequency()/1000.); //ransac所花费的时间rnrn printf("homo\n" //是一个3*3的变换矩阵rn "%f %f %f\n"rn "%f %f %f\n"rn "%f %f %f\n",rn homo.at(0,0), homo.at(0,1), homo.at(0,2),rn homo.at(1,0), homo.at(1,1), homo.at(1,2),rn homo.at(2,0), homo.at(2,1), homo.at(2,2));rn[/code]rn程序不完全,后面太长,问题在<em>vector</em>的用法上,试了好多方法,还是提示<em>下标越界</em>,求高人指导。
求助,关于vector的问题
#include rn#include rnusing namespace std;rnrntemplate rnvoid listInfo(<em>vector</em> &v)rnrn cout<< data;rn listInfo(data);rn rn cout< numbers(10,-1);rn cout<
求助,关于vector
<em>vector</em> svec(5)这段代码c++primer说是现会调用string的默认构造函数创建一个临时值初始化svec,然后用复制构造函数将临时值复制到svec的每一个元素,可是为什么会调用复制构造函数呢?
求助:定义Vector
定义一个 <em>vector</em> v;rn应该怎样定义一个功能类似<em>vector</em>< <em>vector</em> > v1的数据rn谢谢
求助vector排序
整形<em>vector</em>的数据为(5,6,3,28,9,。。。)rnrn有一整数 5rnrn经过排序rnrn得到rn (5,6,9,28,3,。。。)rnrn请问该如何排序呢rnrn谢谢~~
求助vector 段错误
Segmentation fault (core dumped)rnrn////////////////////////////////////////////////////////////rn(gdb) btrn#0 0x0000003b2683471a in ?? ()rn#1 0x00007fffac4bc230 in ?? ()rn#2 0x0000000000438888 in CDataOpt::PutUserBird (this=Cannot access memory at address 0xfffffffffffffee8rn) at DataOpt.cpp:1001rnBacktrace stopped: previous frame inner to this frame (corrupt stack?)rn(gdb) uprn#1 0x00007fffac4bc230 in ?? ()rn(gdb) rn#2 0x0000000000438888 in CDataOpt::PutUserBird (this=Cannot access memory at address 0xfffffffffffffee8rn) at DataOpt.cpp:1001rnwarning: Source file is more recent than executable.rn1001 if (vecUserBird.empty())rn////////////////////////////////////////////////////////////rn[code=C/C++]rnstruct UserBirdrnrn int uid;rn std::string birds;rnrn UserBird():uid(0) rn;rnrnint CDataOpt::PutUserBird(<em>vector</em>& vecUserBird)rnrn if (vecUserBird.empty()) // gdb bt 显示的 1001 行号rn rn return 0;rn rn .....rn return 0;rnrn // 调用处rnint CDataOpt::fun1()rnrn <em>vector</em> vecUserBird;rn PutUserBird(vecUserBird);rn .....rn return 0;rnrn[/code]rnrnrn大致用法是这样子的,找了很久没找出原因,求帮助!rn
求助:Cstring 转 vector
如题rn遇到别人写的函数要用<em>vector</em>rn不知道怎么把字符串转过去头痛啊rn拜托各位前辈指导一下rn谢谢了
vector奇怪问题求助
import java.util.*;rnimport javax.microedition.lcdui.*;rnimport javax.microedition.midlet.MIDlet;rnimport javax.microedition.lcdui.game.*;rnrnpublic class Board extends GameCanvas rnimplements CommandListener, Runnable rnrnint pillar1x = 50;rnint pillar1y = 175;rnint pillar2x = 100;rnint pillar2y = 175;rnint pillar3x = 150;rnint pillar3y = 175;rnrnrnVector plates1 = new Vector();rnrnFont font = Font.getFont(Font.FACE_SYSTEM,rnFont.STYLE_PLAIN, Font.SIZE_MEDIUM);rnRandom rand = new Random();rnrnThread thread;rnCommand exitCmd, resetCmd;rnMIDlet midlet;rnrnclass Plate rnint caption;rnboolean token;//ÁîÅÆ,»ñµÃÁîÅƲÅÊǰᶯÅÌ×ӵıØÒªÌõ¼þrnint attribute;//ÊôÓÚµÚ¼¸¸ùÖù×Órnint index;//ÔÚµÚ¼¸¸ùÖù×ÓÉϵĵڼ¸¸öλÖÃrnpublic Plate(int caption,int attribute) rnthis.caption = caption;rnthis.attribute = attribute;rnrnrnboolean getToken()rnreturn this.token;rnrnrnvoid setToken(boolean token)rnthis.token = token;rnrnrnvoid setAttribute(int attribute)rnthis.attribute = attribute;rn rnrnint getAttribute()rnreturn this.attribute;rnrnrnvoid setIndex(int index)rnthis.index = index;rn rnrnint getIndex()rnreturn this.index;rnrnrnvoid paint(Graphics g) rn//drawRect(int x,int y,int weight,int height)rnint px;rnint py;rnint width;rnint height;rnrnheight = 10;rnwidth = caption * 10;rnrnif(this.attribute == 1)//Èç¹ûÊôÓÚµÚÒ»¸ùÖù×Órnpx = pillar1x - (this.caption * 5);rnpy = pillar1y - (this.index * 5);rnrnelse if(this.attribute == 2)rnpx = pillar2x - (this.caption * 5);rnpy = pillar2y - (this.index * 5);rnrnelse rnpx = pillar3x - (this.caption * 5);rnpy = pillar3y - (this.index * 5); rnrnrng.setFont(font);rng.drawRect(px, py, width, height);rnrnrnrnpublic Board(MIDlet midlet_) rnsuper(true);rnmidlet = midlet_;rnrnfor(int i = 1;i < 4;i++)rnplates1.addElement(new Plate(i,1));rnrnrnexitCmd = new Command("Í˳ö", Command.EXIT, 0);rnresetCmd = new Command( "¿ªÊ¼", Command.SCREEN, 1);rnaddCommand( exitCmd );rnaddCommand( resetCmd );rnsetCommandListener(this);rnrnrnpublic void commandAction(Command c, Displayable d) rnif( c==exitCmd ) rnmidlet.notifyDestroyed();rnelse if( c==resetCmd ) rnresetGrid();rnrnrnvoid resetGrid() rnrnrnrnpublic void paint( Graphics g )rnrnflushGraphics();rnrnpublic void paintAll(Graphics g) rng.drawLine(pillar1x,pillar1y,pillar1x,pillar1y-75);rng.drawLine(pillar2x,pillar2y,pillar2x,pillar2y-75);rng.drawLine(pillar3x,pillar3y,pillar3x,pillar2y-75); rnfor(int i=0;i 100 ) break; // ×î¾ÃµÈ1Ãërnrnrnrnrnrnvoid moveLeft()rnrnrnvoid moveRight()rnrnrnvoid cursorChange()rnrnrnvoid errout(String s)rnSystem.out.println(s);rnrnrn在****句老是提示 cannot resolve symbol symbol : method get (int)rn简直晕死。get不是<em>vector</em>自带的方法吗?怎么会找不到了?!rn
求助关于Vector的问题?
我在jsp中定义了两个Vector变量如下:rn Vector jsxx=new Vector();rn Vector jslink=new Vector();rn将数据库中的值取出来存入这两个变量中:rnjslink.addElement(rsj.getString("link"));//这里取的是字母,就是链接地址rnjsxx.addElement(TC.tranChinese1(rsj.getString("info"),"gb2312"));//在这里取的是汉字,将编码转换了。rn在下面我将这两个值输出了:rnSystem.out.println("jsxx="+jsxx);rnSystem.out.println("jslink="+jslink.size());rn问题就出来了,jsxx这个变量的输出没问题,页jslink这个变量输出时老是出错,请问各位高手是怎么一回事呀?我将System.out.println("jslink="+jslink.size());给注释起来就不出错了。rn错误信息如下:rnjava.lang.VerifyError: (class: _chun/_yunyu/_yunqibaojian/_youyuntong/_index__jsp,rnmethod: _jspService signature: (Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V)rnIllegal target of jump or branchrn at java.lang.Class.getDeclaredConstructors0(Native Method)rn at java.lang.Class.privateGetDeclaredConstructors(Class.java:1576)rn at java.lang.Class.getConstructor0(Class.java:1748)rn at java.lang.Class.newInstance0(Class.java:266)rn at java.lang.Class.newInstance(Class.java:249)rn at com.caucho.jsp.JspManager.loadClass(JspManager.java:274)rn at com.caucho.jsp.JavaGenerator.compile(JavaGenerator.java:2836)rn at com.caucho.jsp.JspGenerator.generate(JspGenerator.java:322)rn at com.caucho.jsp.JspParser.parse(JspParser.java:327)rn at com.caucho.jsp.JspParser.parse(JspParser.java:232)rn at com.caucho.jsp.JspManager.createPage(JspManager.java:175)rn at com.caucho.jsp.PageManager.getPage(PageManager.java:346)rn at com.caucho.jsp.PageManager.getPage(PageManager.java:201)rn at com.caucho.jsp.QServlet.getPage(QServlet.java:220)rn at com.caucho.server.http.FilterChainPage.doFilter(FilterChainPage.java:129)rn at com.caucho.server.http.Invocation.service(Invocation.java:312)rn at com.caucho.server.http.CacheInvocation.service(CacheInvocation.java:135)rn at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:244)rn at com.caucho.server.http.HttpRequest.handleConnection(HttpRequest.java:163)rn at com.caucho.server.TcpConnection.run(TcpConnection.java:137)rn at java.lang.Thread.run(Thread.java:536)rnrnrn--------------------------------------------------------------------------------rnResin 2.1.6 (built Fri Nov 8 08:18:18 PST 2002) rn这个错误信息让我很迷惑,不知道到底错误在哪里,我的英文不好,请各位高手帮忙?
求助:char数组与vector
定义了一个<em>vector</em>rn[code=C/C++]rnrn <em>vector</em> m_item;rnrn <em>vector</em>::iterator iter_Item;rn rn[/code]rnrn添加数据:rn[code=C/C++]rn char value0[13];rn m_item.push_back(value0);rn // iter_Item = m_item.end();rn[/code]rn报错:rn“初始化”: 无法从“const char [13]”转换为“char [13]”rn应该怎么改呢?rn谢谢
求助】c++ vector 的使用
DescriptionrnrnrnThe only printer in the computer science students?union is experiencing an extremely heavy workload. Sometimes there are a hundred jobs in the printer queue and you may have to wait for hours to get a single page of output. Because some jobs are more important than others, the Hacker General has invented and implemented a simple priority system for the print job queue. Now, each job is assigned a priority between 1 and 9 (with 9 being the highest priority, and 1 being the lowest), and the printer operates as follows. rn?The first job J in queue is taken from the queue. rn?If there is some job in the queue with a higher priority than job J, thenmove J to the end of the queue without printing it. rn?Otherwise, print job J (and do not put it back in the queue). rnrnIn this way, all those importantmuffin recipes that the Hacker General is printing get printed very quickly. Of course, those annoying term papers that others are printing may have to wait for quite some time to get printed, but that抯 life. rnrnYour problem with the new policy is that it has become quite tricky to determine when your print job will actually be completed. You decide to write a program to figure this out. The program will be given the current queue (as a list of priorities) as well as the position of your job in the queue, and must then calculate how long it will take until your job is printed, assuming that no additional jobs will be added to the queue. To simplifymatters, we assume that printing a job always takes exactly one minute, and that adding and removing jobs from the queue is instantaneous. rnrnInputrnrnOne line with a positive integer: the number of test cases (at most 100). Then for each test case: rn?One line with two integers n and m, where n is the number of jobs in the queue (1 ,&n,&m);rn int a;rn for(int i=0;ima)rn rn ma=ar[i];rn wei=i;rn rn rn if(ma==po)rn break;rn if(m::iterator it;rn for(it=ar.begin();;)rn rn if(*it==ma)rn rn it=ar.erase(it);rn n--;rn time++;rn break;rn rn ar.push_back(*it);rn it=ar.erase(it);rn rn ma=0;rn rn for(int i=0;i
vector菜鸟求助
<em>vector</em>: No such file or directory compilation terminated.rn编译的时候说下面两行出现严重错误rn#include rn#include "demo_lib_sift.h"rn这两句哪错了?rnrn
求助!关于vector
//main.cpprn#include"main.h"rnint main()rnrn int i1,j1,i2,j2;rn int num;rn <em>vector</em>t1;rn <em>vector</em>t2;rn cout<>i1>>i2;rn cout<>i2>>j2;rn if(j1!=i2)rn rn cerr<<<num;rn t2.push_back(num);//还有这里rn rn int num_line=0,num_column=0;rn int t3=0;rn <em>vector</em>::iterator pos1=t1.begin();rn <em>vector</em>::iterator pos1_end=t1.end();rn <em>vector</em>::iterator pos2=t2.begin();rn <em>vector</em>::iterator pos2_end=t2.end();//这里的pos1等,如果我想rn把pos1的值当作int型的整数来用,应该怎么办 rn .rn .rn .rn .rn .rn
vector求助
//编写一个使用矢量和迭代器的程序,允许用户维护一个他所喜欢的游戏列表。rn//这个程序应该允许用户列出所有游戏的名称、添加游戏名称和删除游戏名称 rnrn#include rn#include rn#include rn#include rn#include rnrnusing namespace std;rnrnvoid main()rnrn <em>vector</em> GameList;//游戏列表rn string str;rn int choice;rn int exit=0;rn int find=0;rnrn char yes_no;rnrn <em>vector</em> ::iterator myIterator;rn <em>vector</em> ::const_iterator iter;rn while(1)rn rnrn cout <<< endl << endl;rn cout <<< endl;rn cout <<< endl;rn cout <<< endl;rn cout <<> choice;rn rn while( isalpha( choice )||choice >3 || choice << "input a name of game!" <> str;rn GameList.push_back( str );*/rn if( GameList.empty() )rn rn cout << "The GameList was empty!"<> choice;rn for( int i=0; i> str;rn GameList.push_back( str ); rn cout <<> str;rn int pos;rn //myIterator = find( GameList.begin(),GameList.end(), str ); rn //GameList.erase(myIterator);rn for(pos=0,iter=GameList.begin(); iter!=GameList.end(); ++iter,++pos)rn rn int Location; rn cout << *iter<0 );rnrn4.我在vs.net 2003在编译c++程序时,release版本也可以调试,那如果要发行呢?怎样删除里面的debug信息呢?还有就是调试时出现中断,程序自动跳出汇编语言,我看不懂汇编语言,可不可以,让汇编语言不出来?rn
关于下标越界
我的程序<em>下标越界</em>于是我下标增加了1000,会出现什么后果吗?
下标越界问题
各位大侠们帮我看下这是怎么回事?rnrnrnrnrnrnrnrn<>AdminPwd thenrn rn end ifrn rn rs("LoginTime")=Now()rn rs.Updatern session("Member_Client_Name")=rs("UserName") '登陆名称rn session("Member_Client_Id")=rs("id") '登陆编号rn session.timeout=50rn dim msgrn msg= " "rnend ifrnrnend ifrn%>rnrnrnrn rnrn rn rnrn rn rn rn rn rn rn rn rn rn rn rn rnrnrnrn
下标越界"错误">"下标越界"错误
Dim bp() As DoublernDim bv() As DoublernSet V_UR_rs = New ADODB.RecordsetrnV_UR_rs.Open "select * from usingrate", conn, adOpenStatic,adLockOptimisticrnIf V_UR_rs.RecordCount > 0 ThenrnReDim bp(1, V_UR_rs.RecordCount)rnReDim bv(1, V_UR_rs.RecordCount)rnrnV_UR_rs.MoveFirstrnFor i = 1 To V_UR_rs.RecordCountrn bp(i) = V_UR_rs!A -------出错rn bv(i) = V_UR_rs!B rn V_UR_rs.MoveNextrnNextrn
下标越界是什么?
<em>下标越界</em>是什么?
下标越界的问题
dim x()rn redim preserve x(1,1)rn x(0,0) = "A"rn x(0,1) = "B"rn x(1,0) = "C"rn x(1,1) = "D"rn redim preserve x(6,10)rnrn运行上面的代码,出现“<em>下标越界</em>的问题”的问题,rn哪位高手帮我看看为什么
如何防止下标越界或捕获下标越界异常
我的程序越来越大,最近测试,长时间运行会出现一些奇怪的异常退出,据经验判断,一般这种运行时异常大多是使用new造成泄漏或者是<em>下标越界</em>造成溢出引起的,而对new的使用我已经做了相应的防范措施,所以我怀疑很大可能性是<em>下标越界</em>导致其他数据被修改后造成程序异常,但是程序实在太大了,不知如何查找其位置,还请高手指点下,万分感谢!
数组下标越界
dim i,MyArrayrnMyArray = split(FileName,",")rnFor I=0 to Ubound(MyArray)rnresponse.write MyArray(i)& " "rnNEXTrnresponse.write MyArray(0)& " "rnrn提示rnMicrosoft VBScript 运行时错误 错误 '800a0009' rnrn<em>下标越界</em>: '[number: 0]' rnrn/upv22/example/savetofile.asp,rn高手解决一下
奇怪的下标越界
我采用以下语句调整datagrid1的每列的列宽,在其他页面中很好用,但在这个页面的Private Sub DataGrid1_RowColChange(LastRow As Variant, ByVal LastCol As Integer)事件中(其他页面的这个事件调整正常),调整就出现<em>下标越界</em>。rnDataGrid1.Columns(0).Width = 500rnDataGrid1.Columns(1).Width = 700rnDataGrid1.Columns(2).Width = 500rnDataGrid1.Columns(3).Width = 500rnDataGrid1.Columns(4).Width = 1100rnDataGrid1.Columns(5).Width = 1100rnDataGrid1.Columns(6).Width = 800rnDataGrid1.Columns(7).Width = 900rnDataGrid1.Columns(8).Width = 1500rnDataGrid1.Columns(9).Width = 800rnDataGrid1.Columns(10).Width = 1100rnDataGrid1.Columns(11).Width = 1200rnDataGrid1.Columns(12).Width = 800rnDataGrid1.Columns(13).Width = 800rnDataGrid1.Columns(14).Width = 1500rnDataGrid1.Columns(15).Width = 800rnDataGrid1.Columns(16).Width = 500rnrn到了DataGrid1.Columns(2).Width = 500就提示<em>下标越界</em>,如果删除这句以及下面的调整宽度的语句,程序可以运行起来,datagrid1的1、2列宽调整正常,但3~17列根本不可用,根本点不中,而这些列的数据都在,就是不可点中,难怪也就越界了。奇怪得很,请各位大虾指点指点吧。
下标越界”的错误
数据库(类型为Access)管理系统,打包后的程序安装到用户那里,使用Data控件和dbGrid查看数据的时候,经常后出现“<em>下标越界</em>”的错误,如果在出现错误的机子上安装vb6.0就好了,请大家帮忙分析一下是什么原因?
学生——下标越界
在调学生时遇见了<em>下标越界</em>的问题: 为啥会报错呢? 原因:数组的下标超出数组的可取值范围,简单理解就是溢出了。举一个例子,一个杯子,他的容量是200ml,但是当你倒入250ml的水时,它就会溢出,因为本质的容水量时固定的,那么有溢出就相当与越界。 实际应用错误: 在学生中进行报错的窗体是查询窗体,查询窗体运用到了MSHFlexGrid控件用来显示查询结果。这次的报错与它息息相关。在错误提...
下标越界的问题???
以下程序,老是提示"rn错误类型:rnMicrosoft VBScript 运行时错误 (0x800A0009)rn<em>下标越界</em>: '1'rn/renzi/02.asp, 第 41 行rn"rn-------------------------------------------------------------------------------rnrnrnrnrnrnrnrn请各位看看,怎么回事??rn谢谢
提示下标越界
[code=VB]Dim myarray() rnRedim myarray(1,2) rnj=1rn do while not rs.eofrn myarray(j,0)=Csng(rs("total"))rn myarray(j,1)=rs("tt")rn j=j+1rn ReDim Preserve myarray(j,2) rn rs.movenextrn looprn rs.closern set rs=nothingrn call CloseConn() rnend if[/code]rnrn该如何处理?rn谢谢!
下标越界的处理方法。
有3个字段rnrnstrA="A,B,C"rnrnstrB="X,Y,Z"rnrnstrC="" 这个参数可能是“1”也可能是“1,2”也可能是“1,2,3”,也可能是空rnrn在这样的情况下做循环插入,rnrn当strC的值长度跟strA,strB不一样的时候,就会提示<em>下标越界</em>。rnrn这样的情况应该怎么处理。
Kozuka Gothic Pro下载
日文字体,很不错的一款设计字体,是设计人员必不可少的,这个字体真好难找 找到了也没得下,所以我在这里提供大家下载。 相关下载链接:[url=//download.csdn.net/download/fengshao0909/2296236?utm_source=bbsseo]//download.csdn.net/download/fengshao0909/2296236?utm_source=bbsseo[/url]
C#金额从小写转为大写下载
这个是网上的C#金额从小与转为大写的程序 相关下载链接:[url=//download.csdn.net/download/luolintly/2450046?utm_source=bbsseo]//download.csdn.net/download/luolintly/2450046?utm_source=bbsseo[/url]
e语言键码转键名下载
易语言的键码转键名易语言的键码转键名易语言的键码转键名易语言的键码转键名 相关下载链接:[url=//download.csdn.net/download/qq441660281/3825682?utm_source=bbsseo]//download.csdn.net/download/qq441660281/3825682?utm_source=bbsseo[/url]
相关热词 c# xml的遍历循环 c# 取 查看源码没有的 c#解决高并发 委托 c#日期转化为字符串 c# 显示问号 c# 字典对象池 c#5.0 安装程序 c# 分页算法 c# gmail 发邮件 c# 多层文件
我们是很有底线的