pb怎么分割字符串并且放入数组中
1个回答
展开全部
global type gf_split_parm from function_object
end type
forward prototypes
global function integer gf_split_parm (string as_parm, ref string as_data[])
end prototypes
global function integer gf_split_parm (string as_parm, ref string as_data[]);//拆分返回值
long ll_pos, ll_item
if isnull(as_parm) then
as_parm = ''
end if
if len(as_parm) <= 0 then
return 0
end if
ll_item = 0
ll_pos = pos(as_parm, ',')
do while ll_pos > 0
ll_item ++
as_data[ll_item] = left(as_parm, ll_pos - 1)
as_parm = mid(as_parm, ll_pos + 1)
ll_pos = pos(as_parm, ',')
loop
ll_item ++
as_data[ll_item] = as_parm
return ll_item
end function
end type
forward prototypes
global function integer gf_split_parm (string as_parm, ref string as_data[])
end prototypes
global function integer gf_split_parm (string as_parm, ref string as_data[]);//拆分返回值
long ll_pos, ll_item
if isnull(as_parm) then
as_parm = ''
end if
if len(as_parm) <= 0 then
return 0
end if
ll_item = 0
ll_pos = pos(as_parm, ',')
do while ll_pos > 0
ll_item ++
as_data[ll_item] = left(as_parm, ll_pos - 1)
as_parm = mid(as_parm, ll_pos + 1)
ll_pos = pos(as_parm, ',')
loop
ll_item ++
as_data[ll_item] = as_parm
return ll_item
end function
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询