mIRC Homepage

making spaces stay

Posted By: andymps

making spaces stay - 06/09/03 10:48 PM

my script reads from the log, but some things have more than on space like some have alot of spaces to make the numbers line up with the correct bit at the top, now how do it stop it from getting rid of the spaces? confused
Posted By: pheonix

Re: making spaces stay - 06/09/03 10:50 PM

try: $replace($read(yourfile),$chr(32),$chr(160))
Posted By: Raccoon

Re: making spaces stay - 06/09/03 10:53 PM

You've been on these forums long enough to know how, why and where mIRC strips spaces... and have seen 2 dozen threads dedicated to various work-arounds.

To be brief, there are few circomstances where you can display lines with multiple spaces.

/play and /loadbuf can echo lines with many spaces, from a file.
You can sometimes $replace spaces with $chr(160)
&binvars can manipulate strings that have sequences of spaces in them.

- Raccoon
Posted By: andymps

Re: making spaces stay - 06/09/03 11:02 PM

well i did this:
Code:
alias run1 {
  /.set %log %logpath $+ renlog_ $+ $date(m-d-yyyy) $+ .txt
  if ($read(%log, 1)) {
    if (*load* !iswm $read(%log ,1)) && (*loading* !iswm $read(%log ,1)) {
      /.notice $me [color:red]$replace($read(%log, 1),$chr(32),$chr(160)))[/color] | /.write FDS_Log_ $+ $date(m-d-yyyy) $+ .txt $read(%log , 1) | /.write -dl1 %log
    }
    else {
      if (*loading* !iswm $read(%log ,1)) {
        .write -dl1 %log
      }
      else {
        if (*loading* iswm $read(%log ,1)) {
          /.notice $me [color:red]$replace($read(%log, 1),$chr(32),$chr(160)))[/color] | /.write FDS_Log_ $+ $date(m-d-yyyy) $+ .txt $read(%log , 1) | /.write -dl1 %log
        }
      }
    }
  }
}

but it doesnt work and i cant see why
© 2021 mIRC Discussion Forums