救命啊~~~~~~~编译前后执行效果不一样啊~~~~~~

badaoqi 2004-05-05 11:19:48
我在数据窗口中的click实践中的排序代码如下:
String ls_old_sort, ls_column
Char lc_sort
/* Check whether the user clicks on the column header */
IF Right(dwo.Name,2) = '_t' THEN

ls_column = LEFT(dwo.Name, LEN(String(dwo.Name)) - 2)

/* Get old sort, if any. */

ls_old_sort = dw_1.Describe("Datawindow.Table.sort")

/* Check whether previously sorted column and currently clicked
column are same or not. If both are same then check for the sort
order of previously sorted column (A - Asc, D - Des) and change it.
If both are not same then simply sort it by Ascending order. */

IF ls_column = LEFT(ls_old_sort, LEN(ls_old_sort) - 2) THEN
lc_sort = RIGHT(ls_old_sort, 1)
IF lc_sort = 'A' THEN
lc_sort = 'D'
ELSE
lc_sort = 'A'
END IF
dw_1.SetSort(ls_column+" "+lc_sort)
ELSE
dw_1.SetSort(ls_column+" A")
END IF
dw_1.Sort()
END IF
编译前排序很正常,但是编译后无效,根本就不执行排序.

还有金额小写转换成大写也是一样,代码如下:
constant string ls_bit = "万仟佰拾亿仟佰拾万仟佰拾元角分"
constant string ls_num = "壹贰叁肆伍陆柒捌玖"
long lmax = len( ls_bit )
string ls_je, ls_dw, ls_result = '',ls_temp
long ll_len, i, k

ls_je = string( data, "#############.00" )
ll_len = len( ls_je ) - 1
ls_je = replace( ls_je, ll_len - 1, 1, '' )
for i = ll_len to 1 step -1
lmax -= 2
ls_dw = mid( ls_bit, lmax+1, 2 )
k = long( mid( ls_je, i, 1 ) )
if k = 0 then
choose case ls_dw
case '亿'
//判断亿元级别的位数是不是全为零[开始]
if i = ll_len - 10 then
ls_temp=replace(ls_je, ll_len - 10, 10, '' )
if right(ls_temp,5)='00000' then
else
ls_result = ls_dw + ls_result
end if
else ls_result = ls_dw + ls_result
end if
ls_result = ls_dw + ls_result
case '万'
//判断万元级别的位数是不是全为零[开始]
if i = ll_len - 6 then
ls_temp=replace(ls_je, ll_len - 6, 6, '' )
if right(ls_temp,4)='0000' then
else
ls_result = ls_dw + ls_result
end if
else
ls_result = ls_dw + ls_result
end if
case '元'
ls_result = ls_dw + ls_result
case '分'
ls_result = '整'
case '角'
if ls_result <> '整' then ls_result = '零' + ls_result
case else
choose case left( ls_result, 2 )
case '万', '亿', '元', '零'
case else
ls_result = '零' + ls_result
end choose
end choose
else
ls_result = mid( ls_num, 2*(k -1)+1 , 2 ) + ls_dw + ls_result
end if

next
return ls_result也是编译前很正常,但是编译后就乱套了,比如小写为1000,就转换成"壹贰零",小写为1234就转换成"壹贰叁肆伍陆柒捌零".
各位大哥帮忙看一下啊,我都快搞疯了,我用机器代码和FULL编译也是一样!
...全文
96 10 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
ddqinlong 2004-05-07
  • 打赏
  • 举报
回复
也可能是你的机器有毒,我曾遇到过。
TGWall 2004-05-07
  • 打赏
  • 举报
回复
有可能在不同的PBL里有相同的对象名
njdxbzu 2004-05-07
  • 打赏
  • 举报
回复
应该是你pb的dll不一致
xyzliuin 2004-05-07
  • 打赏
  • 举报
回复
检查你的程序,可能其他的pbl里也有类似重名的函数
hongxiuxie 2004-05-06
  • 打赏
  • 举报
回复
编译时,要选择编译为pbd可解决很多问题
hunter1978 2004-05-06
  • 打赏
  • 举报
回复
你看看编译的PBL是不是你运行的PBL!!
mittee 2004-05-06
  • 打赏
  • 举报
回复
在这种情况下,就先要检查在exe文件所在目录的pb dll支持文件是否
和安装的pb是同一个版本的啦
zanglinfeng 2004-05-06
  • 打赏
  • 举报
回复
你仔细看一下代码,应该是代码有问题.
艳阳天11 2004-05-06
  • 打赏
  • 举报
回复
把Left,Right,len等字串函数改为Leftw,Rightw,Lenw等函数试试。
klbt 2004-05-05
  • 打赏
  • 举报
回复
PB版本?
打上补丁

1,108

社区成员

发帖
与我相关
我的任务
社区描述
PowerBuilder 相关问题讨论
社区管理员
  • 基础类社区
  • WorldMobile
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧