Jump to content

Recommended Posts

Posted

I not know if it is a bug.

i have Clock.au3 and Clock.ini in a folder.

Clock.ini have:

[Clock]

Voice=222

I run:

$v=IniRead(@ScriptDir & "\Clock.ini","Clock","Voice","111")

and

$v is set to 111 intead of 22

if rename Clock.ini to aaaa.ini it work fine

again

I run:

$v=IniWrite(@ScriptDir & "\Clock.ini","Clock","Voice","333")

ini file not change 111 but if i restart au3 iniread get 333 from Clock.ini

  • Moderators
Posted

Ontosy,

  Quote

I not know if it is a bug

I doubt it very much if you mean a bug in AutoIt. :D

This snippet works fine for me - I get the correct returns and the ini file is updated: ;)

; Click.ini set to Voice=222

$v=IniRead(@ScriptDir & "Clock.ini","Clock","Voice","111")
ConsoleWrite($v & @CRLF) ; I get 222
$v=IniWrite(@ScriptDir & "Clock.ini","Clock","Voice","333")
$v=IniRead(@ScriptDir & "Clock.ini","Clock","Voice","111")
ConsoleWrite($v & @CRLF) ; I get 333 and the ini file holds that value

  Quote

ini file not change 111

Why would it? You have just set it to 333! :)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

  Reveal hidden contents

 

Posted

to me it not work.

do you have Autoit 3, 3, 8, 0?

do you have read Clock.ini with a editor?

The script work also for me but the "Clock.ini" file is not changed.

Posted

Is the file read-only? Is the file in use by another application?

UDF List:

  Reveal hidden contents

Updated: 22/04/2018

  • Moderators
Posted

Ontosy,

Are you sure you are looking at the right Clock.ini file? Do you have another one somewhere other than in your @ScriptDir? :)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

  Reveal hidden contents

 

Posted

You said the Clock.au3 script and Clock.ini file were "in a folder". Are you compiling the script into an .exe and running it from somewhere else? If so, then @ScriptDir is pointing to a different location. Add a MsgBox() or something to report the full path from within the script, like:

MsgBox(64, "Debug", "Path = " & @ScriptDir & "Clock.ini")
See if that matches what you expect.

:)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Posted (edited)

If i run this code in the file called "Clock.au3" or in any other way:

Dim $ini=@ScriptDir & "Clock.ini"
IniWrite($ini,"Clock","Left",111)

the Clock.ini is not created but the value in key section IniRead($ini,"Clock","Left","22") is readed. I scan all disks but Clock.ini is not found.

If i run this code:

Dim $ini=@ScriptDir & "Clockbbb.ini"
IniWrite($ini,"Clock","Left",111)

the Clockbbb.ini is created

i have tried in 2 computer.

Edited by Ontosy
Posted (edited)

I solved it's amazing !

  Quote

On XP, we cannot use Clock.ini, Win.ini, System.ini, etc., as ini filename. These ini filenames are handled as "IniFileMapping". Administering the Windows NT Registry Quote: How Does Mapping Work? NT implements mapping by trapping the private profile API routines I mentioned in Chapter 1. Windows applications and components ordinarily use these calls to get and set data stored in INI files, but when there's a mapping entry, the NT kernel first checks for the presence of a mapping key. If one exists, and if it points to a key that contains data, that data is returned to the caller. If there's no mapping key, or if it points to an empty or non-existent Registry key, NT will go ahead and try to read the data from the INI file. The caller need never be aware that the data didn't come from the requested file. Mapping only occurs when there's a mapping key in place. These keys are stored beneath the HKLMSOFTWAREMicrosoftWindows NTCurrentVersionIniFileMapping subkey. If you look there, you'll notice a number of subkeys with names like Clock.INI, Win.INI, and SYSTEM.INI. These keys tie sections of the old Win 3.1-style INI files to keys in the Registry so that old Windows 3.1 components like the Clock and the original media controller interface (MCI) will continue to find their settings.

But it is strange to you that works! ; )

Edited by Ontosy
  • Moderators
Posted

Ontosy,

Well found! :)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

  Reveal hidden contents

 

Posted
  Quote

But it is strange to you that works! ; )

I believe most in this thread use Windows Vista or above. I found an article on MSDN that describes a little more about what you quoted from Rainmeter.

UDF List:

  Reveal hidden contents

Updated: 22/04/2018

Posted

  On 1/3/2012 at 2:50 AM, 'PsaltyDS said:

I haven't had to mess with NT in almost a decade, and wouldn't have hit on that. :)

This problem is also for Windows XP.

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...