mIRC Homepage
Posted By: Smity need space between filesize !! - 21/04/04 06:16 PM
hello all

I`m trying to create something but i want to use a space between the size and the outcome (222 MB)

I used this command:
$bytes($file($fs.read(fireserv,%xtemp)).size,bgmgt3).suf
but the result is 222MB (no space)
I dont get it to work.. can somebody help me please to fix this.
thx.
Posted By: BlueKai Re: need space between filesize !! - 21/04/04 06:26 PM
Isn't a force space something like this:

$+ $chr(160)
Posted By: Mentality Re: need space between filesize !! - 21/04/04 06:33 PM
$chr(32) is the character for a space.

Regards,
Posted By: Smity Re: need space between filesize !! - 21/04/04 07:12 PM
i know chr(160) is for space.. but how to use it in the command line.
$bytes($file($fs.read(fireserv,%xtemp)).size,bgmgt3).suf
because i get a 3 digit number with a suf of the filesize like MB
i dont know where to put the space.
Posted By: starbucks_mafia Re: need space between filesize !! - 21/04/04 07:19 PM
Put this in your remotes (Alt+R):
Code:
alias bytes2 {
  var %r
  !.echo -q $regsub(bytes2,$bytes($iif($1,$1,0) [ $iif($2 != $null,$chr(44) $2,$chr(32)) ] ).suf,/([a-z])/i,$+($chr(32),\1),%r)
  return %r
}


Then just use $bytes2($file($fs.read(fireserv,%xtemp)).size, 3)
Posted By: Smity Re: need space between filesize !! - 21/04/04 07:34 PM
sorry,

Invalid format: $regsub

Posted By: Smity Re: need space between filesize !! - 21/04/04 07:37 PM
oeps ... it worked... thx m8`
and i worked on for 4 days frown
this is cool.
thx all for reply
© mIRC Discussion Forums