SRL Archive - General

VB Help


Sin

2012-11-23 12:07:26

Heya, I've been trying to learn VB and im stuck in this conundrum.
I have a few strings, and I need to save them into a file.

    Dim bName, fName, tFloor As String

How do I save them into a file and/or a chart.
A file would be better.

KingKong

2012-11-23 17:46:02


using dim vfile as new io.streamwriter("filepath", append)
vfile.writelines(bname & fname & tfloor)
end using
where append is a boolean and assuming you are on vb.net and not vb as they are different. the using statement automatically closes the file and opens it(not sure on opening)

Sin

2012-11-23 18:10:41

Awesome, and I suppose to read those lines it'd be vfile.readlines?

KingKong

2012-11-23 18:28:23

yes, but you have to use io.streamreader and you can only either write or read but not both without using another file or an array in memory