Tuesday, May 22nd 2012, 2:12am UTC+2

You are not logged in.

  • Login
  • Register

1

Thursday, January 15th 2009, 11:43am

Open Files?

Please help me with syntax. This code is wrong. What is wrong? :?:

Jabaco Source

1
2
3
4
ff=FreeFile()
   Open("test.dat", Output) As  #ff ; Expected: End of statement
   print #ff,"Hello world in DataFile"
   close #ff

maXim

Beginner

Posts: 26

Location: Sesto Fiorentino, Florence (ITALY)

Occupation: design & development (HW, SW & FW)

2

Thursday, January 15th 2009, 2:05pm

Hi e-nomad,

what follows is the method recommended by Manuel:

Jabaco Source

1
2
3
4
5
6
7
8
9
10
11
Dim ff As VBFileHandler 

' write 
ff = Open("c:\test.dat", Random, ReadAndWrite, Shared) 
Call write(ff, "Hello world in DataFile") 
Call Close(ff) 

'read 
ff = Open("c:\test.dat", Random, ReadAndWrite, Shared) 
MsgBox readline(ff) 
Call Close(ff)

Best Regards,

maXim

Rate this thread
WoltLab Burning Board