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

(Create content for empty page)
 
(Parameters)
Line 6: Line 6:
  
 
== Parameters ==
 
== Parameters ==
<span style="display: inline-block; width: 50px;">'''String1'''</span>1st [path\]filename to be compared<br />
+
* '''String1''' - first path to be compared
<span style="display: inline-block; width: 50px;">'''String2'''</span>2nd [path\]filename to be compared<br />
+
* '''String1''' - first path to be compared
  
Recognizes paths if full-vs-relative-vs-absent. Recognizes files+paths for longname-vs-shortname.
+
you can use relative path for both parameters.
  
 
== Example ==
 
== Example ==

Revision as of 19:14, 18 September 2017

The $samepath identifier evaluates whether the pair of [path\]filenames resolve to the same path\filename.

Synopsis

$compress( <string1> , <string2> )

Parameters

  • String1 - first path to be compared
  • String1 - first path to be compared

you can use relative path for both parameters.

Example

//echo -a This returns $true $samepath( $mircexe , $nopath($mircexe) )
//echo -a This very likely returns $true $samepath( c:\program files\ , c:\progra~1\ )
//echo -a Returns $true if at least 1 subfolder: $samepath( $finddir($mircdir,*,1,1) , $remove($finddir($mircdir,*,1,1),$mircdir) )
//echo -a $true doesn't guarantee filename actually exists: $samepath( $mircdir $+ nosuchfile , nosuchfile )
//var %i delete_me.txt | write %i test | echo -a %i $shortfn(%i) returns $true : $samepath( %i , $shortfn(%i) )

Compatibility

Added: mIRC v7.46
Added on: 01 Aug 2016
Note: Unless otherwise stated, this was the date of original functionality.
Further enhancements may have been made in later versions.


See also