Home > database >  PB9.0 how to intercept the string?
PB9.0 how to intercept the string?

Time:10-22

Has only just started to learn to PB, the teacher is out of a subject, is really a splitting headache,,

Now there are three control
Name: singlelineedit controls sle_1, there is a string the text "maths, Chinese, English"
Name: commandbutton control cb_1, used to analyse the singlelineedit control click the text content
Name: multilineedit controls mle_1, which is used to output
How to realize the string "maths, Chinese, English"
After clicking the commandbutton control
In multilineedit control is shown as
Mathematical
Chinese
English

Commandbutton control click events for
Long ll_i, ll_cnt
String ls_array []

Ll_cnt=wf_parse (sle_1. Text, ls_array)
Mle_1. Text='

For ll_i=1 to ll_cnt
Mle_1. Text +=ls_array [ll_i] + '~ r ~ n'
Next

So what should I multilineedit controls wf_parse function to fill in? There are two variables as_source and as_array [], is a string type
String ls_array []=?
As_array=ls_array
Return 3

O greatly the teach

CodePudding user response:




Do
I=pos (s1, ', ')
If I & gt; 0 then
S2 [f]=left (s1, I - 1)
S1=mid (s1, I + 1)
The else
[f] s2=s1
End the if

F++

Loop while i<> 0


CodePudding user response:

Long ll_pos, ll_len
String ls_str, ls_strValue
Ls_str=sle_1. Text

Do
Ll_pos=Pos (ls_str, ', ')
If ll_pos=0 then
Ll_len=len (ls_str)
The else
Ll_len=ll_pos - 1
End the if
ls_strValue=https://bbs.csdn.net/topics/f_str (LEFT (ls_str ll_len))
Mle_1. Text=mle_1. Text + ls_strValue + '~ r ~ n'

If ll_pos & gt; 0 then
Ls_str=MID (ls_str, ll_pos + len (', '))
End the if

Loop until ll_pos=0
  • Related