#42270 - 2003-06-30 08:40 PM
Multiple WriteProfileString() ?
|
Austin
Seasoned Scripter
Registered: 2002-01-24
Posts: 439
|
Just wondering about something. I am doing 4 sucessive WriteProfileString() calls that are all going to the same file and section. Can I consolidate these so that the file will not need to be opened four times but rather could simply write these entries at once.. problem is that the file is opened across the network.
Thanks
_________________________
Austin Henderson
|
|
Top
|
|
|
|
#42272 - 2003-06-30 08:52 PM
Re: Multiple WriteProfileString() ?
|
Austin
Seasoned Scripter
Registered: 2002-01-24
Posts: 439
|
hmm.. maybe a possible UDF?
I searched but didnt really find anything that looked promising.. maybe shoudl refine my search.
_________________________
Austin Henderson
|
|
Top
|
|
|
|
#42274 - 2003-06-30 09:00 PM
Re: Multiple WriteProfileString() ?
|
Austin
Seasoned Scripter
Registered: 2002-01-24
Posts: 439
|
Possible UDF could take a 2D array in for entry and value.. could take in a path and a section. (four parameters)..Could use readline to find section and writeline to enter the values maybe? Just thinking out loud. See any problems with that just at first glance?
_________________________
Austin Henderson
|
|
Top
|
|
|
|
#42275 - 2003-06-30 09:10 PM
Re: Multiple WriteProfileString() ?
|
Sealeopard
KiX Master
   
Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
|
Yes, I do. WRITEPROFILESTRING is the most efficient way to write to .INI files. OPEN/READLINE/WRITELINE/CLOSE is slow, see the KiXtart Manual. quote: The file-I/O functions in KiXtart (Open, ReadLine, and Close) process small configuration files. They are not intended for larger operations, such as scanning long files. For the sake of simplicity and speed, Open reads an entire ASCII file into memory, and subsequent ReadLine commands read lines stored in memory.
READPROFILESTRING/WRITEPROFILESTRING use the internal Windows API to read/write whereas your solution will do it in KiXtart , which is very inefficient compared to a C++ API.
Also, I would say the READPROFILESTRING/WRITEPROFILESTRING will use less packets to accomplish a give task than the OPEN/READLINE/WRITELINE/CLOSE.
_________________________
There are two types of vessels, submarines and targets.
|
|
Top
|
|
|
|
#42276 - 2003-06-30 09:53 PM
Re: Multiple WriteProfileString() ?
|
Austin
Seasoned Scripter
Registered: 2002-01-24
Posts: 439
|
Got it.. my solution is to combine my entries into one value.. I will split them out on the other end.. when I am processing the ini file.
Thank you
_________________________
Austin Henderson
|
|
Top
|
|
|
|
#42278 - 2003-06-30 10:05 PM
Re: Multiple WriteProfileString() ?
|
Austin
Seasoned Scripter
Registered: 2002-01-24
Posts: 439
|
I am not sure as of yet to be honest with you. I will get back with you on that.
_________________________
Austin Henderson
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 1160 anonymous users online.
|
|
|