Page 1 of 2

How to make a ini-file

Posted: 01 Aug 2011, 07:16
by wkohlenberg
Hello,

I'm new on the forum and a have a question.
My question: "How can I make a ini-file?" I now how to make a txt-file.
If you have a more information, you can post it.

Meanwhile thanks for your time,
Walter.

(Sorry, I'm so bad in English.)

Re: How to make a ini-file

Posted: 01 Aug 2011, 08:35
by timpattinson
http://en.wikipedia.org/wiki/INI_file
The basic syntax is this:

Code: Select all

[Section name]
Name=Value
OtherName=OtherValue ;this is a comment. it is ignored

Re: How to make a ini-file

Posted: 01 Aug 2011, 09:22
by wkohlenberg
Sorry, I mean: How to safe data (from the nxt) in an ini-file. I know how this can with a txt-file.

Re: How to make a ini-file

Posted: 01 Aug 2011, 09:36
by timpattinson
Well just use the normal functions to write to a txt file, but use the extension .ini
I may edit this later with better advice

Re: How to make a ini-file

Posted: 01 Aug 2011, 09:48
by wkohlenberg
timpattinson wrote:Well just use the normal functions to write to a txt file, but use the extension .ini
I may edit this later with better advice
Oh, I know what you mean.
Thank you for your time and help.

[edit]
I have tryed your advice, but it don't work.
I have a ini-file, with the name objects. I have downloaded the file.
Now Read the code the file objects, but the code don't regonized the file.

the conclusion: Your advice don't work. Sorry

Re: How to make a ini-file

Posted: 01 Aug 2011, 13:15
by h-g-t
http://en.wikipedia.org/wiki/INI_file

'Ini' files tend to be specific to the application. What application are you using that requires this file to be marked 'ini'?

Re: How to make a ini-file

Posted: 01 Aug 2011, 16:01
by linusa
wkohlenberg wrote: [edit]
I have tryed your advice, but it don't work.
I have a ini-file, with the name objects. I have downloaded the file.
Now Read the code the file objects, but the code don't regonized the file.

the conclusion: Your advice don't work. Sorry
His advice is correct. Ini files are text files. With a certain rule how this text should look. We can't help you if you don't post the files, the code, and exactly what you want to do!

Re: How to make a ini-file

Posted: 01 Aug 2011, 16:36
by afanofosc
wkohlenberg wrote:
timpattinson wrote:Well just use the normal functions to write to a txt file, but use the extension .ini
I may edit this later with better advice
Oh, I know what you mean.
Thank you for your time and help.

[edit]
I have tryed your advice, but it don't work.
I have a ini-file, with the name objects. I have downloaded the file.
Now Read the code the file objects, but the code don't regonized the file.

the conclusion: Your advice don't work. Sorry
Are you programming in NXT-G or some other programming language? If you are using a text-based programming language like NXC then I would encourage you to post your source code so that we can help you correct the problems you are having. Send it to a compressed folder (aka .zip file) and attach it to your next post. Can I ask why you are wanting your NXT to create an ini file for you?

John Hansen

Re: How to make a ini-file

Posted: 02 Aug 2011, 07:16
by wkohlenberg
I'm programming in NXT-G.
I have a ini-file with the name objects. I download the ini-file to the NXT-brick. The NXT-G code read the file en write the first sentence of the file on the display, but there isn't.
It works when I make the ini-file to a txt-file.

Re: How to make a ini-file

Posted: 05 Aug 2011, 13:19
by timpattinson
linusa wrote: We can't help you if you don't post the files, the code, and exactly what you want to do!
wink wink nudge nudge ;)