Can I write a Macro to print a function?

Can I write a Macro to print a function?

2
NewbieNewbie
2

    Mar 08, 2005#1

    For example: I have an open c-file with a lot of functions and I want to print, but I do not want to print the whole file, only one function ...
    normly I mark the function and than print the selection

    Can I do this with a macro?
    For example, my cursor is on the functionname and I have a macro that print exactly this and only this function?!

    If I go on the first bracket from the function, I can mark the function, by searching for the last bracket ... but than I have only the function-budy and not the name above.

    Greetings
    Petrusha

    6,687587
    Grand MasterGrand Master
    6,687587

      Mar 08, 2005#2

      Try this little macro to select the whole function, if you are anywhere inside a function. The macro requires, that the function { and } are at start of line and the function definition line does not start with a non alpha-numerical character. But it is not possible to print the selection directly with a macro. You still have to print the selection manually.

      InsertMode
      ColumnModeOff
      HexOff
      UnixReOff
      Find RegExp "%}"
      Find RegExp Up "%{"
      Find RegExp Up "%[0-9a-z]"
      Find RegExp Select "%}"
      Best regards from an UC/UE/UES for Windows user from Austria

      2
      NewbieNewbie
      2

        Mar 08, 2005#3

        Works fine :D
        Starting the print manualy is ok. My biggest problem was the selection of the whole function.
        Thank you for the fast answer.
        Petrusha