当前位置:首页
开发技术指南» 文章正文
    引言:
 

 

 ·大虾们来看看    »显示摘要«
    摘要: 我写了这个代码: <html> <head> <title>hello!</title> </head> <body> <? $link=mysql_connect("localhost","zhoufengliang","lxgp06"); if($l......
 ·html    »显示摘要«
    摘要: <html> <head> <title>你好</title> </head> <body> <frameset rows="30%,70%" border="2"> <frame src="ccc.html" name="fram......


为什么将数字在文本框中输出是会容易死机

代码如下:  
  Private   Sub   Command1_Click()  
    Dim   i   As   Single,   j   As   Integer  
    Dim   x   As   Single,   y(32600)   As   Currency  
    For   x   =   0   To   1000  
      y(x)   =   170   *   (1   -   ((850   -   x   /   50)   /   850)   ^   2.8)  
      i   =   x   /   50  
      Text1.Text   =   Text1.Text   +   "X"   +   Str$(x)   +   "="   +   Str$(i)   +   "         Y"   +   Str$(x)   +   "="   +   Str$(y(x))   +   Chr$(13)   +   Chr$(10)  
    Next   x  
  End   Sub  
  我要计算很多个点,然后输出。我把它从文本框输出。当只输入200个点时,不会死机。但是点越多月难计算,半天出不来,还容易死机。请帮帮忙!谢谢!  
 

NO.1   作者: wfnuser

你加一个滚动条要好一点了。  
  Private   Sub   Command1_Click()  
    Dim   i   As   Single,   j   As   Integer  
    Dim   x   As   Single,   y(32600)   As   Currency  
    dim   tstr   as   string  
    For   x   =   0   To   1000  
      y(x)   =   170   *   (1   -   ((850   -   x   /   50)   /   850)   ^   2.8)  
      i   =   x   /   50  
      Tstr   =   Tstr   +   "X"   +   Str$(x)   +   "="   +   Str$(i)   +   "         Y"   +   Str$(x)   +   "="   +   Str$(y(x))   +   Chr$(13)   +   Chr$(10)  
    Next   x  
  text1=tstr  
  End   Sub  
   
  再多一点的话你可以考虑一下分段  
 

NO.2   作者: cuizm

在循环里最好不要直接用TEXT控件进行字符串累加,因为访问控件的时候要先寻址,所以如果用变量的话会大大的加快速度.如果循环数过多,也可能是导致死机的原因吧~~


    摘要: 在dreamweaver中用模板建立了一个aspx文件,关闭dreamweaver。 用c#.net打开这个文件,发现dreamweaver使用的模板定义信息发生了位置移动现象。再用dw编辑模板后就不能更新建立的aspx文件了。 如何才能不让c#.net对注释信息移动位子?? 正常情况代码 --------------------------------------------------......
» 本期热门文章:

©2000-2007 All Rights Reserved. 最佳浏览:1024X768 MSIE