Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

question for doing macros.
Hi, I did a macro assembler in awk, but it was unsatisfactorily
complex. The key issue is having one input line from a source file
generate multiple lines that then should be processed by the main
loop.

For example:

<input file>
THISISAMACRO "test",2,xxx
</input file>

And after this I would like to process 2-to-n different $0 lines in my
main awk pattern testing loop. So THISISAMACRO might emit

$0 = command "test",2
then
$0 = command2 "test",xxx

etc.

So maybe my awk code is

/THISISAMACRO/ { for (i=0;i<3;i++) { $0="command" $i; next;} }

and this wont work because "next" will rip me out of the for loop and
at best I will get only the first line of the expansion, and maybe it
will not even get this if it overwrites my $0 with the next input
line.


Any ideas?

Report this thread to moderator Post Follow-up to this message
Old Post
Steve
10-12-04 08:55 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

AWK archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 05:52 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.