Bset » History » Version 4
  Per Amundsen, 09/29/2017 09:36 PM 
  
| 1 | 1 | Per Amundsen | _Added in 1.9.0_ | 
|---|---|---|---|
| 2 | |||
| 3 | 3 | Per Amundsen | */bset [-ta] <&binvar> <N> <asciivalue> [asciivalue ... asciivalue]* | 
| 4 | 1 | Per Amundsen | |
| 5 | Sets the <N>th byte in binary variable &binvar to the specified ascii value. | ||
| 6 | |||
| 7 | If the &binvar docent exists it is created. | ||
| 8 | If <N> is larger than the size of &binvar it will be zero filled up to <N> bytes. | ||
| 9 | 2 | Per Amundsen | If you specify multiple "ASCII":http://www.asciitable.com/ values, they are copied to successive positions after byte position N. | 
| 10 | 1 | Per Amundsen | |
| 11 | *Switches* | ||
| 12 | |||
| 13 | -t - Treat values a plain text. | ||
| 14 | 3 | Per Amundsen | -a - Disables UTF-8 encoding of characters in the range 0-255, as long as the line contains no characters > 255. | 
| 15 | 4 | Per Amundsen | -1 - TODO | 
| 16 | 1 | Per Amundsen | |
| 17 | *Parameters* | ||
| 18 | |||
| 19 | <&binvar> - The &binvar to modify. | ||
| 20 | <N> - The byte to modify. | ||
| 21 | 2 | Per Amundsen | <asciivalue> - The "ASCII":http://www.asciitable.com/ value to insert. | 
| 22 | 1 | Per Amundsen | |
| 23 | *Example* | ||
| 24 | |||
| 25 | <pre> | ||
| 26 | alias example { | ||
| 27 | 2 | Per Amundsen | ; Create a binary variable set it to "This is fun!" | 
| 28 | 1 | Per Amundsen | bset -t &Example 1 This is fun! | 
| 29 | |||
| 30 | 2 | Per Amundsen | ; Print out the content of the variable | 
| 31 | 1 | Per Amundsen | echo -a $bvar(&Example, 1-).text | 
| 32 | } | ||
| 33 | </pre> |