I must read a file ini and insert the lines of a section into a xbrowse table
the problem is when my function create the array to put on xbrowse save one line after another often skip a new record as you can see on this picture :
As you can see it create for each line of xbrowse a string with all entries
On the file INI I have
[Filters]
Per Nome=Upper( FIRST ) = Upper( "frank" )
per test=FIRST = "frank"
test due=Upper( FIRST ) = Upper( "frank" )
testr=Upper( FIRST ) = Upper( "frank" )
testk=Upper( FIRST ) = Upper( "frank" ) .AND. Upper( LAST ) = Upper( "fonseca" )
kl=Upper( FIRST ) = Upper( "frank" ) .AND. Upper( LAST ) = Upper( "fonseca" )
I wanted an array with two field entry and string
the code wrong
Local aFilters:= {}
..
aFilters:=GetIniArray("Filters",cInifile)
FUNCTION GetIniArray(cSection,cFile)
LOCAL nI
LOCAL aString := {}
aEntry := StrTran(GetPVProfString(cSection, , ,cFile), Chr(0), CRLF)
? MlCount(aEntry)
IF EMPTY(aEntry)
return {}
ENDIF
for nI:=1 to LEN(aEntry)
AADD(aString,{aEntry, GetIni( cFile, cSection, aEntry[nI]) })
next
return aString
FUNCTION GetIni( cIni, cSection, cEntry, xDefault )
LOCAL oIni
LOCAL xVar := xDefault
// DEFAULT cIni := oApp:cIniFile
INI oIni FILE cIni
GET xVar ;
SECTION cSection ;
ENTRY cEntry ;
DEFAULT xDefault ;
OF oIni
ENDINI
RETURN xVar