Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. calabrra

    Returning Multiple Arguments?

    Hello, Can an AWK function return more than one argument? For example, > return x, y; Thanks Bob
  2. calabrra

    MAWK fatal error: "return outside function body"

    I found the solution thanks to Mike Brennan: Change "func" to "function". -Bob
  3. calabrra

    MAWK fatal error: "return outside function body"

    Greetings, I'm running the ported mawk version 1.3.3 under Win 2K Pro, and am getting the fatal error message: "(Source) Line nnn: Return outside function body." for all functions with a "return" statement. Strangely, I don't get any errors when interpreting the exact...
  4. calabrra

    Is "switch/case" faster than "if/else if/else" ?

    Thanks! I'm using "awk95.exe" from Bell Labs. -Bob
  5. calabrra

    Is "switch/case" faster than "if/else if/else" ?

    The logic shown below is executed at 50Hz max over several minutes, and I need to turbocharge. Would "switch/case" be faster? (Since this code is repetitive, I was thinking of auto-generating an equivalent code segment minus the burdensome logic tree. But this may be overkill.)...
  6. calabrra

    AWK "Pause/Enter Data" Function?

    Hmmm... I tried these commands (i.e. print / getline) but GETLINE doesn't show up on the DOS window...and it seems like the PRINT output is being written to a file that is already open. This is what I have in the BEGIN section: print "%s:", "Want to continue? (1/0)..." ...
  7. calabrra

    AWK "Pause/Enter Data" Function?

    Hi, I'm running AWK from DOS on Win2000. Is there a function that allows user to pause and enter parameter data? Thanks, -Bob
  8. calabrra

    Outputting Data To DOS

    I'm running Win2K Pro on a laptop. I'll give CaKiwi's suggestion a try. Thanks, -Bob
  9. calabrra

    Outputting Data To DOS

    I would like to compute elapsed time (hh:mm:ss) in my AWK routine and display it on the DOS console window. Is there a simple way to do this? Thanks, -Bob
  10. calabrra

    Conditional Expression

    Thanks CaKiwi, -Bob
  11. calabrra

    Conditional Expression

    Question: Would the AWK conditional expression: function abs(x) { x >= 0 ? x : -x ; return(x) ; } return the absolute value or simply the input argument? Thanks, -Bob
  12. calabrra

    Local variables get corrupted when calling another function.

    Vlad/Salem, thanks for your timely and helpful responses. -Bob
  13. calabrra

    Local variables get corrupted when calling another function.

    Hi Vlad, I got the code to work right by changing "strpos" to "strcol" and "result" to "result_ascii" in the calling function. Nevertheless, I would like to know if there's a cleaner way to preserve parameter values in the calling function without...
  14. calabrra

    Local variables get corrupted when calling another function.

    Hi, I'm calling a function from within a function. This causes local variables to be corrupted because they happen to have the same name in the function I am calling. Is there a workaround to this annoyance without having to rename variables? Thanks, -Bob

Part and Inventory Search

Back
Top