ini file - function to get all key-value for a section

ini file - function to get all key-value for a section

Postby hua » Thu Nov 10, 2022 10:50 am

What is the function to retrieve all pair of keys and values under a specific section?
Is it this? https://learn.microsoft.com/en-us/windo ... ilesection

TIA
FWH 11.08/FWH 19.12
BCC5.82/BCC7.3
xHarbour/Harbour
hua
 
Posts: 1072
Joined: Fri Oct 28, 2005 2:27 am

Re: ini file - function to get all key-value for a section

Postby Enrico Maria Giordano » Thu Nov 10, 2022 1:56 pm

This returns all the keys of a section:

Code: Select all  Expand view
FUNCTION GETPVPROFSECTION( cSection, cIniFile )

    LOCAL cKeys := STRTRAN( GETPVPROFSTRING( cSection, , "", cIniFile ), CHR( 0 ), CRLF )

    LOCAL aKeys := {}

    LOCAL i

    FOR i = 1 TO MLCOUNT( cKeys )
        AADD( aKeys, RTRIM( MEMOLINE( cKeys, , i ) ) )
    NEXT

    RETURN aKeys
User avatar
Enrico Maria Giordano
 
Posts: 8710
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: ini file - function to get all key-value for a section

Postby hua » Fri Nov 11, 2022 1:58 am

Thank you very much Enrico
FWH 11.08/FWH 19.12
BCC5.82/BCC7.3
xHarbour/Harbour
hua
 
Posts: 1072
Joined: Fri Oct 28, 2005 2:27 am


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 72 guests