Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2003

    Unanswered: Identifying TAB in a string

    I am using INSTR() to find a space to split a string. But the string have TAB in some places and in that case, it will skip that TAB and go to next space. I tried looking for CHR(32) and CHR(09) in the string assuming one of these is for TAB character in ASCII. But thats not working. If anyone have any idea how to find a TAB in a string, please let me know.


  2. #2
    Join Date
    Sep 2003
    The extremely Royal borough of Kensington, London
    1) Str = "a      b" 
    2) Str = "a" & Chr(32) & "b" 
    3) Str = "a b"
    Option 1 is a result of pressing the TAB key twice in VB.
    InStr(str, chr(32)) returns 2 in all the above.

    In ASM, pressing the TAB key stored the ASCII value 9, which resulted in the appropiate gap. However in VB the tab key must be pressed consecutively in which chr(9) does not appear instead multiple occurences of chr(32).

    You can check this by using CopyMemory into a Byte Array if you wish.
    Last edited by r123456; 12-18-03 at 04:04.
    Bessie Braddock: Winston, you are drunk!
    Churchill: And Madam, you are ugly. And tomorrow, I'll be sober, and you will still be ugly.

  3. #3
    Join Date
    Nov 2003
    Rotterdam, Netherlands
    You can use split function to split the words in to an array and access each word through an array element.

    I don't remember the syntax, pls refer the manual for the same.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts