Source language: Translate to:

hpw ini read problem

Questions about NeoBook PlugIns

Moderator: Neosoft Support

hpw ini read problem

Postby Wrangler » Mon Jan 14, 2013 1:40 pm

Hi Hans-Peter,

Are you aware of any character limitations with hpwiniread? I can't seem to be able to read more than 2000 characters out of a value into a multi-line list box. Research says 64k is the limit for an ini file size, but I'm only at 2.6K. Is this a limit in the plugin?

Thanks much,

Wrangler
Wrangler
--------------
"You never know about a woman. Whether she'll laugh, cry or go for a gun." - Louis L'Amour

Windows 7 Ultimate SP1 64bit
16GB Ram
Asus GTX 950 OC Strix
Software made with NeoBook
http://highdesertsoftware.com
User avatar
Wrangler
 
Posts: 1507
Joined: Thu Mar 31, 2005 11:40 pm
Location: USA

Re: hpw ini read problem

Postby HPW » Mon Jan 14, 2013 2:39 pm

Hello,

I was not aware of a limit.
But after some googeling and a look in the delphi source, I found the limit of TInifile.ReadString
Code: Select all
function TIniFile.ReadString(const Section, Ident, Default: string): string;
var
  Buffer: array[0..2047] of Char;
begin
  SetString(Result, Buffer, GetPrivateProfileString(PChar(Section),
    PChar(Ident), PChar(Default), Buffer, SizeOf(Buffer), PChar(FFileName)));
end;


As you can see it use a buffer of 2047.
So it was not designed to handle larger amount of data.
Is it wise to use it for such data?
Ini/Config data is mostly a lot shorter.

???

Hans-Peter
Hans-Peter
User avatar
HPW
 
Posts: 2521
Joined: Fri Apr 01, 2005 11:24 pm
Location: Germany

Re: hpw ini read problem

Postby Wrangler » Mon Jan 14, 2013 2:54 pm

OK. I see. Was just curious. I was already storing a lot of other short data in the file, so I thought I would also store long descriptions there (push the envelope). I can just write this data to a text file instead.

Thanks for the response!
Wrangler
--------------
"You never know about a woman. Whether she'll laugh, cry or go for a gun." - Louis L'Amour

Windows 7 Ultimate SP1 64bit
16GB Ram
Asus GTX 950 OC Strix
Software made with NeoBook
http://highdesertsoftware.com
User avatar
Wrangler
 
Posts: 1507
Joined: Thu Mar 31, 2005 11:40 pm
Location: USA

Re: hpw ini read problem

Postby HPW » Mon Jan 14, 2013 3:03 pm

Try out 2.30 and report the result.
I used a patched version of the original source with a new limit of 16K.
I have no test case so please test.

Hans-Peter
Hans-Peter
User avatar
HPW
 
Posts: 2521
Joined: Fri Apr 01, 2005 11:24 pm
Location: Germany

Re: hpw ini read problem

Postby Wrangler » Mon Jan 14, 2013 3:12 pm

Works great, Hans. Thank you!
Wrangler
--------------
"You never know about a woman. Whether she'll laugh, cry or go for a gun." - Louis L'Amour

Windows 7 Ultimate SP1 64bit
16GB Ram
Asus GTX 950 OC Strix
Software made with NeoBook
http://highdesertsoftware.com
User avatar
Wrangler
 
Posts: 1507
Joined: Thu Mar 31, 2005 11:40 pm
Location: USA

Re: hpw ini read problem

Postby HPW » Mon Jan 14, 2013 3:23 pm

Good to know.
Just checked D2010 and it stil has the same 2K limit.

Regards
Hans-Peter
User avatar
HPW
 
Posts: 2521
Joined: Fri Apr 01, 2005 11:24 pm
Location: Germany


Return to PlugIn Discussions

Who is online

Users browsing this forum: No registered users and 2 guests

cron