Global type f_substr_gy from function_object
End type
Forward as
Global function integer f_substr_gy (string data_input, string data_mark, ref any ls_arr [])
End as
Global function integer f_substr_gy (string data_input, string data_mark, ref any ls_arr []);//string ls_str
//string ls_arr []
Long ll_pos, I=0, ll_start
Ll_pos=pos (data_input data_mark)
Ll_start=1
The do while ll_pos & gt; 0 and ll_pos & lt;=len (data_input)
I++
Ls_arr [I]=mid (data_input ll_start, ll_pos - ll_start)
Ll_start=ll_pos + 1
Ll_pos=pos (data_input data_mark, ll_start)
Loop
The return of I
End the function
But into the parameter such as' 1234 | abcd | abcd | ', when there is a rarely used word, will parse error, what method can solve????
CodePudding user response:
Posw can solve the problemCodePudding user response:
The mid midw instead; Change the pos to posw can solveCodePudding user response:
Global type f_substr_gy from function_objectEnd type
Forward as
Global function integer f_substr_gy (string data_input, string data_mark, ref any ls_arr [])
End as
Global function integer f_substr_gy (string data_input, string data_mark, ref any ls_arr []);//string ls_str
//string ls_arr []
Long ll_pos, I=0, ll_start
Ll_pos=posw (data_input data_mark)
Ll_start=1
The do while ll_pos & gt; 0 and ll_pos & lt;=len (data_input)
I++
Ls_arr [I]=midw (data_input ll_start, ll_pos - ll_start)
Ll_start=ll_pos + 1
Ll_pos=posw (data_input data_mark, ll_start)
Loop
The return of I
end function
CodePudding user response:
Len will also changeGlobal type f_substr_gy from function_object
End type
Forward as
Global function integer f_substr_gy (string data_input, string data_mark, ref any ls_arr [])
End as
Global function integer f_substr_gy (string data_input, string data_mark, ref any ls_arr []);//string ls_str
//string ls_arr []
Long ll_pos, I=0, ll_start
Ll_pos=posw (data_input data_mark)
Ll_start=1
The do while ll_pos & gt; 0 and ll_pos & lt;=lenw (data_input)
I++
Ls_arr [I]=midw (data_input ll_start, ll_pos - ll_start)
Ll_start=ll_pos + 1
Ll_pos=posw (data_input data_mark, ll_start)
Loop
The return of I
end function
CodePudding user response:
Byte length processing ~