Multi StrInsert

Discussion in 'Questions (Windows Mobile)' started by tcgoh, Jan 26, 2008.

  1. tcgoh

    tcgoh Active Member Licensed User

    Hi all,

    Does anyone know is it possible to have a multiple StrInsert in a single code?


    a=strinsert(textbox1.Text,8,";") + strinsert(textbox1.text,32,";")

  2. klaus

    klaus Expert Licensed User

    Hello tcgoh
    Insread of
    a=strinsert(textbox1.Text,8,";") + strinsert(textbox1.text,32,";")
    this work in VB but not in Basic4PPC

    you must use the concatenation character.

    Best regards
  3. tcgoh

    tcgoh Active Member Licensed User

    Hi Klaus

    Thanks for the reply. But your code does work also.

    Error: Variable: Textbox was not assigned any value.

  4. specci48

    specci48 Well-Known Member Licensed User

    I think you have used copy and paste ... but you haven't removed the space in the second line of the code klaus provided.
    There has to be no space between "textbox" and "1" ...

  5. Erel

    Erel Administrator Staff Member Licensed User

    There is an extra space between textbox and 1.
    a=strinsert(textbox1.Text,8,";") & strinsert(textbox1.text,32,";")
    I'm not sure that this is what you want to achieve.
    If you want to add these two characters, you need:
    a = StrInsert(StrInsert(TextBox1.Text,8,";"),33,";")
  6. klaus

    klaus Expert Licensed User

    Of cours the extra space must not be there, was a wrong typing, I was concentrated in replacing the '+' sign by '&' .
    Sorry for the mistake.
  7. tcgoh

    tcgoh Active Member Licensed User

    Hi Erel,

    Oh Ya, there is space there. Thanks.

    But Erel is right on the spot on what I wanted. ie, add 2 char on the same line.

    Thanks again to all, the second code works fine.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice