vb splits the contents of the text box into a list

Updated on technology 2024-05-21
9 answers
  1. Anonymous users2024-02-11

    This sentence is debugging**.

    private sub form_load()text1 = "1" & vbcrlf & "00:01:28,074-->00:

    01:29,704" & vbcrlf & "Hello" & vbcrlf & vbcrlf & "2" & vbcrlf & "00:01:

    29,819-->00:01:30,819" & vbcrlf & "Oops"

    end sub

    private sub command2_click()for i = 1 to len(text1)i1 = instr(i, text1, "-->")if i1 > 0 then

    i2 = instrrev(text1, ":", i1)if i2 > 0 then

    mid(text1, i2 - 2, 5)mid(text1, i1 + 6, 5)i3 = instr(i1, text1, vbcrlf)if i3 > 0 then

    i4 = instr(i3, text1, vbcrlf & vbcrlf)

    if i4 = 0 then i4 = len(text1)mid(text1, i3 + 2, i4 - i3)end if

    end if

    i = i1 + 3

    elseexit for

    end if

    nextend sub

    Please refer to,.

  2. Anonymous users2024-02-10

    private sub command1 click() where each record is separated by a blank line, which is separated in an array first.

    dim rs

    rs = split(, vbcrlf & vbcrlf) to divide each record into an array, and the third dimension is "hello", "ouch".";The position of the second dimension of time is fixed, and the string can be taken with mid().

    dim item

    dim afor each item in rsprint a = split(item, vbcrlf)mid(a(1), 4, 5)

    mid(a(1), 21, 5) 'The second time location may be miscounted.

    a(2)nextend sub

  3. Anonymous users2024-02-09

    It's done, and by the way, collect some wealth value.

  4. Anonymous users2024-02-08

    It's easy to do, but it's going to take a while, and I'll write it for you in the evening.

  5. Anonymous users2024-02-07

    private sub command1_click()= ""

    for i = 0 to - 1

    chr(13) +chr(10)next

    end sub

    The multiline attribute of --textbox has been changed to true, and the property of scrollbar has been changed to 3

  6. Anonymous users2024-02-06

    This is easy to do, split the text and delete the blank lines** as follows:

    dim str1, i

    str1 = split(text1, vbcrlf):text1 = ""

    for i = 0 to ubound(str1)if trim(str1(i)) "" then text1 = text1 & str1(i) &vbcrlf

    next

  7. Anonymous users2024-02-05

    str= split(, vbcrlf)

    vbcrlf & vbcrlf,vbcrlf),vbcrlf & vbcrlf,vbcrlf) Note is twice, once is not enough for the cardinality of null behavior.

  8. Anonymous users2024-02-04

    private sub command1_click()dim a as string

    if = and <>0 thenfor i = 1 to

    a = - 1)

    if a = then 'Looking for only the first "3".

    i - 1i - 1

    exit for

    end if

    next i

    elsemsgbox "list1 is not the same length as list2 or is empty", vbokonly, "Prompt! "

    end if

    end sub

  9. Anonymous users2024-02-03

    It seems that no one has solved it for you.,I'll give you the ** modification.,You can copy it and run it, and your form should have the following 4 controls:list1、list1、text1 and command1 [property default].

    dim player(0 to 2) as string 'Describes the size of the two arrays.

    dim salary(0 to 2) as singledim sum as single

    private sub command1_click()dim i as long, j as long 'Declaring variables.

    if = 0 then exit subif < 0 then

    msgbox "Please select a product in list box 1"

    exit sub

    end if

    if > 0 then

    sum = 0

    for i = 0 to - 1

    for j = 0 to 2

    if = player(j) then sum = sum + salary(j)

    next j

    next i

    else "$0"

    end if

    cstr(sum) +"Meta" 'Displays the ** corresponding to the name.

    end sub

    private sub form_load()dim i as long 'Declaring variables.

    autosize = true

    player(0) = "Bib pants" 'Enter data in an array.

    player(1) = "Sweaters"

    player(2) = "Sweatshirts"

    salary(0) = 165

    salary(1) = 135

    salary(2) = 75

    for i = 0 to 2 'Add a name to the list.

    player(i)

    next i

    1 'Displays the first item in the list.

    end sub

Related questions
14 answers2024-05-21

Asking for the same data every time you run, so what's the point of asking for a text box? Or did you not make it clear? Isn't it just static, isn't it just when the text attribute is set? >>>More

12 answers2024-05-21

Click on the edge of the text box, when the pointer changes to a cross, multiple small dots appear around the text box, point the mouse to a green dot, the mouse pointer changes to rotate, and then drag the dot.

12 answers2024-05-21

Set the onfocus of the text box and clear the contents.

14 answers2024-05-21

The functions you want are all here, I won't list the specific syntax, you can go to the Internet to find the relevant usage. >>>More

8 answers2024-05-21

Image selection page.

dim guestimagesnum,imagespath,emotnum,emotpath >>>More