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

(Create content for empty page)
 
 
(6 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{mirc title|$mkfn Identifier}}
+
{{mirc title|$mkfn identifier}}'''$mkfn''' ensures a text string can be a valid filename by replacing characters not allowed in a filename with underscores.
The '''$mkfn''' identifier ensures a text string can be a valid filename by replacing certain characters with the $chr(95) Underscore.
 
  
 
== Synopsis ==
 
== Synopsis ==
<pre>$mkfn( <text> )</pre>
+
<pre>$mkfn(text)</pre>
  
 
== Parameters ==
 
== Parameters ==
<span style="display: inline-block; width: 50px;">'''Text'''</span>Text to be made a valid filename by replacing certain characters with $chr(95) Underscore.<br />
+
* '''text''' - Text to be made a valid filename by replacing certain characters with underscores
 +
 
 +
== Properties ==
 +
None
  
 
== 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)
+
//var %i 33 | var %f | while (%i isnum 33-126) { var %f %f $+ $chr(%i) | inc %i } | echo -a orig: %f | echo -a mkfn: $mkfn(%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|$mklogfn}}.
+
'''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.
  
 
== Compatibility ==
 
== Compatibility ==
Line 22: Line 23:
 
* {{mIRC|$mknickfn}}
 
* {{mIRC|$mknickfn}}
 
* {{mIRC|$mklogfn}}
 
* {{mIRC|$mklogfn}}
[[Category:MIRC identifiers]]
+
[[Category:mIRC identifiers|mkfn]]

Latest revision as of 15:55, 5 January 2018

$mkfn ensures a text string can be a valid filename by replacing characters not allowed in a filename with underscores.

Synopsis[edit]

$mkfn(text)

Parameters[edit]

  • text - Text to be made a valid filename by replacing certain characters with underscores

Properties[edit]

None

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 mkfn: $mkfn(%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 replaced with the same underscore.

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]