Hello,
<mh> wrote:
Information is entered randomly in just one text box (name, social
security number, lenght,weight).
The problem is how to recognize that what actually was the name, and what
was lenght etc.
So how can i separate the inputs in their own variables?
This is only possible if you can define clear rules yourself
how a program could recognize which information is in a certain
piece of the string. But I think in this case you can.
Social Security Number
I guess this one typically has a fixed format with a
fixed number of digits, totally different from the
expected values of length and weight.
Length
Would typically be a number in a
lower range than weight.
Weight
Would typically be a number in a
higher range than length.
Name
Would be the other field. Probably shouldn't contain
any numbers and have a certain minimum length.
For the string in which the information is entered,
you have to decide on which characters you interpret
as delimiters. Then just split the string on that,
loop through the elements, check what each element
most looks like and put the value of the element
in the corresponding variable.
Best regards,
Eric