我已将 Powerbuilder 9 应用程序迁移到 PowerBuilder 12.5。迁移后,部分功能无法使用。
以下代码来自具有 blob 参数 blobi 的函数。
long ll_position, ll_start, ll_end
ll_position=Pos(String(blobi),'~f@1~r~n',1) //does not work.
Run Code Online (Sandbox Code Playgroud)
上面的行在新版本中不起作用。我尝试检查从 ll_position 获得什么值:
messagebox("ll_position: ", ll_position)
In PB 9, it returns 1
In PB 12.5 it returns 0
Run Code Online (Sandbox Code Playgroud)
下一步:
ll_start=ll_position+5
ll_end=Pos(String(blobi),Char(126),ll_start) //does not work.
Run Code Online (Sandbox Code Playgroud)
我得到以下返回值:
messagebox("ll_end: ", ll_end)
In PB 9, it returns 10
In PB 12.5 it returns 0
Run Code Online (Sandbox Code Playgroud)
下一步:
dw_test.Object.numb[1]=Long(Mid(String(blobi),ll_start,ll_end -ll_start)) //does not work.
Run Code Online (Sandbox Code Playgroud)
我得到以下返回值:
long abc
abc = dw_test.Object.numb[1]
messagebox("dw value is: ", abc)
in PB 9 it returns an integer like 1234
in PB 12.5 it returns 0
Run Code Online (Sandbox Code Playgroud)
请帮助我了解上述功能有什么问题以及如何更改它们以与 PowerBuilder 12.5 一起使用。谢谢。
PowerBuilder 12.5 默认使用 Unicode 字符串,因此您的 String() 函数使用两个字节来创建一个字符。要维护现有功能,请使用
String (blobi, EncodingANSI!)
Run Code Online (Sandbox Code Playgroud)
祝你好运,
特里
| 归档时间: |
|
| 查看次数: |
8690 次 |
| 最近记录: |