Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Seperate charactors in string

Status
Not open for further replies.

Lliam

Electrical
May 16, 2007
1
Hello everyone,
My name is Lliam, I'm new to the forum and to VB
I do have programming experience with PICAXE Basic (PICAXE micro-controller language)

I have been able to put together a code(with a lot of help from the PICAXE guy's) that reads data sent to the serial port from the picaxe.

My next goal is to extract certain parts of data and and them to a corresponding text box.

-For example:
Output from PICAXE:
A = 10
B = 12
C = 4
D = 5031

This data is currently displayed in a single text box.
How can I then divide it so, say textboxA displays 10, textboxB displays 12, and so on...?

Thankyou in advance,
Lliam.
 
Replies continue below

Recommended for you

Look into the Split function:
Description

Returns a zero-based, one-dimensional array containing a specified number of substrings.

Syntax

Split(expression[, delimiter[, limit[, compare]]])

The Split function syntax has these named arguments:

Part Description
expression Required. String expression containing substrings and delimiters. If expression is a zero-length string(""), Split returns an empty array, that is, an array with no elements and no data.
delimiter Optional. String character used to identify substring limits. If omitted, the space character (" ") is assumed to be the delimiter. If delimiter is a zero-length string, a single-element array containing the entire expression string is returned.
limit Optional. Number of substrings to be returned; –1 indicates that all substrings are returned.
compare Optional. Numeric value indicating the kind of comparison to use when evaluating substrings. See Settings section for values.
where you would use vbLf ( Chr(10) ) as the delimiter.

Cheers,
Joerd

Please see FAQ731-376 for tips on how to make the best use of Eng-Tips.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor