Jump to content

New Find File Addon


Warrior124

Recommended Posts

This addon is a new version of the ff alias. What it does is it will attempt to locate the specified file in the directory where you are running mirc, and its subdirectories. If it doesn't find the file there it will attempt to locate the file where your mirc.ini file is located, and its subdirectories. If it still doesn't find the file it will create a variable for the file which will be good if creating a new file. Another thing about this new code is you can find/make a file with spaces in the directory, and/or filename. :)

 

alias ff {
  var %getff $1-
  if (!%ff. [ $+ [ " $+ %getff $+ " ] ]) || (!$exists(%ff. [ $+ [ " $+ %getff $+ " ] ])) {
    if ($shortfn($findfile($nofile($mircexe),%getff,1))) set %ff. [ $+ [ " $+ %getff $+ " ] ] $ifmatch
    elseif ($shortfn($findfile($mircdir,%getff,1))) set %ff. [ $+ [ " $+ %getff $+ " ] ] $ifmatch
    else set %ff. [ $+ [ " $+ %getff $+ " ] ] " $+ $nofile($mircexe) $+ %getff $+ "
  }
  return %ff. [ $+ [ " $+ %getff $+ " ] ]
}

Link to comment
Share on other sites

Hey Buddy,

 

Hate to be a pest... but does the %getff variable ment to be evaluated?? I just tried your new code, and it doesnt update the variable unless you evaluate the %getff variable when you set it... =)

 

alias ff {
  var %getff = $1-
  if (!%ff. [ $+ [ " $+ [ %getff ] $+ " ] ]) || (!$exists(%ff. [ $+ [ " $+ [ %getff ] $+ " ] ])) {
    if ($shortfn($findfile($nofile($mircexe),%getff,1))) set %ff. [ $+ [ " $+ [ %getff ] $+ " ] ] $ifmatch
    elseif ($shortfn($findfile($mircdir,%getff,1))) set %ff. [ $+ [ " $+ [ %getff ] $+ " ] ] $ifmatch
    else set %ff. [ $+ [ " $+ [ %getff ] $+ " ] ] " $+ $nofile($mircexe) $+ [ %getff ] $+ "
  }
  return %ff. [ $+ [ " $+ [ %getff ] $+ " ] ]
}

 

Thanks buddy, Its a handy little function I feel :)

 

Kind Regards,

Daniel

 

Actually it evaluates fine for me, but that extra = sign does the same thing, lol. Thanks, Daniel. :)

 

 

:oops: warrior123 ? ........ :lmaojump: you been working to hard err0r :P

 

:lolwave:

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...