标签: pb9powerbuilder程序路径中文字符长度 |
String ls_Path, ls_Buffer = Space(255)
If Handle(GetApplication(), False) = 0 Then
Else
End If
If ls_path <> '' And Right(ls_path, 1) <> '\' Then
ls_path += '\'
end if
Return ls_Path
这里面有两个需要注意地方,
ls_Buffer = Space(255) ,另外
f_myLeft是一个自定义函数,不直接用left的原因是pb9对Unicode的不支持,会把一个中文的长度当成1而不是2。下面是
f_myLeft函数内容:
char l_ch
int li_len
string ls_str
string ls_rtn
li_len = f_mylen(a_str)
if a_len>=li_len then return a_str
ls_str =a_str
li_len =1
do while li_len <= a_len and len(ls_str)>=li_len
loop
return ls_rtn
这个是
f_mylen函数内容:
char l_ch
int li_len,li_p
string ls_str
ls_str =a_str
li_p =1
do while len(ls_str)>=li_p
loop
return li_len