forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


INI Help

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
Rubes_sw
Valued Contributor
Valued Contributor


Joined: 11 Jun 2001
Posts: 625
Location: Northern Ireland

PostPosted: Wed Sep 25, 2002 12:40 pm    Post subject: INI Help Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
LiquidCode
Moderator Team


Joined: 05 Dec 2000
Posts: 1753
Location: Space and Time

PostPosted: Wed Sep 25, 2002 12:42 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Wed Sep 25, 2002 1:56 pm    Post subject: Reply with quote

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
View user's profile Send private message
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Wed Sep 25, 2002 7:31 pm    Post subject: Reply with quote

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 Smile

_________________
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
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
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

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group