/writeini should have been your first line, however i see what you mean, the item [brackets] is changed to ~brackets~ in the inifile, with a value of 123. I would take a guess this is a windows thing.

is a workaround really needed as the $readini using [brackets] does return the correct value?

I suppose for the $ini identifier you could do something like:
Code:
alias correctbrackets {
  if ( $left($ini($1,$2,$3),1) == ~ ) { 
    var %i = $replace($ini($1,$2,$3),~,$chr(91))
    if ( $right(%i,1) == $chr(91) ) {
      var %o = $left(%i,-1) $+ $chr(93)
      return %o
    }
  }
}

/writeini test.ini Test [Brackets] 123
//echo -a $readini(test.ini, test, [Brackets]) == 123
//echo -a $ini(test.ini, test, 1) == ~Brackets~
//echo -a $correctbrackets(test.ini,test,1) == [Brackets]

I know its a bit hackish and I'm sure there's a one line regex that does the same, but it works i guess...

btk




billythekid