Page 1 of 1

[No Bug] CreateFile() - Incorrect number of parameters.

Posted: Wed Jun 15, 2016 8:51 pm
by falsam

Code: Select all

If CreateFile(0, "Text.txt")
  CloseFile(0)                      
EndIf
the third parameter is not optional. It does not matter. Simply put ^^

Re: CreateFile() - Incorrect number of parameters.

Posted: Wed Jun 15, 2016 9:01 pm
by Peter
There are four parameters. Only the fourth one is optional. The Online-Help is wrong.

Image

But it seems, that the callback doesn't work:

Code: Select all

Procedure CreateFileCallback()
  Debug "CreateFileCallback()"
  CloseFile(0)
EndProcedure

CreateFile(0, "Text.txt", @CreateFileCallback())
Greetings ... Peter

Re: CreateFile() - Incorrect number of parameters.

Posted: Wed Jun 15, 2016 9:05 pm
by falsam
Hello Peter.

Oops I forgot to take a look at the bottom of the screen !! :oops:

Re: [No Bug] CreateFile() - Incorrect number of parameters.

Posted: Thu Jun 16, 2016 1:36 pm
by Fred
The callback is only reported read/write operations, not creation

Re: [No Bug] CreateFile() - Incorrect number of parameters.

Posted: Thu Jun 16, 2016 3:21 pm
by Peter
Fred wrote:The callback is only reported read/write operations, not creation
this one does not work either (?)

Code: Select all

Procedure myCallback()
  Debug "myCallback()"
EndProcedure

If CreateFile(0, "Text.txt", @myCallback())
  Debug "CreateFile()"
  WriteStringN(0, "This")
  WriteStringN(0, "is")
  WriteStringN(0, "a")
  WriteStringN(0, "test")
  CloseFile(0)
Else
  Debug "!CreateFile()"
EndIf
Greetings ... Peter