Problem to read file Ini and Xbrowse

Problem to read file Ini and Xbrowse

Postby Eoeo » Sun Sep 16, 2012 3:42 pm

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 :

Image


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
User avatar
Eoeo
 
Posts: 222
Joined: Mon Jun 04, 2012 12:00 pm

Re: Problem to read file Ini and Xbrowse

Postby Eoeo » Mon Sep 17, 2012 2:05 pm

Any solution ?
User avatar
Eoeo
 
Posts: 222
Joined: Mon Jun 04, 2012 12:00 pm

Re: Problem to read file Ini and Xbrowse

Postby Eoeo » Wed Sep 19, 2012 8:43 am

Mr Nages can you help me please ?
User avatar
Eoeo
 
Posts: 222
Joined: Mon Jun 04, 2012 12:00 pm


Return to FiveWin for Harbour/xHarbour

Who is online

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