can see how many line there are for a topic ?
sample
[DATA]
1=bla bla
2=bla bla
3=bla ble
4=bla bla
5=bla bla
But I not Know if there are 5 lines or 4 lines . Can I see it ?
//----------------------------------------------------------------------------------
FUNCTION SetConnection() //########### FOR DATABASE CONNECTION FROM INI ###############
//-----------------------------------------------------------------------------------
lOCAL cIniFile :="Ini\INIDBConnection.INI"
if !File(cIniFile)
MsgBox("Connection File Does Not Exist")
RETURN .F.
END IF
oApp:cDbServerIP:=AllTrim(GETPVPROFSTRING( "DATABASECONNECTION","ServerName" , "", cIniFile))
oApp:cDbName :=Alltrim(GETPVPROFSTRING( "DATABASECONNECTION","DBName" , "", cIniFile ))
oApp:cDbUser :="root"
oApp:cDbPassword:=Alltrim(GETPVPROFSTRING( "DATABASECONNECTION","DBPassword" , "", cIniFile ))
oApp:cDbPort :=Alltrim(GETPVPROFSTRING( "DATABASECONNECTION","PortAddress" , "", cIniFile ))
oApp:cDriver :=Alltrim(GETPVPROFSTRING( "DATABASECONNECTION","DriverName" , "", cIniFile ))
oApp:cConnectSring:=oApp:cDriver+";"+"Server="+oApp:cDbServerIP+";"+"Port="+oApp:cDbPort+ ;
";"+"Database="+oApp:cDbName+";"+"User="+oApp:cDbUser+";"+ ;
"Password="+oApp:cDbPassword+";"+"Option=3;"
oApp:oConnection:=CreateObject("ADODB.Connection")
oApp:oConnection:ConnectionString:=oApp:cConnectSring
CursorWait()
TRY
oApp:oConnection:Open()
CATCH oError
MsgBox("Failed to Open connection")
RETURN .F.
END
CursorArrow()
oError:=NIL
RETURN .T.
[DATABASECONNECTION]
DBName="payroll"
ServerName="195.168.0.999"
DriverName="Driver={MySQL ODBC 5.1 Driver}"
PortAddress="3306"
DBUser="root"
DBPassword="1234"
FUNCTION GetIniArray(cSection,cFile) // reads a complete section from a *.ini file into an array
LOCAL nI
LOCAL aString := {}
aEntry := GetPvProfA(cSection,NIL, "", cFile)
IF EMPTY(aEntry)
return {}
ENDIF
for nI:=1 to LEN(aEntry)
AADD(aString,GetPvProfString(cSection,aEntry[nI],"",cFile))
next
return aString
Silvio wrote:I made :
Function test()
Local cNSys:="TEST"
Local INI:=cIniFile := cFilePath( GetModuleFileName( GetInstance() ) ) + cNSys+".ini"
Local cEntries := StrTran(GetPvProfString(cNSys,"AREAS","", cIniFile) , Chr(0), CRLF)
?MlCount(cEntries)
return nil
this test retun 0 but there are 6 lines on test.ini
Test.ini
[AREAS]
1=WFL.T01
2=WFL.T02
3=WFL.T03
4=WFL.T06
5=WFL.T04
6=WFL.T05
Any Idea?
Silvio wrote:Gilbert,
where I can load the function GETPVPROFA ?
Error: Unresolved external '_HB_FUN_GETPVPROFA' referenced from C:\WORK\ERRORI\TEST_INI\OBJ\TEST.OBJ
HB_FUNC( GETPVPROFA )
{
CHAR bBuffer[ 2048 ];
WORD wLen;
WORD anzahl;
WORD pos,i;
wLen = GetPrivateProfileString( hb_parc( 1 ), // Section
NULL, // Entry
hb_parc( 3 ), // Default
bBuffer, // Destination Buffer
sizeof( bBuffer ) - 1, // M x Len
hb_parc( 4 ) ); // INI File
anzahl=0;
for(pos=0;pos<wLen;pos++)
{
if(bBuffer[pos]==0)
{
anzahl++;
if(bBuffer[pos+1]==0) break;
}
}
if(anzahl==0) hb_ret();
hb_reta(anzahl);
pos=0;
for(i=0;i<anzahl;i++)
{
hb_storc(bBuffer+pos, -1, i+1 ); // hb_storc, umgestellt auf fwh1502
while(pos<wLen && bBuffer[pos]!=0) pos++;
pos++;
}
}
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 64 guests