收录日期:2018/09/20 11:43:18 时间:2016/05/21 14:08:40 标签:开发
有如下几个变量:char gBfFreearea [4000+1];
                int  wUsLoopcounter1 ;
                int  wUsLoopcounter2 ;
想实现下面的功能,该如何写代码?

(1)gBfFreearea中保存两个数字,只见用“,”分割,例如“123,456”,如何把“,”前的123保存到wUsLoopcounter1中,把“,”后的456保存到wUsLoopcounter2中去?
(2)如何再把wUsLoopcounter1和wUsLoopcounter2两个变量用上述的形式保存到gBfFreearea中去?
1. wUsLoopcounter1:=to_number(substr(gBfFreearea,1,instr(gBfFreearea,',')-1));
   wUsLoopcounter2:=to_number(substr(gBfFreearea,instr(gBfFreearea,',')+1,100));
  
2.gBfFreearea:=to_char(wUsLoopcounter1)||','||to_char(wUsLoopcounter2);
要得是pro*c代码,不是plsql
你照者改一下好了。
to_number(str) --> (int)(str);
to_char(num) --> (string)(num);
:= ----> =
|| ----> +
strstr,看下C的书