If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ANSI SQL > Identifying TAB in a string

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-17-03, 14:10
arun1581 arun1581 is offline
Registered User
 
Join Date: Dec 2003
Location: US
Posts: 4
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.

Thanks,
Arun
Reply With Quote
  #2 (permalink)  
Old 12-17-03, 21:55
r123456 r123456 is offline
Registered User
 
Join Date: Sep 2003
Location: The extremely Royal borough of Kensington, London
Posts: 778
Code:
 
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.
__________________
Bessie Braddock: Winston, you are drunk!
Churchill: And Madam, you are ugly. And tomorrow, I'll be sober, and you will still be ugly.

Last edited by r123456; 12-18-03 at 04:04.
Reply With Quote
  #3 (permalink)  
Old 12-18-03, 03:59
shelva shelva is offline
Registered User
 
Join Date: Nov 2003
Location: Rotterdam, Netherlands
Posts: 127
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.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On