Page 1 of 1

DC_ReadINI issue

Posted: Tue Nov 19, 2013 8:13 am
by BruceN
I'm probably overlooking something incredibly stupid, but... my dc_ReadINI isn't getting anything, it's returning a blank string.

ini_file := path1 + '\MS.INI'
if Fexists(ini_file)
url := DC_INIREAD(ini_file, 'FTPsetup', 'url')
endif


MS.INI file is:

[FTPsetup]
url=ftp.outdoorresourcesllc.com

I tried it with hard wiring the path as well and still get "" returned.
What incredibly obvious thing am I overlooking???

thanks

Re: DC_ReadINI issue

Posted: Tue Nov 19, 2013 8:47 am
by rdonnay
The code looks correct.

I'm concerned about the variable path1 and what it contains.

Put some debugging in the code to make sure that it returns the correct path.

Code: Select all

ini_file := path1 + '\MS.INI'

wtf ini_file

if Fexists(ini_file)

  wtf 'yes it does exist'

   url := DC_INIREAD(ini_file, 'FTPsetup', 'url')
endif

Re: DC_ReadINI issue

Posted: Tue Nov 19, 2013 8:57 am
by BruceN
wtf shows it exists... i also hard wired it (d:\configv9\bikestop\ss.ini) and still got "" returned

Re: DC_ReadINI issue

Posted: Tue Nov 19, 2013 9:15 am
by rdonnay
This is very strange.
I get the same results as you, yet DC_IniRead() works fine on other .INI files.

I discovered that the group heading must be all CAPS.

Code: Select all

url := DC_INIREAD(ini_file, 'FTPSETUP', 'url')

Re: DC_ReadINI issue

Posted: Tue Nov 19, 2013 9:27 am
by BruceN
interesting... that did it. we learned something :)

thanks

Re: DC_ReadINI issue

Posted: Tue Nov 19, 2013 9:50 am
by bwolfsohn
BruceN wrote:interesting... that did it. we learned something :)

thanks
yes, case sensitive.. that's bitten me more than once..