Read all section names of ini file?
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by cor.
How to read all section names of ini file into listview gadget.
Searched forum and resource site, but only reading single sections names found.
There must be a way!!
Using Windows 98 SE
Registered PB version : 3.2 (Windows)
--------------------------
C. de Visser
Author of Super Guitar Chord Finder
http://www.ready4music.com
How to read all section names of ini file into listview gadget.
Searched forum and resource site, but only reading single sections names found.
There must be a way!!
Using Windows 98 SE
Registered PB version : 3.2 (Windows)
--------------------------
C. de Visser
Author of Super Guitar Chord Finder
http://www.ready4music.com
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by PB.
> How to read all section names of ini file into listview gadget.
Just read the ini file and extract the section names? Try this:
PB - Registered PureBasic Coder
> How to read all section names of ini file into listview gadget.
Just read the ini file and extract the section names? Try this:
Code: Select all
If OpenWindow(0,100,150,400,400,#PB_Window_SystemMenu,"Test")
CreateGadgetList(WindowID())
ListViewGadget(0,50,50,300,300)
If ReadFile(0,"INIFile.ini")
Repeat
a$=ReadString()
If Left(a$,1)="[" ; Section name found!
a$=Left(a$,Len(a$)-1) ; Trim trailing bracket.
AddGadgetItem(0,-1,Mid(a$,2,999)) ; Add to list.
EndIf
Until Eof(0)0
CloseFile(0)
EndIf
Repeat
ev=WaitWindowEvent()
Until ev=#PB_EventCloseWindow
EndIf
PB - Registered PureBasic Coder
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by cor.
Thanks PB,
It's working, it was not coming in my mind to it this way.
btw.
at:
http://www.purebasic.com/beta
there is a new clipboard lib.
Seems to work , just tested. (win98se)
Using Windows 98 SE
Registered PB version : 3.2 (Windows)
--------------------------
C. de Visser
Author of Super Guitar Chord Finder
http://www.ready4music.com
Thanks PB,
It's working, it was not coming in my mind to it this way.
btw.
at:
http://www.purebasic.com/beta
there is a new clipboard lib.
Seems to work , just tested. (win98se)
Using Windows 98 SE
Registered PB version : 3.2 (Windows)
--------------------------
C. de Visser
Author of Super Guitar Chord Finder
http://www.ready4music.com
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by PB.
> it was not coming in my mind to it this way.
It's probably not the "correct" way to extract section names, but it does the
job!
BTW, what happened to your site? "HTTP 404 - File not found"...
PB - Registered PureBasic Coder
Edited by - PB on 18 August 2002 15:14:59
> it was not coming in my mind to it this way.
It's probably not the "correct" way to extract section names, but it does the
job!
BTW, what happened to your site? "HTTP 404 - File not found"...
PB - Registered PureBasic Coder
Edited by - PB on 18 August 2002 15:14:59
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by cor.
I´am not on my home place.
So it will be late for testing
Site:
There are some problems with my provider.
Now I switched to another but the site is online in the mid of next week they promised.
Registered PB version : 3.2 (Windows)
--------------------------
C. de Visser
Author of Super Guitar Chord Finder
http://www.ready4music.com
I´am not on my home place.
So it will be late for testing
Site:
There are some problems with my provider.
Now I switched to another but the site is online in the mid of next week they promised.
Using Windows 98 SEBTW, what happened to your site? "HTTP 404 - File not found"...
PB - Registered PureBasic Coder
Edited by - PB on 18 August 2002 15:14:59
Registered PB version : 3.2 (Windows)
--------------------------
C. de Visser
Author of Super Guitar Chord Finder
http://www.ready4music.com
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by Franco.
Regarding INI files:
Has anybody tested handling INI files >64Kb with PureBasic's build-in commands?
I read once that the Windows API-Commands handle only files <64Kb.
So if Fred uses Win-API it will have the same effect...
This would be really bad for things like contact list etc.
Have a nice day...
Franco
Sometimes you have to go a lonely way to accomplish genius things.
Edited by - franco on 18 August 2002 18:34:49
Regarding INI files:
Has anybody tested handling INI files >64Kb with PureBasic's build-in commands?
I read once that the Windows API-Commands handle only files <64Kb.
So if Fred uses Win-API it will have the same effect...
This would be really bad for things like contact list etc.
Have a nice day...
Franco
Sometimes you have to go a lonely way to accomplish genius things.
Edited by - franco on 18 August 2002 18:34:49
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by PB.
> Has anybody tested handling INI files >64Kb with PureBasic's build-in commands?
> I read once that the Windows API-Commands handle only files So if Fred uses Win-API it will have the same effect...
According to the Win32hlp file:
Windows 95: The specified profile section must not exceed 32K.
Windows NT: The specified profile section has no size limit.
I guess only Fred can answer whether he used the API or not... but the
Preferences() library is also for Linux, so perhaps he wrote custom code
instead of using the API.
PB - Registered PureBasic Coder
> Has anybody tested handling INI files >64Kb with PureBasic's build-in commands?
> I read once that the Windows API-Commands handle only files So if Fred uses Win-API it will have the same effect...
According to the Win32hlp file:
Windows 95: The specified profile section must not exceed 32K.
Windows NT: The specified profile section has no size limit.
I guess only Fred can answer whether he used the API or not... but the
Preferences() library is also for Linux, so perhaps he wrote custom code
instead of using the API.
PB - Registered PureBasic Coder
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by cor.
PB,
Same problem with new version.
Using Windows 98 SE
Registered PB version : 3.2 (Windows)
--------------------------
C. de Visser
Author of Super Guitar Chord Finder
http://www.ready4music.com
PB,
Same problem with new version.
Using Windows 98 SE
Registered PB version : 3.2 (Windows)
--------------------------
C. de Visser
Author of Super Guitar Chord Finder
http://www.ready4music.com
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by cor.
From Fred asked from me
quote:
--------------------------------------------------------------------------------
What is the maximum limit of the file size which can be read, write to a preference file?
--------------------------------------------------------------------------------
No limits. It's autmoatically adjusted.
Cor
Registered PB version : 3.2 (Windows)
--------------------------
C. de Visser
Author of Super Guitar Chord Finder
http://www.ready4music.com
From Fred asked from me
quote:
--------------------------------------------------------------------------------
What is the maximum limit of the file size which can be read, write to a preference file?
--------------------------------------------------------------------------------
No limits. It's autmoatically adjusted.
Cor
Using Windows 98 SERegarding INI files:
Has anybody tested handling INI files >64Kb with PureBasic's build-in commands?
I read once that the Windows API-Commands handle only files <64Kb.
So if Fred uses Win-API it will have the same effect...
This would be really bad for things like contact list etc.
Have a nice day...
Franco
Sometimes you have to go a lonely way to accomplish genius things.
Edited by - franco on 18 August 2002 18:34:49
Registered PB version : 3.2 (Windows)
--------------------------
C. de Visser
Author of Super Guitar Chord Finder
http://www.ready4music.com
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm