InI / File Loading
Hi Everybody,
how i can load files like this:
[NEW_POINT1]
message = Hi
x = 4
y = 3
[NEW_POINT2]
message = Ha
x = 5
y = 7
can somebody please help me?
Thanx
Lutz Hören
psYchOtroW
I am not going to spoon feed you the code, because quite frankly you should be able to figure it out without too much trouble. Do a little research on file input and output.
-------------------------
How you like them apples?
-------------------------
How you like them apples?
November 13, 2000 03:22 PM
Well, you''d need to open the file in text mode, something like this
OPEN filename$ FOR INPUT AS #1
Then read a line of text in
INPUT #1,a$
And then parse the line,
IF a$="[NEW_POINT1]" THEN LET field=1
etc..
(I''m assuming QBasic here, you didn''t specify what language)
OPEN filename$ FOR INPUT AS #1
Then read a line of text in
INPUT #1,a$
And then parse the line,
IF a$="[NEW_POINT1]" THEN LET field=1
etc..
(I''m assuming QBasic here, you didn''t specify what language)
acw83, you don''t have to be such a dink, you had to start somewhere too.
PsYchOtroW, I''ll assume your trying to do read a *.INI in windows so try this:
GetPrivateProfileString(
LPCTSTR lpAppName, // section name
LPCTSTR lpKeyName, // key name
LPCTSTR lpDefault, // default string
LPTSTR lpReturnedString, // destination buffer
DWORD nSize, // size of destination buffer
LPCTSTR lpFileName // initialization file name
);
I think you figure the rest of it out.
"I can''t work like this! Where are my fuzzy dice?"
PsYchOtroW, I''ll assume your trying to do read a *.INI in windows so try this:
GetPrivateProfileString(
LPCTSTR lpAppName, // section name
LPCTSTR lpKeyName, // key name
LPCTSTR lpDefault, // default string
LPTSTR lpReturnedString, // destination buffer
DWORD nSize, // size of destination buffer
LPCTSTR lpFileName // initialization file name
);
I think you figure the rest of it out.
"I can''t work like this! Where are my fuzzy dice?"
"I can't work like this! Where are my fuzzy dice?"
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement