jueki Posted March 2, 2008 Share Posted March 2, 2008 hello all, here's my code, take a look please. #include "File.au3" $ini = "Test.ini" $Release_File = FileReadLine($ini, 2) $Release_File_Size = FileGetSize($Release_File) $test = _FileWriteToLine("Test.ini", 1, $Release_File_Size, 1) then it replaces the first line correctly with "blah test".. any idea what i am doing wrong? the help file isnt helping me.. lol Link to comment Share on other sites More sharing options...
Aceguy Posted March 2, 2008 Share Posted March 2, 2008 #include <File.au3> $ini = @MyDocumentsDir & "\test.ini" $Release_File = FileReadLine($ini, 2) $Release_File_Size = FileGetSize($Release_File) IniWrite($ini,"test section",0,$Release_File_Size) change your inifile to look like this. [test section] 0=123456678 1=test..exe 2=test_123.exe [u]My Projects.[/u]Launcher - not just for games & Apps (Mp3's & Network Files)Mp3 File RenamerMy File Backup UtilityFFXI - Realtime to Vana time Clock Link to comment Share on other sites More sharing options...
Aceguy Posted March 2, 2008 Share Posted March 2, 2008 #include <File.au3> $ini = @MyDocumentsDir & "\test.ini" $Release_File = FileReadLine($ini, 2) $Release_File_Size = FileGetSize($Release_File) IniWrite($ini,"test section",0,$Release_File_Size) change your inifile to look like this. [test section] 0=123456678 1=test..exe 2=test_123.exe [u]My Projects.[/u]Launcher - not just for games & Apps (Mp3's & Network Files)Mp3 File RenamerMy File Backup UtilityFFXI - Realtime to Vana time Clock Link to comment Share on other sites More sharing options...
martin Posted March 2, 2008 Share Posted March 2, 2008 hello all, here's my code, take a look please. #include "File.au3" $ini = "Test.ini" $Release_File = FileReadLine($ini, 2) $Release_File_Size = FileGetSize($Release_File) $test = _FileWriteToLine("Test.ini", 1, $Release_File_Size, 1) then it replaces the first line correctly with "blah test".. any idea what i am doing wrong? the help file isnt helping me.. lolIf the file Test.exe doesn't exist or it's size is zero then you will be trying to write a line 0, or a null string, so nothing will happen. Maybe that's the problem. Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
jueki Posted March 2, 2008 Author Share Posted March 2, 2008 martin, the file size is not 0, its 300+ kb Aceguy, i didnt want to use the ini functions because i dont want it to have [sections] =/. the size has to stay in first line Link to comment Share on other sites More sharing options...
martin Posted March 2, 2008 Share Posted March 2, 2008 martin, the file size is not 0, its 300+ kb Aceguy, i didnt want to use the ini functions because i dont want it to have [sections] =/. the size has to stay in first line OK, then change your line to $test = _FileWriteToLine("Test.ini", 1, String($Release_File_Size), 1) otherwise yu are trying to write a number as a string. Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
Aceguy Posted March 2, 2008 Share Posted March 2, 2008 (edited) sorry dont know how to use the Quote function but in your first post... 'contents of the Test.ini' so isnt .ini and inifile. Edited March 2, 2008 by Aceguy [u]My Projects.[/u]Launcher - not just for games & Apps (Mp3's & Network Files)Mp3 File RenamerMy File Backup UtilityFFXI - Realtime to Vana time Clock Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now