Jump to content
Sign in to follow this  
demandnothing

Please Help With FileWriteLine

Recommended Posts

demandnothing

$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?

Share this post


Link to post
Share on other sites
Jos

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

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
demandnothing

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

Share this post


Link to post
Share on other sites
Jos

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

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


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.