Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 145
  • Last Modified:

Extracting information from a Text Box

Hi,
I am writing an application in which we scan the new CreditCard Type State ID's or Drivers Liscense for Customer Information - The Format that scan's into a TextBox is:%STATECITY^LASTNAME$FIRSTNAME$MIDDLEINITIAL^ADDRESS^?;########STATEID#=##############=?

I want to place the value's into other text boxes to save time on filling out customer info ie:
State to txtState
City to txtCity
LastName to txtLastName
FirstName to txtFirstName
StateID to txtStateID

I have tried several ways without success.
The ## signs seem to be irrelevant information to what I need - I just want to extract the information shown above.

Thanks for looking into my question.

0
flosoft
Asked:
flosoft
  • 2
  • 2
1 Solution
 
hesCommented:
Try this (vb6 only)
Dim MyInfo1
Dim Myinfo2
Dim MyInfo3

MyInfo1 = Split(text1'or where else you get the data,"^")

This will put STATECITY in MyInfo1(0)
LASTNAME$FIRSTNAME$MIDDLEINITIAL in MyInfo1(1)
ADDRESS in MyInfo(2)
?;########STATEID#=##############=? in MyInfo(3)

Then
MyInfo2 = split(MyInfo(1),"$")

lastname will be in MyInfo2(0) and so forth
MyInfo(3) = replace(MyInfo(3),"?","")
MyInfo(3) = replace(MyInfo(3),";","")
MyInfo(3) = replace(MyInfo(3),"#","")
MyInfo(3) = replace(MyInfo(3),"=","")




0
 
flosoftAuthor Commented:
I just wanted to let you know that I am experimenting with the code and will make a decision in the next day or 2 - Thanks/.
0
 
hesCommented:
Whoops,
Just noticed something, a little ( ;) ) typo
This
ADDRESS in MyInfo(2)
?;########STATEID#=##############=? in MyInfo(3)

should be
ADDRESS in MyInfo1(2)
?;########STATEID#=##############=? in MyInfo1(3)

And this

MyInfo(3) = replace(MyInfo(3),"?","")
MyInfo(3) = replace(MyInfo(3),";","")
MyInfo(3) = replace(MyInfo(3),"#","")
MyInfo(3) = replace(MyInfo(3),"=","")


Should be
MyInfo1(3) = replace(MyInfo1(3),"?","")
MyInfo1(3) = replace(MyInfo1(3),";","")
MyInfo1(3) = replace(MyInfo1(3),"#","")
MyInfo1(3) = replace(MyInfo1(3),"=","")

Must have been typing to fast LOL








0
 
flosoftAuthor Commented:
Thanks,
It took some experimenting, and with a little modification I got it to work perfectly, Then to my suprise I scanned in another ID, same state, issued 2 month's apart and they use an entirely different format! Go Figure! The second had only numbers which only gave the State ID - hmmmmm, Well at least for proccesing customers with the format that mine has it will quick and painless thanks to your help.

Thanks again,
Tom
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now