954,568 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

File Operation in VB

Hi Guys, I want to ask about dat file. How can I create a code for read and write dat file with VB ?, eg :

string
string
0.5000, 40
0.7699, 60
0.8431, 70
1.6754, 50
string
string

For above example,The code read string value in line 1 and 2 then send it's value to rich text box control. After that, the code continue read next line which contain numeric value (X,Y), plot it's value to mschart type xy schatter in log format then continue again to read line which string value, send it's value to rich text box control (same with line 1 and 2). For anyone who can create the code, please help me.

Thanks


Djali

Djali
Newbie Poster
2 posts since Mar 2008
Reputation Points: 10
Solved Threads: 0
 

Hi,
If you read in format (String, String, Number , Number ...) ie you know exact size what you need to read and write, then use Random Access Files. That is Make a Structure for this

Ex

Type ReadData
   .......
   Text1 As String * 255
   Text2 As String * 255
   X As Single
   Y As Single
   ....
End Type

read and write using this structure.

If the string size cannot be predicted then use the Sequential Access

selvaganapathy
Posting Pro
547 posts since Feb 2008
Reputation Points: 44
Solved Threads: 100
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You