I wonder why the first example you come up with is that fancy $regsubex-"loop". It appears to me that Borg8401 is just starting to learn about loops in general... Why complicate the task with "advanced" but dispensable commands? *rollseyes*

It's like throwing a way-out
Code:
alias binaryexample {
  bread words.txt 0 $file(words.txt).size &words
  breplace &words 13 44 10 32
  ECHO -a $bvar(&words,1,$bvar(&words,0)).text
}
instead of a good ol'
Code:
alias whileexample {
  ; a while-loop to $read all lines of "words.txt", adding the results to a variable "%string" each, separated by commas
  var %n = 1, %string
  while ($read(words.txt,n,%n) != $null) {
    var %string = $addtok(%string,$v1,44)
    inc %n
  }
  ; for the desired output, replace all the commas in %string with "comma-and-space"   
  ECHO -a $replace(%string,$chr(44),$+($chr(44),$chr(32)))
}

Last edited by Horstl; 30/03/10 01:00 AM.