From WikiChip
Difference between revisions of "mirc/identifiers/$bfind"
Maroonbells (talk | contribs) (create content for identifier) |
Maroonbells (talk | contribs) m (add .textcs prop) |
||
Line 2: | Line 2: | ||
== Synopsis == | == Synopsis == | ||
<pre>$bfind(&binvar, N , M )</pre> | <pre>$bfind(&binvar, N , M )</pre> | ||
− | |||
== Parameters == | == Parameters == | ||
* '''&binvar''' - A binary variable name which begins with the & symbol. | * '''&binvar''' - A binary variable name which begins with the & symbol. | ||
Line 9: | Line 8: | ||
== Properties == | == Properties == | ||
* '''text''' - Treats a numeric N as text instead of ASCII value(s) | * '''text''' - Treats a numeric N as text instead of ASCII value(s) | ||
+ | * '''textcs''' - When M is recognized as text, search is performed as case-sensitive | ||
Note: Searches for text are case-insensitive. Case-senstive searches require listing the specific ASCII values of the upper and/or lower case letter. Returns 0 for not found. | Note: Searches for text are case-insensitive. Case-senstive searches require listing the specific ASCII values of the upper and/or lower case letter. Returns 0 for not found. | ||
== Example == | == Example == | ||
− | <source lang="mIRC">//bset -t &var 1 test wavmIRC32WAV test | echo -a $bfind(&var,1,32) / $bfind(&var,11,32) / $bfind(&var,1,32).text / $bfind(&var, 1, $asc(W) $asc(A) $asc(V) ) / $bfind(&var,1,WAV).text / $bfind(&var,1,abc).text | + | <source lang="mIRC">//bset -t &var 1 test wavmIRC32WAV test | echo -a space beginning pos1: $bfind(&var,1,32) / space beginning pos11: $bfind(&var,11,32) / finds string '32' instead of chr(32) $bfind(&var,1,32).text / case-sensitive: $bfind(&var, 1, $asc(W) $asc(A) $asc(V) ) / case-insensitive: $bfind(&var,1,WAV).text / case-sensitive: $bfind(&var,1,WAV).textcs / not found: $bfind(&var,1,abc).text |
− | + | ||
− | + | result: space beginning pos1: 5 / space beginning pos11: 18 / finds string '32' instead of chr(32) 13 / case-sensitive: 15 / case-insensitive: 6 / case-sensitive: 15 / not found: 0 | |
+ | |||
+ | Note that 32 searches for ASCII 32 (space) except when .text is used. Searching for "WAV" is case-insensitive and finds the lowercase letters, but the search for the 3 ASCII values finds the matching case. Using .textcs is available as of 7.58 to search for a case-sensitive text string without translating it to byte values. | ||
</source> | </source> | ||
Line 34: | Line 36: | ||
* {{mIRC|$bvar}} | * {{mIRC|$bvar}} | ||
}} | }} | ||
− |
Revision as of 16:46, 17 November 2019
Commands & Identifiers
Basics
Events
Matching Tools
Data Storage
Control Structures
GUI Scripting
Sockets
Advanced Scripting
Additional Resources
Security
Other
$bfind searches &binvar for a matching value.
Synopsis
$bfind(&binvar, N , M )
Parameters
- &binvar - A binary variable name which begins with the & symbol.
- N - The position within the binary variable where it starts searching.
- M - Value being searched for, either ASCII decimals 0-255 or text.
Properties
- text - Treats a numeric N as text instead of ASCII value(s)
- textcs - When M is recognized as text, search is performed as case-sensitive
Note: Searches for text are case-insensitive. Case-senstive searches require listing the specific ASCII values of the upper and/or lower case letter. Returns 0 for not found.
Example
//bset -t &var 1 test wavmIRC32WAV test | echo -a space beginning pos1: $bfind(&var,1,32) / space beginning pos11: $bfind(&var,11,32) / finds string '32' instead of chr(32) $bfind(&var,1,32).text / case-sensitive: $bfind(&var, 1, $asc(W) $asc(A) $asc(V) ) / case-insensitive: $bfind(&var,1,WAV).text / case-sensitive: $bfind(&var,1,WAV).textcs / not found: $bfind(&var,1,abc).text result: space beginning pos1: 5 / space beginning pos11: 18 / finds string '32' instead of chr(32) 13 / case-sensitive: 15 / case-insensitive: 6 / case-sensitive: 15 / not found: 0 Note that 32 searches for ASCII 32 (space) except when .text is used. Searching for "WAV" is case-insensitive and finds the lowercase letters, but the search for the 3 ASCII values finds the matching case. Using .textcs is available as of 7.58 to search for a case-sensitive text string without translating it to byte values.
Compatibility
Added: mIRC v5.7
Added on: 02 Feb 2000
Note: Unless otherwise stated, this was the date of original functionality.
Further enhancements may have been made in later versions.