Page 1 of 1

GetPVProfString and Double Quotes (")

Posted: Wed Jan 09, 2008 3:59 pm
by Barry O'Brien
Hi everyone,

I'm using GetPVProfString to return an entry from an ini file that contains double quotes ("). However the function is stripping off the quotes and just returning the data within the quotes.

An example:

Code: Select all

[Test]
Entry=":"
GetPVProfString returns this entry as : and not ":".

If I add extra single quotes to the ini file entry:

Code: Select all

[Test]
Entry='":"'
This returns ":".

I can use the second method as a work-around for now but would prefer to keep my ini file entries as simple as possible.

Is this how the function is supposed to work or is it a bug?

Kind regards,

Barry O'Brien

Posted: Wed Jan 09, 2008 4:31 pm
by James Bott
Barry,

>Is this how the function is supposed to work or is it a bug?

I belive this is how it is supposed to work--so you can tell numbers from strings. E.G.

Entry="888"

Entry=888

Regards
James

Posted: Wed Jan 09, 2008 5:12 pm
by Barry O'Brien
Hi James,
I belive this is how it is supposed to work--so you can tell numbers from strings.
There is another function GetPVProfInt() for returning integers. I thought that GetPVProfString() would return the entire value of an entry as a string, regardless of quotes or any odd characters it might contain.

Then again, quotes within strings have always been a bit of a mine-field in any language! :roll:

Kind regards,

Barry O'Brien