1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to? user function

Discussion in 'Support' started by fpefpe, Nov 19, 2012.

  1. fpefpe

    Joined:
    Oct 18, 2008
    Messages:
    263
    Likes Received:
    1
    Hello -- are user function just 1 line? can they have logic in then and return a string? Thanks
     
  2. vefatica

    Joined:
    May 20, 2008
    Messages:
    8,129
    Likes Received:
    33
    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
     

Share This Page