Ahk + IniRead Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
SkmDanny
Posts: 2
Joined: 17 Mar 2018, 14:25

Ahk + IniRead

17 Mar 2018, 14:44

Good evening!
I have a small problem...

Test.ini

Code: Select all

[Users]
Stefania
Cristina
Test.ahk

Code: Select all

IniRead, TestName, Test.ini, Users
inputbox, UserName, Enter a name:, What is your name?
if (UserName = TestName)
{
	fileappend, [Username]`n%UserName%, %UserName%.ini
}
The problem is the next:
When I write the correct name from Test.ini, the script need to create a .ini file with the written name.
I need to know next:
1. What I need to do to use Stefania or Cristina + other name if I add in Test.ini
2. I need, when I enter a name, to correspond with a name from Test.ini.

Sorry for my bad english, and thank you for your help and accorded time!
User avatar
Cuadrix
Posts: 236
Joined: 07 May 2017, 08:26

Re: Ahk + IniRead  Topic is solved

17 Mar 2018, 16:17

To do that, you can use InStr(), like this:

Code: Select all

IniRead, TestName, Names.ini, Users
InputBox, UserName, Enter a name:, What is your name?

If InStr(TestName, UserName)
{
	FileAppend, [Username]`n%UserName%, %UserName%.ini
}
Guest

Re: Ahk + IniRead

17 Mar 2018, 16:31

Use IniWrite not FileAppend to create INI files.
SkmDanny
Posts: 2
Joined: 17 Mar 2018, 14:25

Re: Ahk + IniRead

18 Mar 2018, 02:14

Cuadrix wrote:To do that, you can use InStr(), like this:

Code: Select all

IniRead, TestName, Names.ini, Users
InputBox, UserName, Enter a name:, What is your name?

If InStr(TestName, UserName)
{
	FileAppend, [Username]`n%UserName%, %UserName%.ini
}
Thank you very much for your help!

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: RandomBoy and 266 guests