Jump to content

INIRead


Recommended Posts

This code is to perform multiple reads of an INI file [3 in this example but it could be 33 or any other number for that matter]

#include <string.au3>

Const $ScriptDir = @ScriptDir & "\test.ini"

Global $BeepNum = "", $PingID1 = "", $PingID2 = ""

Global $LData[3] = ["$BeepNum|Section1|value|4", "$PingID1|Section2|value|0", "$PingID2|Section3|value|0"]]

For $i = 0 To UBound($LData) - 1

$LICENCEData = _StringSplit($LData[$i], "|")

$INIRead = IniRead($ScriptDir,$LICENCEData[1],$LICENCEData[2],$LICENCEData[3])

If $LICENCEData[0] = "$BeepNum" then $BeepNum = $INIRead

If $LICENCEData[0] = "$PingID1" then $PingID1 = $INIRead

If $LICENCEData[0] = "$PingID2" then $PingID2 = $INIRead

Next

Exit

Whilst it works how do I assign the INI file value for $BeepNum, $PingID1 and $PingID2 for as many items as there might be without having to use an individual IF statements

to assign the INI value to each variable. Ant.. :)

Link to comment
Share on other sites

Thanks for that as you have pointed out you indeed to not need to us '$' in the array. Ant.. :)

I should have noted the time before posting. server went down momentarily causing duplicate posts.

every now and then if I'm on the forum around 8AM GMT (3AM where I am)

the site gives internal server errors and wont load pages or process posts.

down for maintenance routines I assume.

I see fascists...

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