By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,646 Members | 2,063 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,646 IT Pros & Developers. It's quick & easy.

String to Type

P: 1
Hello all, I need some help here. I am using Visual Basic 6.0 (SP6).

Here's an example of the code I need:


Private Type PURCH_Record
Order as String * 6
Supplier as String * 6
Name as String * 30
TotalValue as String * 10
OrderedOn as string * 8
RequiredOn as string * 8
End Type

Dim sLine as String
Dim rPURCH as PURCH_Record

Open "C:\TEXT.txt" For Input As # 1
Line Input #1, sLine

Now I want to copy the content of sLine into rPURCH... A simple

rPURCH = sLine

does not work. I tried working with


Call CopyMemory(rPURCH, sLine, len(rPURCH))

it does not work either. I know I could do it field by field using the mid() function, but I got several types of record each containing several fields. It sounds to me that there is a better way of doing that.

Thanks in advance.
Dec 20 '07 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.