FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Problem to read file Ini and Xbrowse
Posts: 222
Joined: Mon Jun 04, 2012 12:00 PM
Problem to read file Ini and Xbrowse
Posted: Sun Sep 16, 2012 03: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 :




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
Posts: 222
Joined: Mon Jun 04, 2012 12:00 PM
Re: Problem to read file Ini and Xbrowse
Posted: Mon Sep 17, 2012 02:05 PM

Any solution ?

Posts: 222
Joined: Mon Jun 04, 2012 12:00 PM
Re: Problem to read file Ini and Xbrowse
Posted: Wed Sep 19, 2012 08:43 AM

Mr Nages can you help me please ?

Continue the discussion