From WikiChip
Editing mirc/commands/bcopy
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
This page supports semantic in-text annotations (e.g. "[[Is specified as::World Heritage Site]]") to build structured and queryable content provided by Semantic MediaWiki. For a comprehensive description on how to use annotations or the #ask parser function, please have a look at the getting started, in-text annotation, or inline queries help pages.
Latest revision | Your text | ||
Line 1: | Line 1: | ||
− | + | 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. | |
− | The '''/bcopy''' | ||
− | If the number of bytes to copy is -1, all bytes available will be copied over to the destination variable | + | If the number of bytes to copy is -1, all bytes available will be copied over to the destination variable. |
− | |||
− | |||
== Synopsis == | == Synopsis == | ||
− | /bcopy [-zc] <&dest_binvar> < | + | /bcopy [-zc] <&dest_binvar> <des_pos> <&src_binvar> <src_pos> <numBytes> |
== Switches == | == Switches == | ||
− | * '''-z''' - Bytes | + | * '''-z''' - Bytes copied from the source binary variable gets zero-filled after the copy |
− | * '''-c''' - Truncates the destination variable to | + | * '''-c''' - Truncates the destination variable to a length of <des_pos> + <numBytes> |
== Parameters == | == 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_binvar>''' - The source binary variable. | ||
* '''<src_pos>''' - The position from which to start copying bytes. | * '''<src_pos>''' - The position from which to start copying bytes. | ||
− | * '''<numBytes>''' - Number of bytes to copy | + | * '''<numBytes>''' - Number of bytes to copy (or -1 for everything). |
== Example == | == Example == | ||
Line 25: | Line 22: | ||
bset -t &example 1 This is a cool test! | bset -t &example 1 This is a cool test! | ||
− | ; Copy from ' | + | ; Copy from 'example' from the 11th byte 10 bytes onward |
− | ; Zero- | + | ; Zero-fill the part that was copied |
− | bcopy -z &example2 1 &example 11 | + | bcopy -z &example2 1 &example 11 10 |
; Print out &example's content (up to the first null) | ; Print out &example's content (up to the first null) | ||
echo -a $bvar(&example, 1-).text | echo -a $bvar(&example, 1-).text | ||
− | |||
− | |||
; Print out &example2's content | ; Print out &example2's content | ||
− | echo -a $bvar(&example2, 1-).text | + | echo -a $bvar(&example2, 1-).text |
}</syntaxhighlight> | }</syntaxhighlight> | ||
Line 41: | Line 36: | ||
<pre>This is a | <pre>This is a | ||
− | |||
cool test!</pre> | cool test!</pre> | ||
− | + | == Compatibility == | |
− | + | Added: mIRC v5.7 | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | Added On: 02/02/2000 | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | <small>Note: Individual switches were not taken into consideration.</small> | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | < | ||
− | |||
− | |||
− | < | ||
− | / | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
== See also == | == See also == | ||
* [[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]] |
− | + | * [[/bread command - mIRC|/bread]] | |
− | * | + | * [[/bset command - mIRC|/bset]] |
− | * | + | * [[/btrunc command - mIRC|/btrunc]] |
− | + | * [[/bunset command - mIRC|/bunset]] | |
− | * | + | * [[/bwrite command - mIRC|/bwrite]] |
− | * | ||
− | * | ||
− | |||
− | |||
− | [[Category:mIRC commands | + | [[Category:mIRC commands]] |