DEL A STRING INI FILE

DEL A STRING INI FILE

Postby Eoeo » Sun Aug 26, 2012 8:21 pm

how I can del a entry from ini file ?

for a sample :

I wish erase the BOLD line

[Cars]
Opel=4569390202
Daihatsu=48838929292
Ford=38329494949
Ferrari=2828394949
Lamborghini=33459594020
User avatar
Eoeo
 
Posts: 222
Joined: Mon Jun 04, 2012 12:00 pm

Re: DEL A STRING INI FILE

Postby ukoenig » Sun Aug 26, 2012 9:58 pm

Silvio,

just delete the Position from the Browser,
delete the INI and rebuild from the Browser-array.
The Button < Save > creates a new INI-file from the Browser
< New > appends a new Record at the Browser-End
< Insert > above the selected Row

some Buttons added :

Download :
http://www.pflegeplus.com/fw_download/xbrwArray2.zip

Image

Best Regards
Uwe :lol:
Last edited by ukoenig on Tue Aug 28, 2012 6:38 pm, edited 1 time in total.
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: DEL A STRING INI FILE

Postby Eoeo » Sun Aug 26, 2012 10:14 pm

Good I understood

it is not possible I can erase and save a new file

Another
at init I have a problem

If the file INI have another sections and not HAve the section [Cars] the procedure to count entries not work

I saw you insert a new value But I cannot make as you made


but I made on another mode :

Local cSection:= "Cars"

aEntry := StrTran(GetPVProfString(cSection, , ,cInifile), Chr(0), CRLF)
IF EMPTY(aEntry)
return {}
ENDIF


// Found the Entries
for nI:=1 to LEN(aEntry)
AADD(aString, MemoLine( aEntry,, nI ) )
next


//string
for nI:=1 to LEN(aEntry)
AAdd( aEntries, GetIni( cInifile, cSection, aString[nI]) )

next

// create the array for the xbrowse entries|strings

for nI:=1 to LEN(aEntry)
AAdd( aCars,{aString[nI],aEntries[nI]})
next


@ 30, 10 XBROWSE oLbx OF oDlg ;
SIZE 185,100 PIXEL

oLbx:SetArray(aCars)




IF I not have entries it not run !!

how I canmake to resolve it ?
User avatar
Eoeo
 
Posts: 222
Joined: Mon Jun 04, 2012 12:00 pm

Re: DEL A STRING INI FILE

Postby Patricio Avalos Aguirre » Tue Aug 28, 2012 2:12 pm

Hola

Prueba de esta manera..


Code: Select all  Expand view
DelIniEntry( "Cars", "Ford", ".\file.ini" )
Saludos
Patricio

__________________________________________________________________
Version: Harbour 3.2.0dev (r1307082134),Compiler: Borland C++ 5.8.2 (32-bit)
PCode version: 0.3, FWH 13.2
http://www.sialm.cl
User avatar
Patricio Avalos Aguirre
 
Posts: 1060
Joined: Fri Oct 07, 2005 1:56 pm
Location: La Serena, Chile

Re: DEL A STRING INI FILE

Postby ukoenig » Tue Aug 28, 2012 6:33 pm

I added 2 new Functions
1. Delete Section from INI
2. Delete Position from INI

now it is possible to add / delete a Section to / from a INI where another Section exists

[System]
Brush1=Wall.bmp
Brush2=Stone.bmp

[Cars]
cField_1=Opel,Value 1
cField_2=Nissan,Value 2


Download ( Rel. 3.1 ):
http://www.pflegeplus.com/fw_download/xbrwArray3.zip

Image

Best Regards
Uwe :lol:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany


Return to FiveWin for Harbour/xHarbour

Who is online

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