How to? user function

  • This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.
#2
Hello -- are user function just 1 line? can they have logic in then and return a string? Thanks
Yes, they are one-liners.
Their purpose is to return a string. @IF[] can be useful in a user-defined function. There are tricks which may/may not work to your satisfaction. @EXECSTR[] will grab one line of output from an EXE or a BTM. For example:
Code:
v:\> function factors `%@execstr[v:\factor.btm %1]`
 
v:\> echo %@factors[40]
2,2,2,5
 
v:\> echo %@factors[99]
3,3,11