mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Apr 2004
Posts: 4
S
Smity Offline OP
Self-satisified door
OP Offline
Self-satisified door
S
Joined: Apr 2004
Posts: 4
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.

Joined: Apr 2004
Posts: 4
B
Self-satisified door
Offline
Self-satisified door
B
Joined: Apr 2004
Posts: 4
Isn't a force space something like this:

$+ $chr(160)

Joined: Jun 2003
Posts: 5,024
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Jun 2003
Posts: 5,024
$chr(32) is the character for a space.

Regards,


Mentality/Chris
Joined: Apr 2004
Posts: 4
S
Smity Offline OP
Self-satisified door
OP Offline
Self-satisified door
S
Joined: Apr 2004
Posts: 4
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.

Joined: Dec 2002
Posts: 2,962
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,962
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)


Spelling mistakes, grammatical errors, and stupid comments are intentional.
Joined: Apr 2004
Posts: 4
S
Smity Offline OP
Self-satisified door
OP Offline
Self-satisified door
S
Joined: Apr 2004
Posts: 4
sorry,

Invalid format: $regsub


Joined: Apr 2004
Posts: 4
S
Smity Offline OP
Self-satisified door
OP Offline
Self-satisified door
S
Joined: Apr 2004
Posts: 4
oeps ... it worked... thx m8`
and i worked on for 4 days frown
this is cool.
thx all for reply


Link Copied to Clipboard