|
-
Sep 9th, 2003, 05:09 PM
#1
Thread Starter
Addicted Member
Put statement in VB.NET
Hello,
I'm trying to learn VB.NET after learning VB6. I have a small program that uses Put to write variables to a file.
I've learned about StreamWriter and BinaryWriter in VB.NET but am seemingly unable to write variants to a file using these (the way I did with Put). Is there any way to do this in VB.Net?
Thanks for any help.
- Jake
-
Sep 9th, 2003, 07:55 PM
#2
yay gay
first of all instead of variant u use the object in .net..to convert an object to string you can do yourVar.ToString()
hope this helps
\m/  \m/
-
Sep 9th, 2003, 08:33 PM
#3
Thread Starter
Addicted Member
thanks for the advice.
here's the situation, you tell me if your idea should work:
I have a byte array with values over 256. I can't write those using the binary writer because it doesn't like those bytes that are over 256.
Here's the code that creates the bytes over 256:
Code:
For K = 0 To ((sArrayLength - rasSt) - 100)
Bt1 = sRas(K) And &HF
Bt2 = (sRas(K) And &HF0) \ 16
tRas(K) = Bt2 Or (Bt1 * 256)
Next K
tRas is a byte array but it ends up containing bytes with values like 717 "2CD".
Thanks for any more help..
- J
-
Sep 10th, 2003, 10:21 AM
#4
I wonder how many charact
A byte can only hold 256 different values. 2 ^ 8 =256. Each element of a byte array therefore could only hold a value between 0 and 255.
What you're describing seems implausible.
-
Sep 10th, 2003, 05:47 PM
#5
Thread Starter
Addicted Member
I agree completely, I couldn't believe my own eyes.
Anyway I found a workaround.
- J
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|