Using Create

Everything else that doesn't fall into one of the other PB categories.
asawyer13
New User
New User
Posts: 9
Joined: Thu Jun 21, 2007 6:57 pm

Using Create

Post by asawyer13 »

I am trying to use the CreateFile code that's in the help file,
but I get an error at line 1, syntax error.
also one on line 3, WriteString incorrect number of parameters.
I cut and pasted the code, so I'm a little confused.
Thanks,
Alan


Code: Select all

 
If CreateFile(0, "Text.txt")         ; we create a new text file...
    For a=1 To 10
      WriteStringN(0, "Line "+Str(a))  ; we write 10 lines (each with 'end of line' character)
    Next
    For a=1 To 10
      WriteString(0, "String"+Str(a))  ; and now we add 10 more strings on the same line (because there is no 'end of line' character)
    Next
    CloseFile(0)                       ; close the previously opened file and store the written data this way
  Else
    MessageRequester("Information","Can't create the file!")
  EndIf
asawyer13
New User
New User
Posts: 9
Joined: Thu Jun 21, 2007 6:57 pm

Post by asawyer13 »

I didn't realize that the errors don't clear when I do a compile.
I think I'm okay. Sorry for the confusion.
User avatar
Rescator
Addict
Addict
Posts: 1769
Joined: Sat Feb 19, 2005 5:05 pm
Location: Norway

Post by Rescator »

You can change that behaviour in the IDE preferences! (cleaning the error log for each compile)
Post Reply