Getting a single line out of a Variant 
Author Message
 Getting a single line out of a Variant

Hi!

Thanks for reading my message.
I have a small question:
"How do I get a single line out of a variant in VB 5.0?)

For Example:
Br = Chr(13) + Chr(10)
test= "Hello" & Br & "How are you today?" & br & "Fine, Thank you"

How do I get the second, third or first line out of 'test' ?

I'm just a newbie so my example will be very low-programmed, but hey I
had to think of some example.

Thanks,

        John Brookman



Fri, 26 May 2000 03:00:00 GMT  
 Getting a single line out of a Variant

Use the Instr function to find Br

dim p as integer
p = instr(test, chr$(13))

p will equal 6 in your case.

You can then use the Left$ and/or Mid$ functions
to take apart the string

Note:  If you're looking for the second string, you have
to also find the second occurrence of chr$(13) using another Instr



Fri, 26 May 2000 03:00:00 GMT  
 Getting a single line out of a Variant

Look under help at the INSTR and MID functions. Then, parse using INSTR as
start and end points.
--
Hope this helps...

Jeffrey Renton
jrenton AT ees DOT enron DOT com



Quote:
> Hi!

> Thanks for reading my message.
> I have a small question:
> "How do I get a single line out of a variant in VB 5.0?)

> For Example:
> Br = Chr(13) + Chr(10)
> test= "Hello" & Br & "How are you today?" & br & "Fine, Thank you"

> How do I get the second, third or first line out of 'test' ?

> I'm just a newbie so my example will be very low-programmed, but hey I
> had to think of some example.

> Thanks,

>    John Brookman



Sat, 27 May 2000 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Getting a single line out of a Variant (<=-- or something like that)

2. Single line out of Variant

3. Getting a single char, Putting a single char.

4. Dim multiple lines or single line

5. Getting Picture out of variant

6. Getting Clipboard into variant

7. How do I get a single line out of a Variant ?

8. Deleting empty lines in single cell table

9. Single line textbox problem

10. Replacing a single line from a text file

11. Single line Stored Procedure Parameter Syntax

12. Printing single lines

 

 
Powered by phpBB® Forum Software