You are not logged in.

Dear visitor, welcome to Jabaco - Community. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

e-nomad

Beginner

  • "e-nomad" started this thread

Posts: 1

Date of registration: Jan 15th 2009

  • Send private message

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

Trainee

  • "maXim" is male

Posts: 53

Date of registration: Jan 5th 2009

Location: Sesto Fiorentino, Florence (ITALY)

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

Hobbies: chess, fly fishing, good wine and beautiful women!

  • Send private message

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