AnsweredAssumed Answered

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

Question asked by VRFuser on Aug 30, 2006

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: ) =============================================

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


To subscribe please send an email to: "" with the word subscribe in the message body.
To unsubscribe send a blank email to "".
To send messages to this mailing list,  email "". 
If you need help with the mailing list send a message to "".
Search the "unofficial vrf archive" at "".