AnsweredAssumed Answered

vrf How can I delete a Key from an INI.file ???

Question asked by VRFuser on Aug 30, 2006
Hi VRF

How can I delete a Key (or section) from an INI-File, by using the Get/WritePrivateProfileStringA functions from Kernel32?
I have attached an example I made (INI-file.vee).

I found this VisualBasic example on the internet, which explains how to do it:
=============================================
Private Sub ProfileDeleteItem(sSection As String, sKeyName As String, sIniFile As String)
  'this call will remove the keyname and its
  'corresponding value from the section sepcified
  'in sSection. This is accomplished by passing
  'vbNullString as the sValue parameter. For example,
  'assuming that an ini file had:
  ' [Colours]
  '  Colour1=Red
  '  Colour2=Blue
  '  Colour3=Green
  '
  'and this sub was called passing "Colour2"
  'as sKeyName, the resulting ini file
  'would contain:
  ' [Colours]
  '  Colour1=Red
  '  Colour3=Green
  
   Call WritePrivateProfileString(sSection, _
                                  sKeyName, _
                                  vbNullString, _
                                  sIniFile) End Sub (see entire link here:
http://vbnet.mvps.org/index.html?code/file/pprofilebasic.htm ) =============================================


I just can't make this happen in VEE!?!? How can I make a "vbNullString"? Someone must have done this before..... HELP!

Regards,
Alex

---
To subscribe please send an email to: "vrf-request@lists.it.agilent.com" with the word subscribe in the message body.
To unsubscribe send a blank email to "leave-vrf@it.lists.it.agilent.com".
To send messages to this mailing list,  email "vrf@agilent.com". 
If you need help with the mailing list send a message to "owner-vrf@it.lists.it.agilent.com".
Search the "unofficial vrf archive" at "www.oswegosw.com/vrf_archive/".

Outcomes