Language Objecteering language
Date: | 11/04/06 |
Author: | JPE |
URL: | n/a |
Comments: | 1 |
Info: | http://www.objecteering.com/objecteering6.php |
Score: | (1.75 in 4 votes) |
int remain = 99; Object [] params; String s; // getting remaining number getCurrentProject.<ModelPackage.<TagTaggedValue.<select (DefinitionTagType.Name == "nocode") { ActualTagParameter { remain = this.Value.toInteger (); } } if (remain > 1) s = "s"; StdOut.write (remain); StdOut.write ( " bottle"+s+" of beer on the wall, "); StdOut.write (remain, " bottle"+s+" of beer, ", NL); if (remain == 1) { StdOut.write ( " Take one down, pass it around, "); StdOut.write ( "no more bottles of beer on the wall, ", NL); StdOut.write ( " No more bottles of beer on the wall, no more bottles of beer. ", NL); StdOut.write ( " Go to the store, buy some more, 99 bottles of beer on the wall.", NL); } else { StdOut.write ( " Take one down, pass it around, "); remain = remain - 1; if (remain == 1) s = ""; StdOut.write ( remain, " bottle"+s+" of beer on the wall, ", NL); getCurrentProject.<ModelPackage.<TagTaggedValue.<select (DefinitionTagType.Name == "nocode") .<delete (); params.insert (remain.toString ()); getCurrentProject.<ModelPackage.<createAndAddTaggedValueWithParams ("nocode", "nocode", params, ""); runMacro ("bottles"); }
Download Source | Write Comment
Download Source | Write Comment
Add Comment
Please provide a value for the fields Name,
Comment and Security Code.
This is a gravatar-friendly website.
E-mail addresses will never be shown.
Enter your e-mail address to use your gravatar.
Please don't post large portions of code here! Use the form to submit new examples or updates instead!
Comments
BSA said on 07/08/08 11:27:06
Why is there a parameter on "nocode" TaggedValue at the end?
It makes an audit error message!