Go4Expert

Go4Expert (http://www.go4expert.com/)
-   Visual Basic ( VB ) (http://www.go4expert.com/forums/visual-basic/)
-   -   VB2005: Getting specific data from file(s) (http://www.go4expert.com/forums/vb2005-getting-specific-data-file-s-t15932/)

Amerigo 24Jan2009 21:36

VB2005: Getting specific data from file(s)
 
Could someone, please, show me a sample code to:
Open a file
load a specific data entry from the file
Use the data in an If then statement
Close file

Code:

Dim strinput As String = ""
Dim split() As String
'other appropriate dims
FileOpen(1, Application.StartupPath & "\preferences.txt", OpenMode.Input)
'find & load "Level = "

Input(1, strinput)
split = strinput.Split("=")

If (string) = "Level = 3" then
~~~bla bla bla
End if
FileClose(1)



All times are GMT +5.5. The time now is 10:13.