From WikiChip
Difference between revisions of "mirc/commands/bcopy"
< mirc‎ | commands

m (Bot: Fixing links)
m (Bot: Fixing links)
Line 50: Line 50:
 
* [[List of commands - mIRC|List of commands]]
 
* [[List of commands - mIRC|List of commands]]
 
* [[List of identifiers - mIRC|List of identifiers]]
 
* [[List of identifiers - mIRC|List of identifiers]]
* [[$bvar identifier - mIRC|$bvar]]
+
* {{mIRC|$bvar}}
 
* {{mIRC|/bread}}
 
* {{mIRC|/bread}}
 
* {{mIRC|/bset}}
 
* {{mIRC|/bset}}

Revision as of 20:19, 5 July 2014

The /bcopy command can be used to copy any amount of bytes from one variable starting at a specific position into a second variable at a specific position. This command supports copying of overlapping buffers.

If the number of bytes to copy is -1, all bytes available will be copied over to the destination variable.

Note: The first byte starts at the position/index 1, 0 is invalid and will procudes an error.

Synopsis

/bcopy [-zc] <&dest_binvar> <des_pos> <&src_binvar> <src_pos> <numBytes>

Switches

  • -z - Bytes copied from the source binary variable gets zero-filled after the copy
  • -c - Truncates the destination variable to a length of <des_pos> + <numBytes>

Parameters

  • <&dest_binvar> - The destination binary variable.
  • <des_pos> - The position to which to copy the byte to.
  • <&src_binvar> - The source binary variable.
  • <src_pos> - The position from which to start copying bytes.
  • <numBytes> - Number of bytes to copy (or -1 for everything).

Example

Alias Example {
  ; Create a binary variable 'example' and assign it some text
  bset -t &example 1 This is a cool test!
 
  ; Copy from 'example' from the 11th byte 10 bytes onward
  ; Zero-fill the part that was copied
  bcopy -z &example2 1 &example 11 10
 
  ; Print out &example's content (up to the first null)
  echo -a $bvar(&example, 1-).text
 
  ; Print out &example2's content
  echo -a $bvar(&example2, 1-).text 
}

The above example will output:

This is a
cool test!

Compatibility

Added: mIRC v5.7

Added On: 02/02/2000

Note: Individual switches were not taken into consideration.

See also

v · d · e mIRC commands list

A /abook, /action, /add, /ajinvite, /alias, /aline, /ame, /amsg, /anick, /aop, /auser, /auto, /autojoin, /avoice, /away

B /background, /ban, /bcopy, /beep, /bindip, /bread, /break, /breplace, /bset, /btrunc, /bunset, /bwrite

C /channel, /clear, /clearall, /clearial, /cline, /clipboard, /close, /closechats, /closedccs, /closefserves, /closemsg, /cnick, /color, /colour, /comclose, /comlist, /commands, /comopen, /comreg, /continue, /copy, /creq, /ctcp, /ctcpreply, /ctcps

D /dcc, /dccserver, /dde, /ddeserver, /debug, /dec, /describe, /dialog, /did, /didtok, /disable, /disconnect, /dlevel, /dline, /dll, Template:mIRC/donotdisturb, /dns, /dqwindow, /drawcopy, /drawdot, /drawfill, /drawline, /drawpic, /drawrect, /drawreplace, /drawrot, /drawsave, /drawscroll, /drawsize /drawtext

E /ebeeps, /echo, /editbox, /else, /elseif, /emailaddr, /enable, /events, /exit

F /fclose, /filter, /findtext, /finger, /firewall, /flash, /flist, /flood, /flush, /flushini, /fnord, /font, /fopen, /fseek, /fsend, /fserve, /fullname, /fupdate, /fwrite

G /ghide, /gload, /gmove, /gopts, /goto, /gplay, /gpoint, /gqreq, /groups, /gshow, /gsize, /gstop, /gtalk, /gunload, /guser

H /hadd, /halt, /haltdef, /hdec, /hdel, /help, /hfree, /hinc, /hload, /hmake, /hotlink, /hop, /hsave

I /ial, /ialclear, /ialmark, /identd, /if, /ignore, /iline, /inc, /iuser

J /join

L /leave, /linesep, /links, /list, /load, /loadbuf, /localinfo, /log, /logview

M /maxdepth, /mdi, /me, /menubar, /mkdir, /mnick, /mode, /msg

N /noop, /notice, /notify

O /onotice, /omsg

P /pareline, /part, /partall, /pdcc, /perform, /play, /playctrl, /pop, /protect, /proxy, /pvoice

Q /qme, /qmsg, /query, /queryrn, /quit, /quote

R /raw, /registration, /reload, /remini, /remote, /remove, /rename, /renwin, /reseterror, /resetidle, /return, /returnex, /rlevel, /rline, /rmdir, /run, /ruser

S /save, /savebuf, /saveini, /say, /scid, /scon, /server, /set, /setlayer, /showmirc, /signal, /sline, /sockaccept, /sockclose, /socklist, /socklisten, /sockmark, /sockopen, /sockpause, /sockread, /sockrename, /sockudp, /sockwrite, /sound, /speak, /splay, /sreq, /strip, /switchbar

T /timer, /timestamp, /tip, /tips, /titlebar, /tnick, /tokenize, /toolbar, /topic /tray, /treebar

U /ulist, /unload, /unset, /unsetall, /updatenl, /url, /username, /uwho

V /var, /vcadd, /vcmd, /vcrem, /vol

W

X /xyzzy