Chinaunix首页 | 论坛 | 博客
  • 博客访问: 285064
  • 博文数量: 69
  • 博客积分: 2408
  • 博客等级: 大尉
  • 技术积分: 745
  • 用 户 组: 普通用户
  • 注册时间: 2005-06-09 16:37
文章分类

全部博文(69)

文章存档

2011年(16)

2010年(42)

2008年(9)

2005年(2)

我的朋友

分类:

2008-05-28 10:10:46

文件: auto data.rar
大小: 1KB
下载: 下载

//call getString 123, 9;
//message $$return;
// call getRandum 12;
// message $$return;
// call numToJP "349872459087324534";
// message $$return;

$$sircd = "00000";
$$syohincd = "000000";
$$kounyu = "20000101";
//call getRandum 7;
##sirCnt =  val(input("仕入数","7"));
##sirNum = 0;
// call getRandum 8;
 ##kounyuCnt = val(input("購入数","8"));
//  call getRandum 18;
  ##syohinCnt = val(input("商品数", "5"));
while(##sirNum < ##sirCnt){
 call getRandum 4;
 call getString (val($$sircd) + ##return), 5;
 $$sircd = $$return;
 
 ##kounyuNum = 0;
 while(##kounyuNum < ##kounyuCnt){
  call getRandum 4;
  call dateAdd $$kounyu, ##return*30;
  $$kounyu = $$return;
  ##syohinNum = 0;
  while(##syohinNum < ##syohinCnt){
// message "syohinNum: " + str(##syohinNum) + "   syohinCnt: " + str(##syohinCnt) + "     kounyuNum: " + str(##kounyuNum) + "   kounyuCnt: " + str(##kounyuCnt) + "     sirNum: " + str(##sirNum) + "   sirCnt: " + str(##sirCnt);
   call getRandum 4;
   if(##return <2){
    call getString val($$syohincd) + ##return, 6;
    $$syohincd = $$return;
   }
   
   call getRandum 500;
   call getString ##return, 5;
   $$suryo = $$return;
   call getRandum 1999;
   call getString ##return, 7;
   $$tanka = $$return;
   call getRandum 9999;
   call getString ##return, 11;
   $$kakaku = $$return;
   call getString val($$sircd), 5;
   call numToJP $$return;
   $$sircdJP = $$return;
   call getRandum 100000;
   call getString ##return, 5;
   call numToJP $$return;
   $$sezomoto = $$return;
   call getString val($$syohincd), 6;
   call numToJP($$return);
   call getString val($$syohincd), 5;
   call numToJP $$return;
   $$syohincdJP = $$return;
   insert $$sircd + "仕入先名=仕入先" + $$sircdJP +
   "  製造元=製造元" + $$sezomoto + "   " + $$syohincd +
   "商品名=商品名" + $$syohincdJP + "   " + $$kounyu + $$suryo +
   $$tanka + $$kakaku + "        " + "\n";
//   gofileend;
//   insertline;
   ##syohinNum = ##syohinNum + 1;
  }
//  message "before + 1: " + str(##kounyuNum);
  ##kounyuNum = ##kounyuNum + 1;
//  message "after plus 1, kounyuNum: " + str(##kounyuNum);
 }
//  message "sir + 1";
 ##sirNum = ##sirNum + 1;
}
 
 
 
endmacro;

//return the date that $$1(date in form of "yyyymmdd") adding ##2(days)
dateAdd:
 ##year = val(midstr($$1, 0, 4));
 ##month = val(midstr($$1, 4, 2));
 ##day = val(midstr($$1, 6, 2));
// message "year: " + str(##year);
// message "month: " + str(##month);
// message "day: " + str(##day);
 
 ##days = ##2 + (##month * 30) + ##day;
 ##year = ##year + ##days/365;
 ##days = ##days % 365;
 ##month = ##days/30;
 ##day = ##days % 30;
 $$month = str(##month);
 $$day = str(##day);
 if(strlen(str(##month)) == 1){
  $$month = "0" + str(##month);
 }
 if(strlen(str(##day)) == 1){
  $$day = "0" + str(##day);
 }
 
return str(##year) + $$month + $$day;

//return the string which are converted from ##1 and with ##2 characters.
getString:
 //500 "0":
 $$temp = "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000";
 $$result = leftstr($$temp,##2-strlen(str(##1))) + str(##1);
return $$result;

numToJP:
 ##pos = 0;
 $$result = "";
// message "numToJP->$$1: " + $$1;
 while(##pos < strlen($$1) ){
//  message "before midstr";
  call getJpChar midstr($$1, ##pos, 1);
//  message "after midstr";
  $$result = $$result + $$return;
//  message "pos: " + str(##pos);
//  message "strlen($$1): " + str(strlen($$1));
//  message "##pos <= strlen($$1): " + str(##pos <= strlen($$1));
//  message "midstr($$1, ##pos, 1): " + midstr($$1, ##pos, 1);
  ##pos = ##pos + 1;
//  message "pos + 1 after";
 }
return  $$result;
 
getJpChar:
// message "getJpChar ->$$1; " + $$1;
 if($$1 == "0") return "0";
 else if($$1 == "1") return "1";
 else if($$1 == "2") return "2";
 else if($$1 == "3") return "3";
 else if($$1 == "4") return "4";
 else if($$1 == "5") return "5";
 else if($$1 == "6") return "6";
 else if($$1 == "7") return "7";
 else if($$1 == "8") return "8";
 else if($$1 == "9") return "9";
 
 

getRandum:
 
 ##temp1 = tickcount;
 ##loNum = tickcount % 10;
 while(##loNum > 0)
 {
  ##temp1 = ##temp1*##temp1;
  ##temp1 = val(midstr(str(##temp1), 3, 6));
  ##loNum = ##loNum-1;
 }
return (##temp1 % ##1) + 1;

 
阅读(1556) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~