Jump to content
Sign in to follow this  
craigholohan

INIRead help

Recommended Posts

craigholohan

Hi Guys and Gals,

I have a quick question, I know there is a simple answer but I have been struggling all day :">

I have a simlpe INI file with 2 Key values and I need to call them together.

See below:

Global $readPath = IniRead(@ScriptDir & "\fileLocation.ini", "File Location", "Path", $fileLocation)

Global $readfile = IniRead(@scriptDir & "\fileLocation.ini", "File Location", "fileName", $fileLocation)

Global $filename = $readPath\$readfile

the $filename is what I want to read, so in efect I need to put the $readPath and $readfile together.

Hope this is a good enough explanation.

Thanks in advance for any help.

Share this post


Link to post
Share on other sites
craigholohan

$readPath & "\" & $readfile

Thanks JdeB,

I did try that before but it still does not seem to work.

Below is whats in my ini file:

[File Location]

Path=C:\Micros BootP Config\

[File Name]

fileName=bootptab

and what I need it to return is C:\Micros BootP Config\bootptab

If I type:

$filename = C:\Micros BootP Config\bootptab

my script works the way I want it to, also if I just have one entry in my INI file like:

[File Location]

Path=C:\Micros BootP Config\bootptab

then use:

Global $filename = IniRead(@scriptDir & "\fileLocation.ini", "File Location", "Path", $fileLocation)

it also works but in another part of the app I only need the path and not the file name that is why I need to do it the hard way around.

Share this post


Link to post
Share on other sites
craigholohan

Dont worry I fond my mistake -- Marked in red

Global $readPath = IniRead(@ScriptDir & "\fileLocation.ini", "File Location", "Path", $fileLocation)

Global $readfile = IniRead(@scriptDir & "\fileLocation.ini", "File Name", "fileName", $fileLocation)

Sorry to be so silly but thanks anyway.

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
Sign in to follow this  

×