How to make a ini-file

Discussion specific to NXT-G, NXC, NBC, RobotC, Lejos, and more.
wkohlenberg
Posts: 4
Joined: 01 Aug 2011, 06:48

How to make a ini-file

Post 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.)
timpattinson
Posts: 224
Joined: 30 Oct 2010, 04:10
Location: 127.0.0.1
Contact:

Re: How to make a ini-file

Post 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
Commit to Lego Mindstorms StackExchange Q&A http://area51.stackexchange.com/proposals/4105
Minboards IRC Channel #mindboards on Freenode
My blog: http://timpattinson.wordpress.com/
wkohlenberg
Posts: 4
Joined: 01 Aug 2011, 06:48

Re: How to make a ini-file

Post 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.
timpattinson
Posts: 224
Joined: 30 Oct 2010, 04:10
Location: 127.0.0.1
Contact:

Re: How to make a ini-file

Post 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
Commit to Lego Mindstorms StackExchange Q&A http://area51.stackexchange.com/proposals/4105
Minboards IRC Channel #mindboards on Freenode
My blog: http://timpattinson.wordpress.com/
wkohlenberg
Posts: 4
Joined: 01 Aug 2011, 06:48

Re: How to make a ini-file

Post 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
h-g-t
Posts: 552
Joined: 07 Jan 2011, 08:59
Location: Albania

Re: How to make a ini-file

Post 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'?
A sophistical rhetorician, inebriated with the exuberance of his own verbosity, and gifted with an egotistical imagination that can at all times command an interminable and inconsistent series of arguments to malign an opponent and to glorify himself.
linusa
Posts: 228
Joined: 16 Oct 2010, 11:44
Location: Aachen, Germany
Contact:

Re: How to make a ini-file

Post 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!
RWTH - Mindstorms NXT Toolbox for MATLAB
state of the art in nxt remote control programming
http://www.mindstorms.rwth-aachen.de
MotorControl now also in Python, .net, and Mathematica
afanofosc
Site Admin
Posts: 1256
Joined: 26 Sep 2010, 19:36
Location: Nashville, TN
Contact:

Re: How to make a ini-file

Post 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
Multi-platform LEGO MINDSTORMS programming
http://bricxcc.sourceforge.net/
wkohlenberg
Posts: 4
Joined: 01 Aug 2011, 06:48

Re: How to make a ini-file

Post 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.
timpattinson
Posts: 224
Joined: 30 Oct 2010, 04:10
Location: 127.0.0.1
Contact:

Re: How to make a ini-file

Post 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 ;)
Commit to Lego Mindstorms StackExchange Q&A http://area51.stackexchange.com/proposals/4105
Minboards IRC Channel #mindboards on Freenode
My blog: http://timpattinson.wordpress.com/
Post Reply

Who is online

Users browsing this forum: No registered users and 17 guests