From WikiChip
Difference between revisions of "mirc/identifiers/$mknickfn"
< mirc‎ | identifiers

(Parameters)
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
{{mirc title|$mknickfn identifier}}'''$mknickfn''' creates a valid filename from a nickname by replacing certain characters with the underscore character "_" / $chr(95).
+
{{mirc title|$mknickfn identifier}}'''$mknickfn''' creates a valid filename from a nickname by removing characters which are not valid in a filename from text.
  
  
Line 6: Line 6:
  
 
== Parameters ==
 
== Parameters ==
'''nickname''' - The nickname to be made a valid filename by removing characters which are not valid in a filename
+
* '''nickname''' - The nickname to be made a valid filename
  
 
== Example ==
 
== Example ==
 
<source lang="mIRC">
 
<source lang="mIRC">
//var %i 33 | var %f | while (%i isnum 33-126) { var %f %f $+ $chr(%i) | inc %i } | echo -a orig: %f | echo -a mknk: $mknickfn(%f) | echo -a mkfn: $mkfn(%f) | echo -a mklog: $mklogfn(%f)
+
//var %i 33 | var %f | while (%i isnum 33-126) { var %f %f $+ $chr(%i) | inc %i } | echo -a orig: %f | echo -a mknk: $mknickfn(%f)  
 
</source>
 
</source>
  
'''Note:''' While this ensures a string is a valid filename, it does not ensure 2 different strings wouldn't get assigned the same filename, with both having different characters replaced with the same underscore. It uses the same group of character replacements as used by {{mIRC|$mkfn}}.
+
'''Note:''' While this ensures a string is a valid filename, it does not ensure 2 different strings wouldn't get assigned the same filename, with both having different characters removed.
  
 
== Compatibility ==
 
== Compatibility ==

Latest revision as of 14:59, 5 January 2018

$mknickfn creates a valid filename from a nickname by removing characters which are not valid in a filename from text.


Synopsis[edit]

$mknickfn(nickname)

Parameters[edit]

  • nickname - The nickname to be made a valid filename

Example[edit]

//var %i 33 | var %f | while (%i isnum 33-126) { var %f %f $+ $chr(%i) | inc %i } | echo -a orig: %f | echo -a mknk: $mknickfn(%f)

Note: While this ensures a string is a valid filename, it does not ensure 2 different strings wouldn't get assigned the same filename, with both having different characters removed.

Compatibility[edit]

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.


See also[edit]