From WikiChip
Editing mirc/commands/bset

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 7: Line 7:
 
  /bset  [-c] <&bvar> <pos> <asciivalue> [asciivalue ... asciivalue]
 
  /bset  [-c] <&bvar> <pos> <asciivalue> [asciivalue ... asciivalue]
 
  /bset -t[ac] <&bvar> <pos> <string>
 
  /bset -t[ac] <&bvar> <pos> <string>
/bset -z    <&bvar>
 
  
 
== Switches ==
 
== Switches ==
Line 13: Line 12:
 
* '''-a''' - When used along with -t switch, don't apply UTF-8 encoding to characters in the range 0-255, as long as the string parameter contains no characters > 255.
 
* '''-a''' - When used along with -t switch, don't apply UTF-8 encoding to characters in the range 0-255, as long as the string parameter contains no characters > 255.
 
* '''-c''' - Fills the binary variable with the string/ASCII values and truncates anything after it
 
* '''-c''' - Fills the binary variable with the string/ASCII values and truncates anything after it
* '''-z''' - Creates new or truncates existing &binvar at zero length
 
  
 
== Parameters ==
 
== Parameters ==
Line 110: Line 108:
 
   echo -a variable length is $bvar(&var,0)
 
   echo -a variable length is $bvar(&var,0)
 
}</syntaxhighlight>
 
}</syntaxhighlight>
 
Prior to 7.69, zero length &binvar had to be created with kludge workarounds like:<br>
 
noop $regsubex(foo,$null,,,&var)<br>
 
//bset -t &var 1 A | noop $decode(&var,bm)<br>
 
 
<source lang="mIRC">
 
;create zero length &binvar:
 
//bset -z &var | echo -a $bvar(&var) : $bvar(&var,0)
 
</source>
 
  
 
Because bset is a /command instead of $identifier, it cannot directly write leading/trailing/multiple spaces within variable strings into a binary variable. To accomplish this, you must do it indirectly. This alias shows 3 ways of trying to set a variable containing spaces. The red line shows that using /bset to set a string removes leading/trailing/multiple spaces. The green line shows how to preserve the spaces by adding the bytes of the string 1 at a time. The maroon line shows a much faster way to place long text strings into the binary variable.
 
Because bset is a /command instead of $identifier, it cannot directly write leading/trailing/multiple spaces within variable strings into a binary variable. To accomplish this, you must do it indirectly. This alias shows 3 ways of trying to set a variable containing spaces. The red line shows that using /bset to set a string removes leading/trailing/multiple spaces. The green line shows how to preserve the spaces by adding the bytes of the string 1 at a time. The maroon line shows a much faster way to place long text strings into the binary variable.

Please note that all contributions to WikiChip may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see WikiChip:Copyrights for details). Do not submit copyrighted work without permission!

Cancel | Editing help (opens in new window)