Jump to content

Recommended Posts

Posted

Hello everyone.

I need help with scripts. I have some code which creates array, and next writes this array to a file (function _FileWriteFromArray).

In the next step it creates second array. I would like to add this array to previous file, but function _FileWriteFromArray repleaces only content in the file.
Is there any other way to solve this problem?

  • Moderators
Posted

blantek212,

Do not forget to close the file handle when you have written the last array.

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

  Reveal hidden contents

 

  • 2 weeks later...
Posted

I'm not sure what _FileWriteFromArray does, but the simplest thing you can do is something like this:

$file = FileOpen("FILENAME.txt", 1)

For Local $i = 0 To $array1Size
    FileWrite($file, $array1[$i], " ") ;Log to file.
Next

FileWrite($file, @CRLF) ;Newline.

For Local $i = 0 To $array2Size
    FileWrite($file, $array2[$i], " ") ;Log to file.
Next

FileWrite($file, @CRLF) ;Newline.

;Etc...

FileClose($file)

 

  • Moderators
Posted

Pured,

  Quote

I'm not sure what _FileWriteFromArray does

Expand  

Then I suggest opening the Help file and reading about the function rather then making inane and unhelpful comments like the above.

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

  Reveal hidden contents

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...