我想不断地得到一组数据,就像实时采集的数据那样,用vb里的随机函数怎么实现?谢谢

解决方案 »

  1.   

    Rnd 啊
    msdn里的
    The Rnd function returns a value less than 1 but greater than or equal to zero.The value of number determines how Rnd generates a random number:For any given initial seed, the same number sequence is generated because each successive call to the Rnd function uses the previous number as a seed for the next number in the sequence.Before calling Rnd, use the Randomize statement without an argument to initialize the random-number generator with a seed based on the system timer.To produce random integers in a given range, use this formula:Int((upperbound - lowerbound + 1) * Rnd + lowerbound)
      

  2.   

    根据你要的数据,把随机因子设置一下就可以了。
    Randomize
    Round((Rnd(1) * 2 - 1) * 0.5 + 0.1, 1)"0.5","1"是你自己随机设定。我们的数据采集演示版本就是这样作的。