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

Hi!

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

 Page 1 of 1 [ 3 post ]

Relevant Pages