Jump to content

Please Help With FileWriteLine


Recommended Posts

$Filter = @ScriptDir & "\Inject.txt"
$File = _FileCreate($Filter)
$xFile = FileOpen("Inject.txt", 2)


Case $Add
            $Path = FileOpenDialog("", @ScriptDir, "Dynamic Link Lybrary (*.DLL)")
            $Write = FileWriteLine($xFile, $Path & @CRLF)
            If $Write = 1 Then
                GUICtrlSetData($List1, $Path)
            EndIf

its not writing to the file... what am i doing wrong?

Link to comment
Share on other sites

  • Developers

try:

$Filter = @ScriptDir & "\Inject.txt"
$xFile = FileOpen($Filter, 2)

Case $Add
            $Path = FileOpenDialog("", @ScriptDir, "Dynamic Link Lybrary (*.DLL)")
            $Write = FileWriteLine($xFile, $Path & @CRLF)
            If $Write = 1 Then
                GUICtrlSetData($List1, $Path)
            EndIf

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

try:

$Filter = @ScriptDir & "\Inject.txt"
$xFile = FileOpen($Filter, 2)

Case $Add
            $Path = FileOpenDialog("", @ScriptDir, "Dynamic Link Lybrary (*.DLL)")
            $Write = FileWriteLine($xFile, $Path & @CRLF)
            If $Write = 1 Then
                GUICtrlSetData($List1, $Path)
            EndIf

i did and it didnt work either..

$Write does = 1 and it does write to the GUI but the file remains blank.

I APPOLOGIZE FOR THIS POST!!!!

THE REASON IT WAS NOT WORKING WAS BECAUSE I HAD THE FILE VARIABLES OUTSIDE OF THE WHILE LOOP

Edited by demandnothing
Link to comment
Share on other sites

  • Developers

Did you check after the script ended of closed the file?

Else check the @error returned for the FileOpen() and FileWrite().

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...