0

Hi there,
I am Embeza from ethiopia,Mekele
Here i got a problem!
It says " file path not found"
while i was working on vb 6.0 in my lab on files
the following was my code and can you fix plz

Option Explicit
Dim var as string 
Dim inputFile as string
Dim outputFile as string
Dim x as integer
 
Private Sub cmdReadfromFile_click()
Open inputFile For input as #x
   x=freeFile()
While not eof(x)
   input #x,var
  Wend
label1.caption=var
Close #x
End sub
 while not eof(1)
2
Contributors
3
Replies
4
Views
11 Years
Discussion Span
Last Post by Embeza
0

Hi Embeza ,
In the following code you had sent,there is no value assigned to Inputfilevariable
And you have to use function Freefile before opening file
mean
Syntax of Reading Files is

x = freefile() Assigning the new file number which ever is exists

Open (filename with Path) for (Mode-Input/Output) as #Filenumber
While Not Eof(Filenumber)

Wend

-1

Hi Embeza ,

Freefile should be used before opening of file
it is used to assign next existed filenumber


Syntax of Reading Files is

x = freefile()
Open (filename with Path) for (Mode-Input/Output) as #Filenumber

While Not Eof(Filenumber)
Line Input #Filenumber,StringVariable

Wend
Label1.caption = Stringvariable
Close #filenumber

In the above example take x as Filenumber as per your code

0

Hi maheshsayani,
I thank you very much for your targetable reponse
good luck
Embeza

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.