anitdude

Reading from an INI

2 posts in this topic

Hi,

I have a bit of a problem.

I have defined my ini file as a global constant, and to do some tests, I created a section and a few items in it, the values within the test section are 1=1 = msg 1 and 2=2 = msg 2 and so on, so I can see that my variables work. Additionally, I added a read section and create an error msg if not found. For a bizzar reason, I get the error on some sections and not others. This is somewhat frustrating and I dont seem to see why. Anyway, for the most part this works. Maybe there are some clues for troubleshooting why?

My next problem if adding a looping array, where a function will loop through a section executing the same task until there are no more items in the section. I don't see to be able to get my head around this.

An example, all hosts where the hostname is called from a secection and then a referenced section with the hostname has the things to do e.g. FIRSTTHING create a directory and SECONDTHING, copy stuff to that directory.

[HOSTS]

Hostname1=1

Hostname2=1

[HOSTNAME1]

1=FIRSTTHING

2=SECONDTHING

If there a simple way to achieve this, it would be awesome.

Share this post


Link to post
Share on other sites



or a bizzar reason, I get the error on some sections and not others. This is somewhat frustrating and I dont seem to see why.

We cannot see why, either, as you did not post your code. Please post the code you're using to read through the ini, so we can attempt to reproduce.


When you're dead, you don't know you're dead - it's only difficult for those that know you. It's the same way when you're stupid...

My Scripts: SCCM UDFInclude Source with Compiled Script, Windows Firewall UDF

Share this post


Link to post
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