Massassi Forums Logo

This is the static archive of the Massassi Forums. The forums are closed indefinitely. Thanks for all the memories!

You can also download Super Old Archived Message Boards from when Massassi first started.

"View" counts are as of the day the forums were archived, and will no longer increase.

ForumsDiscussion Forum → VB (lowercase)
VB (lowercase)
2004-03-13, 3:13 PM #1
So I'm inputting strings from file with "Input #, var" but my variables in the file are not, and cannot be, separated by commas. Instead, they are seperated by linebreaks and tabs. How can I input to string with them separated like this?

(BTW, this is for a contest, so I cannot change how the input file is formatted.)

------------------
Bliss is ignorance.

[This message has been edited by RingMaster481 (edited March 13, 2004).]
2004-03-13, 4:01 PM #2
Use the split command to parse them into an array. Line breaks are vbCrLf and tabs are vbTab. Use those as a delimiter to parse.

I'm not at a PC where I can get to VB, but it goes something like this:

Code:
Dim moo as Variant

moo = Split(strYourStuff, vbcrlf)


------------------
http://www.sporkaudio.com
gbk is 50 probably

MB IS FAT
2004-03-13, 4:24 PM #3
Sorry, I'm kind of a n00b. I've got it to parse to the variant, but how do I put that into my string array?

------------------
Bliss is ignorance.
2004-03-13, 4:38 PM #4
Code:
Dim strBoobies(2,6)   As String 'The 2 and 6 being columns/rows. Or the other way around. Can't remember.

strBoobies(0,0) = "Looser"
strBoobies(0,1) = "Pansie"
strBoobies(2,6) = "n00b."


Or maybe a different way, I'm not sure exactly what you're saying.

------------------
MadQuack on Military school: Pro's: I get to shoot a gun. Con's: Everything else.
"I'm going to beat you until the laws of physics are violated!!" ! Maeve's Warcry

RIP -MaDaVentor-. You will be missed.
My Parkour blog
My Twitter. Follow me!
2004-03-13, 4:45 PM #5
[edit- Whooopsies. Double post]

[This message has been edited by happydud (edited March 13, 2004).]
My Parkour blog
My Twitter. Follow me!
2004-03-13, 4:58 PM #6
I know how to use a string array, I just don't know how to get the value(s) from the split() function that NoESC said to my string array.

------------------
Bliss is ignorance.
2004-03-13, 5:11 PM #7
Dont ask me. I bombed on the VB test i took for FBLA.

------------------
Madquack and Firbnic have a signature.
Remnant Temple Part A beta test.
Light And Darkness
I was just petting the bunny, and it went into the soup can, and part of my hand went with it. - Red vs Blue
2004-03-13, 5:32 PM #8
Then I won't ask you.

Update: it puts it into the string array, but it just puts the whole line into strArray(0), I need it to be split by tabs!

------------------
Bliss is ignorance.
2004-03-13, 5:53 PM #9
After much worrying and frustration, it turns out that vbCrLf wouldn't do the trick, but Chr$(9) would. So now I can proudly say,

[http://forums.massassi.net/html/biggrin.gif] NEVERMIND [http://forums.massassi.net/html/biggrin.gif]

------------------
Bliss is ignorance.

[This message has been edited by RingMaster481 (edited March 13, 2004).]

↑ Up to the top!