Jump to content

_FileWriteToLine stopped working in script


Go to solution Solved by WhaleJesus,

Recommended Posts

#include <FileConstants.au3>
#include <MsgBoxConstants.au3>
#include <file.au3>
; Create Data Folder if it doesn't exist yet
If FileExists(@ScriptDir & "\Data") Then

Else
    ShellExecute(@ScriptDir)
    DirCreate(@ScriptDir & "\Data")
EndIf

; Playlist Name & location input
Global $playlistnameinput = InputBox("Playlist", "Enter The playlist name", _
        "Name")

Global $playlistlocationinput = InputBox("Location", "Specify where you would like the playlist folder to be stored", @ScriptDir & "\Playlists\" & $playlistnameinput)


; Create file in Data folder and other vars
Global $sDataFile = @ScriptDir & "\Data\Data.txt"
Global $DataHandle = FileOpen($sDataFile, 1)
Global $DataFileLine = FileReadLine($sDataFile, 1)
FileClose($DataFileLine)
MsgBox(0, "", $DataFileLine, 10)

; Prove it exists

If FileExists($sDataFile) Then
    _FileWriteToLine($DataHandle, $DataFileLine, $playlistnameinput, True, True)
    $DataFileLine += 1
    _FileWriteToLine($DataHandle, 1, $DataFileLine, True)
Else
    MsgBox($MB_SYSTEMMODAL, "Error", "File " & $sDataFile & "Does not exist")
EndIf

Global $sPDataFile = @ScriptDir & "\Data\" & $playlistnameinput & "_Data.txt"
Global $PDataHandle = FileOpen($sPDataFile, 1)

If FileExists($sPDataFile) Then
    _FileWriteToLine($PDataHandle, 1, $playlistnameinput, True, True)
    _FileWriteToLine($PDataHandle, 2, $playlistlocationinput, True, True)
Else
    MsgBox($MB_SYSTEMMODAL, "Error", "File " & $sPDataFile & "Does not exist")
EndIf

_FileWriteToLine stopped working and i don't know what it is in my code that's causing this, please help

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
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...