Jump to content

[Solved]_Iniwrite bug?


goldenix
 Share

Recommended Posts

Make new folder

C:\Documents and Settings\user\Desktop\New Folder & run this code from there. Full pre made sample in the Attachment

C:\Documents and Settings\user\Desktop\config.ini will be created & filled with the data.

I tried & it works.

Now I paste this same code into the beginning of my other script located in:

F:\MeieFailid\user\Backups\Klikkers\samples\E-Mail\Universal Mail Checker\Executables\

F:\MeieFailid\user\Backups\Klikkers\samples\E-Mail\Universal Mail Checker\config.ini already exists there & the additional info should be added via iniwrite now. but it is not happening. nothing is written into ini

I tried to rename that old ini file & in this case new ini is created. Old ini is not read only.

just run the sample in the attachment, see it dos not work for some reason.

$mail = 'mail'

;~ Get config.ini Dir is 1 dir above scriptdir
;~ ----------------------------------
$Config = StringSplit(@ScriptDir,'\')
$Config = StringReplace(@ScriptDir,$Config[$Config[0]],'') ;cut last split
$Config = $Config & 'config.ini'
;~ ----------------------------------

IniWrite($Config, $mail, "Newmail", '1') ; write to file how many new mails you have
IniWrite($Config, $mail, "Last_Check_Time", @MDAY & '/' & @MON & '/' & @YEAR & @CRLF) 
ConsoleWrite($Config & @CRLF)

Exit

ytyy.rar

Edited by goldenix
My Projects:[list][*]Guide - ytube step by step tut for reading memory with autoitscript + samples[*]WinHide - tool to show hide windows, Skinned With GDI+[*]Virtualdub batch job list maker - Batch Process all files with same settings[*]Exp calc - Exp calculator for online games[*]Automated Microsoft SQL Server 2000 installer[*]Image sorter helper for IrfanView - 1 click opens img & move ur mouse to close opened img[/list]
Link to comment
Share on other sites

Make new folder

C:\Documents and Settings\user\Desktop\New Folder & run this code from there. Full pre made sample in the Attachment

C:\Documents and Settings\user\Desktop\config.ini will be created & filled with the data.

I tried & it works.

Now I paste this same code into the beginning of my other script located in:

F:\MeieFailid\user\Backups\Klikkers\samples\E-Mail\Universal Mail Checker\Executables\

F:\MeieFailid\user\Backups\Klikkers\samples\E-Mail\Universal Mail Checker\config.ini already exists there & the additional info should be added via iniwrite now. but it is not happening. nothing is written into ini

I tried to rename that old ini file & in this case new ini is created. Old ini is not read only.

just run the sample in the attachment, see it dos not work for some reason.

$mail = 'mail'

;~ Get config.ini Dir is 1 dir above scriptdir
;~ ----------------------------------
$Config = StringSplit(@ScriptDir,'\')
$Config = StringReplace(@ScriptDir,$Config[$Config[0]],'') ;cut last split
$Config = $Config & 'config.ini'
;~ ----------------------------------

IniWrite($Config, $mail, "Newmail", '1') ; write to file how many new mails you have
IniWrite($Config, $mail, "Last_Check_Time", @MDAY & '/' & @MON & '/' & @YEAR & @CRLF) 
ConsoleWrite($Config & @CRLF)

Exit
I don't see anything wrong so you need to add something to check that $config exists, and see what the return from IniWrite is.
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

I don't see anything wrong so you need to add something to check that $config exists, and see what the return from IniWrite is.

I added this at the end of the script: & it says the config is there, yet its not being updated. really weird.

If FileExists($Config) Then ConsoleWrite('Bingo' & @CRLF)

This what it returns:

C:\Documents and Settings\user\Desktop\ytyy\ytyy\config.ini
Bingo
My Projects:[list][*]Guide - ytube step by step tut for reading memory with autoitscript + samples[*]WinHide - tool to show hide windows, Skinned With GDI+[*]Virtualdub batch job list maker - Batch Process all files with same settings[*]Exp calc - Exp calculator for online games[*]Automated Microsoft SQL Server 2000 installer[*]Image sorter helper for IrfanView - 1 click opens img & move ur mouse to close opened img[/list]
Link to comment
Share on other sites

  • Moderators

LOL ... Why are you using @CRLF in the write string? Did you scroll down further? All your @CRLF's (Carriage Return + LineFeeds) are being added ... the rest of the data is there.

Item_status=Enabled

Newmail=kkk

[section]

Newmail=1

Last_Check_Time=28/11/2008

[mail]

Newmail=1

Last_Check_Time=28/11/2008

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

LOL ... Why are you using @CRLF in the write string? Did you scroll down further? All your @CRLF's (Carriage Return + LineFeeds) are being added ... the rest of the data is there.

W00t indeed. problem solved.

2 heads are always better than 1 head hehe. :)

My Projects:[list][*]Guide - ytube step by step tut for reading memory with autoitscript + samples[*]WinHide - tool to show hide windows, Skinned With GDI+[*]Virtualdub batch job list maker - Batch Process all files with same settings[*]Exp calc - Exp calculator for online games[*]Automated Microsoft SQL Server 2000 installer[*]Image sorter helper for IrfanView - 1 click opens img & move ur mouse to close opened img[/list]
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...