Reading Notepad Files

scytheuk
11-22-2001, 06:45 AM
I currently have a notepad file containing different sections of text, each seperated by # and and a number eg.
#1
"some text"

#2
"next piece of text"

What i would like to know are
1) How do i open this file
2) How would i search for the text requested (eg. #2)
3) How would i display it in a label

Thanx
Scytheuk

Banjo
11-22-2001, 07:00 AM
Have a look at MSDN and search the forum for:

Open
Line Input

To store it in a label set the Caption property.

scytheuk
11-22-2001, 07:24 AM
Ive managed to find how to open the file and copy all of it to a label or text box.
Have you any idea how i can search the file and only copy the data preceded by the "#" statement, and procedes the next?
Thanx for the help so far.
Wouldnt of got any were without that.
scytheuk

Banjo
11-22-2001, 07:29 AM
<pre>Open the file
Do
Line Input from file
If in store mode Then
If its a #number Then
Exit Do
Else
Store this line
End If
Else
If its a #number then
enter store mode
End If
End If
Loop
Close the file</pre>

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum