个人网站: www.7dtest.com 7点测试群:(61369656)------(77273408)------(35710365)------(9410090)

Zee的LR脚本练习一:写随机数到文本里

上一篇 / 下一篇  2007-03-26 17:08:31 / 个人分类:Zee的生活

typedef long time_t;
Action()
{

 int i,k;
time_t t;
char *filename="c:\\test.txt";
 long file;
 srand((unsigned) time(&t));
 lr_output_message("Ten random numbers from 0 to 99\n\n");

if ((file = fopen(filename, "w+" )) == NULL) {

   lr_output_message("Unable to create %s", filename);

   return -1;
 }

 for (i=0; i<10; i++)     {
  lr_output_message("%d\n", rand()%100);
 k= rand()%100;
   fprintf(file,"%d \n ",k);
 }

   fclose(file);
return 0;



TAG: Zee的生活

xiaoshi_2011的个人空间 引用 删除 xiaoshi_2011   /   2013-08-14 11:48:12
3
引用 删除 wushuigen2008   /   2012-10-20 23:19:47
1
zoufeifei_88的个人空间 引用 删除 zoufeifei_88   /   2009-09-02 15:25:51
-1
比较狠的测试间 引用 删除 qiguojie   /   2007-05-30 11:36:53
fopen改一下,就可以增加条数
if ((file = fopen(filename, "a+" )) == NULL)
guxingyun的个人空间 引用 删除 guxingyun   /   2007-05-14 23:14:54
我在学习这段代码的时候发现设置pacing次数对于写入文本的数据条数没有影响,我想问一下,如果我将pacing设置为2或者更大,可否能让记录的条数也相应增加而不是覆盖之前的记录呢?
引用 删除 cherrybloom   /   2007-04-03 19:30:10
谢谢zee,我在学习编写测试脚本中~
 

评分:0

我来说两句

我的栏目

日历

« 2024-05-15  
   1234
567891011
12131415161718
19202122232425
262728293031 

数据统计

  • 访问量: 159246
  • 日志数: 146
  • 图片数: 1
  • 建立时间: 2006-12-05
  • 更新时间: 2012-11-16

RSS订阅

Open Toolbar