Hello,
I wanted to count the Entries < System > from File < Settings.ini >
I could count the Textlines, but why it doesn't work ?
I tested from INI-file < SETTINGS.INI >
Section < System > :
[System]
cField_1=Object1,Value 1
cField_2=Object2,Value 2
cField_3=Object3,Value 3
The working Sample ( counts Devices from Windows ) :
Best Regards
Uwe
I wanted to count the Entries < System > from File < Settings.ini >
I could count the Textlines, but why it doesn't work ?
I tested from INI-file < SETTINGS.INI >
Section < System > :
[System]
cField_1=Object1,Value 1
cField_2=Object2,Value 2
cField_3=Object3,Value 3
FUNCTION READ_INI()
Local oInifile, nEntries := 1, cEntries := ""
INI oInifile FILE c_path + "\SETTINGS.INI"
  cEntries := StrTran( GetProfString( "System" ), Chr( 0 ), CRLF )
  FOR nEntries = 1 to MlCount( cEntries ) // doesn't count = ZERO
    MsgInfo( GetProfString( "System", MemoLine( cEntries,, nEntries ) ),;
        MemoLine( cEntries,, nEntries ) ) Â
  NEXT
ENDINI
RETURN NILThe working Sample ( counts Devices from Windows ) :
function Main()
local cEntries := StrTran( GetProfString( "Devices" ), Chr( 0 ), CRLF )
local n
for n = 1 to MlCount( cEntries )
MsgInfo( GetProfString( "Devices", MemoLine( cEntries,, n ) ),;
MemoLine( cEntries,, n ) )
next
return nilBest Regards
Uwe
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
i work with FW.
If you have any questions about special functions, maybe i can help.