Page 1 of 1

Posted: Sun Aug 18, 2002 11:45 am
by BackupUser
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

Posted: Sun Aug 18, 2002 12:04 pm
by BackupUser
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:

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

Posted: Sun Aug 18, 2002 12:43 pm
by BackupUser
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

Posted: Sun Aug 18, 2002 2:07 pm
by BackupUser
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

Posted: Sun Aug 18, 2002 2:32 pm
by BackupUser
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.

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
Using Windows 98 SE
Registered PB version : 3.2 (Windows)
--------------------------
C. de Visser
Author of Super Guitar Chord Finder
http://www.ready4music.com

Posted: Sun Aug 18, 2002 2:35 pm
by BackupUser
Restored from previous forum. Originally posted by PB.

> I´am not on my home place.
> So it will be late for testing

No problem... just whenever you can.

> Site: There are some problems with my provider.

I hate when that happens!


PB - Registered PureBasic Coder

Posted: Sun Aug 18, 2002 5:31 pm
by BackupUser
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

Posted: Sun Aug 18, 2002 6:07 pm
by BackupUser
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

Posted: Sun Aug 18, 2002 9:18 pm
by BackupUser
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

Posted: Sun Aug 18, 2002 10:16 pm
by BackupUser
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
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
Using Windows 98 SE
Registered PB version : 3.2 (Windows)
--------------------------
C. de Visser
Author of Super Guitar Chord Finder
http://www.ready4music.com

Posted: Mon Aug 19, 2002 1:14 am
by BackupUser
Restored from previous forum. Originally posted by Franco.

Thanks for the answers...

Have a nice day...
Franco

Sometimes you have to go a lonely way to accomplish genius things.