FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour DEL A STRING INI FILE
Posts: 222
Joined: Mon Jun 04, 2012 12:00 PM
DEL A STRING INI FILE
Posted: Sun Aug 26, 2012 08: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
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: DEL A STRING INI FILE
Posted: Sun Aug 26, 2012 09: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



Best Regards
Uwe :-)
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.
Posts: 222
Joined: Mon Jun 04, 2012 12:00 PM
Re: DEL A STRING INI FILE
Posted: 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 ?
Posts: 1074
Joined: Fri Oct 07, 2005 01:56 PM
Re: DEL A STRING INI FILE
Posted: Tue Aug 28, 2012 02:12 PM
Hola

Prueba de esta manera..


Code (fw): Select all Collapse
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
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: DEL A STRING INI FILE
Posted: Tue Aug 28, 2012 06: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



Best Regards
Uwe :-)
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.

Continue the discussion