Page 1 of 1 1
Topic Options
#46457 - 2003-10-08 07:17 PM Edit an ini file
gram Offline
Lurker

Registered: 2003-10-08
Posts: 1
[Moderator (Sealeopard): Moved thread from 'Scripts' to 'Starters' forum due to lack of script in body]

I want to be able to check that a specific line appears at the top of a section in an ini file. If the line is not located at the top of the section, I want to move it to that location. Is this possible with kix?

Thanks

[ 08. October 2003, 19:22: Message edited by: sealeopard ]

Top
#46458 - 2003-10-08 07:20 PM Re: Edit an ini file
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
READPROFILESTRING/WRITEPROFILESTRING are your friends with INI files.

Kent
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#46459 - 2003-10-08 07:25 PM Re: Edit an ini file
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Locations are irrelevant in .INI files. A key can appear within any position inside the section. Sections can appear anywhere among sections, too.
_________________________
There are two types of vessels, submarines and targets.

Top
#46460 - 2003-10-08 09:12 PM Re: Edit an ini file
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11634
Loc: Space
Hello Gram and welcome to the board otherwise known as KORG

Please take a look at this posting and if you have further questions please let us know.

Also please review the FAQ section here on the board which attempts to answer many of the questions asked.

I have a .CHM help file on my website for download as well which contains a lot of information about KiXtart

KiXhelp Website

KORG-FAQ Help file .CHM format


Replace a value in an INI file

[ 08. October 2003, 21:14: Message edited by: NTDOC ]

Top
#46461 - 2003-10-08 09:53 PM Re: Edit an ini file
Jack Lothian Offline
MM club member
*****

Registered: 1999-10-22
Posts: 1169
Loc: Ottawa,Ontario, Canada
To do this you might use the readline function & store the input strings into an array. Then parse the array strings looking for the desired entry & if found move it to the correct array location. Then write the array out. Kind of defeats the purpose of using an INI file though.
_________________________
Jack

Top
#46462 - 2003-10-09 03:02 AM Re: Edit an ini file
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11634
Loc: Space
Jack,

WTH Dude... give me a hand please. This is the starters forum.

1. What is an array?
2. How do I use one?
3. What is a function?
4. What are strings?
5. How do I intall KiX?

ROFLMAO

Jack... sort of pulling your leg here, but the point is that the answer you gave would be way over someones head if they had NEVER programmed anything in their life and are new to KiXtart as well. Not sure if Gram is that new or not, but this was his first post here. [Big Grin]

Top
#46463 - 2003-10-09 07:06 PM Re: Edit an ini file
Jack Lothian Offline
MM club member
*****

Registered: 1999-10-22
Posts: 1169
Loc: Ottawa,Ontario, Canada
NTDOC,

All good points, but I was visting the board during a short time out from real work & I thought I should try to respond to his request in case he had a real good reason for why he wanted to do this. I kind of assumed he would ask follow up questions if he really wanted to do this & someone else would step forward to help. I get the point though, next time I will try not to be so cryptic in my responses. [Embarrassed]
_________________________
Jack

Top
#46464 - 2003-10-09 07:36 PM Re: Edit an ini file
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11634
Loc: Space
No problem Jack. Hopefully I did not offend you I meant it to be light hearted. [Smile]
Top
#46465 - 2003-10-09 07:59 PM Re: Edit an ini file
Jack Lothian Offline
MM club member
*****

Registered: 1999-10-22
Posts: 1169
Loc: Ottawa,Ontario, Canada
NTDOC,

No offence taken. Your comments where constructive & I took them that way. I also realized they might be intended for a wider audience.

One of my favorite quotes in life is:

quote:
No one is exempt from taking nonsense: the only misfortune is to do it solemnly. -Montaigne
which I interpret to mean that no one should take themselves too seriously. I try not to. [Big Grin]
_________________________
Jack

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 1452 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.066 seconds in which 0.031 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org