Re: Command "Ini DELETE" not working

"[email protected]" <[email protected]> Wed, 01 Feb 2012 20:08:39 -0000
Newsgroups gmane.comp.windows.gui4cli
Message-ID <[email protected]>
I tried something but it does not change the file...

Unless somebody knows how to use it you can try something like this:

xlistview 10 10 10 10 "ini" "" ""
  id lv_ini
  attr show hide


xRoutine IniDeleteSection filename sectionname
  local found/line

  Use LV #this lv_ini
  lv load "$filename"
  found = 1
  lvsearch "[$sectionname]" first lines

  while $$lv.valid=1
  and $found=1
    lv delete current
    lv goto next
    line = $$lv.full
    if $line[0][1] = "["
      found = 0  // found new start of section, break
    endif
  endwhile

  lv save "$filename"
// lv clear



call it like this:
  gosub #this IniDeleteSection initest.ini mysection

Test it for yourself, i made this quick and is not fully tested!



--- In [email protected], "peejayay" <thepauladams@...> wrote:
>
> Hi, I am trying to remove some ini file entries using the "Ini DELETE" command, but it just does not seem to work.
> 
> Nothing happens at all when calling this command. If I mistype an entry, it comes up with an error message that the section cannot be found, so the command is definitely reading the file and checking that the sections exist, but then it does not delete anything and the file timestamp is left alone.
> 
> I am running on Windows XP Professional.
> 
> Any ideas?
> 
> peejayay
>




------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/gui4cli/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/gui4cli/join
    (Yahoo! ID required)

<*> To change settings via email:
    [email protected] 
    [email protected]

<*> To unsubscribe from this group, send an email to:
    [email protected]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/