| View previous topic :: View next topic |
| Author |
Message |
Rubes_sw Valued Contributor


Joined: 11 Jun 2001 Posts: 625 Location: Northern Ireland
|
Posted: Wed Sep 25, 2002 12:40 pm Post subject: INI Help |
|
|
If I had an *.ini file structed like:
[USER1]
date=
etc=
etc=
[USER2]
date=
etc=
etc=
[USER3]
date=
etc=
etc=
I do find out how many section headings their are, and place them into list, Remebering that the section heading names can change !
Nathan |
|
| Back to top |
|
 |
LiquidCode Moderator Team
Joined: 05 Dec 2000 Posts: 1753 Location: Space and Time
|
Posted: Wed Sep 25, 2002 12:42 pm Post subject: |
|
|
You could load the ini file into a list then check each line
to see if it begins with a [ then just grab what is in between
the []'s. _________________ Chris
Http://theblindhouse.com |
|
| Back to top |
|
 |
Skit3000 Admin Team

Joined: 11 May 2002 Posts: 2166 Location: The Netherlands
|
Posted: Wed Sep 25, 2002 1:56 pm Post subject: |
|
|
Here is an example:
| Code: |
list create,1
rem Cause I didn't saved this script, I used LIST LOADTEXT.
rem Now also people who haven't got/don't want to make an ini-file also a good example...
rem list loadfile,1,inifile.ini
list loadtext,1
"[sdf]
"sdf=sdf
"sddd=sdf
"[sdfd]
"[sdf]
"sdfsdf=sdf
"[sdfsdf]
list seek,1,0
repeat
if @equal(@substr(@item(1,%%var1),1,1),[)
%%sections = %%sections@cr()@substr(@item(1,%%var1),2,@pred(@len(@item(1,%%var1))))
end
%%var1 = @succ(%%var1)
until @equal(%%var1,@count(1))
info This are all the sections:@cr()%%sections
|
|
|
| Back to top |
|
 |
Mac Professional Member

Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Wed Sep 25, 2002 7:31 pm Post subject: |
|
|
Personally, I rarely use VDS INI file access anymore.
It seems easier to load your file into a list (ya can still
name it as an INI file), access/edit the data, then save
the whole file rather than INIFILE WRITE each individual
key change.
Cheers, Mac  _________________ VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
 |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|