Home > database >  PB interception function inside
PB interception function inside

Time:09-17

Has a paragraph of text, such as: 123456 positive urgent urgent a long words, I'm going to write a function to the text, to get the total length of this text and the text of these two parameters, and then processing in function, is roughly every 20 string line, finally return to is how many rows, row the text inside line, teach beginners ask the great spirit, thank you

CodePudding user response:

Is actually find ~ r ~ n (enter)
////get the delimiter separated after an array of 
1:////parameters should be delimited string
////parameter 2: output after separating array
3:////parameter delimiters
Returns an array of upper limit of////
//
//long li_pos=0, li_startpos=1, I=0, l_len, li_lastpos
//int l_lensep
//string ls_empty []
//ls_ret []=ls_empty []
//
//l_len=len (as_text)
//l_lensep=len (as_sep)
//
//li_pos=pos (as_text as_sep)
////normal intercept
//do the while (li_pos & gt; 0)
//i++
//ls_ret [I]=mid (as_text li_startpos, li_pos - li_startpos)
//
//li_lastpos=li_pos
//li_startpos=li_lastpos + l_lensep
//li_pos=pos (as_text as_sep, li_startpos)
//
//loop
//
//if l_len & gt;=li_startpos then
//i++
//ls_ret [I]=mid (as_text li_startpos)
//end if
//
//
//return I

CodePudding user response:

Function:

Global type gf_split_fixedlen from function_object
End type

Forward as
Global function long gf_split_fixedlen (string as_text, integer al_long, ref string as_result [])
End as

Global function long gf_split_fixedlen (string as_text, integer al_long, ref string as_result []);
Long ll_i, ll_len
Ll_len=len (as_text)
For ll_i=1 to between (ll_len/al_long)
As_result [ll_i]=mid (as_text, (ll_i - 1) * al_long + 1, al_long)
Next

Return ll_i
End the function

A method is called

String ls_data []
Long ll_upperbound
Ll_upperbound=gf_split_fixedlen (" string ls_data [] long ll_upperboundll_upperbound=gf_split_fixedlen ", 20, ls_data)

Messagebox (' ', ll_upperbound)

CodePudding user response:

Main methods


Long ll_i, ll_len
Ll_len=len (as_text)
For ll_i=1 to between (ll_len/al_long)
As_result [ll_i]=mid (as_text, (ll_i - 1) * al_long + 1, al_long)
Next

Return ll_i

CodePudding user response:

Can I see your method, thank you is, is not seen between the use of, I try the effect, if have not understand place still hope explanation, thank you!

CodePudding user response:

How many rows are returned but now that the content of each row? And what do I call this ls_data put?

CodePudding user response:

ref string as_result []

The result has not returned to ls_data array?

CodePudding user response:

reference 5 floor lirongpeng123 reply:
how many rows are returned but now that the content of each row? And what do I call this ls_data put?


In each row of the content is in ls_data this array

CodePudding user response:

  • Related