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
- Code: Select all Expand view
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 NIL
The working Sample ( counts Devices from Windows ) :
- Code: Select all Expand view
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 nil
Best Regards
Uwe