救命啊~~~~~~~编译前后执行效果不一样啊~~~~~~
我在数据窗口中的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编译也是一样!