question on if-then
Andreas Unterkircher <[email protected]>
| Newsgroups | gmane.comp.java.smartfrog.user |
|---|---|
| Message-ID | <[email protected]> |
Hello,
I have a problem understanding IF ... THEN. The followin SF code borrowing
the components coming with the printer example should print "print the
first message" or "print the second message" according to whether
"newMessage" was set to "first" or "second" in sfConfig. If "newMessage"
is neither "first" or "second" then it should print "no message found".
Here's the code (includes omitted):
theGenerator extends Generator {
msg1 IF (newMessage == "first") THEN "print the first message" ELSE
"no message found" FI;
msg1 IF (newMessage == "second") THEN "print the second message" ELSE
"no message found" FI;
messages [msg1];
printer LAZY ATTRIB p;
}
thePrinter extends Printer {
name "printerA";
}
sfConfig extends Compound {
newMessage "first";
g extends theGenerator;
p extends thePrinter;
}
I played around with adding "LAZY", "ROOT" and so on in the "theGenerator"
component but either I get a parse error or it prints just "no message
found". How can I get the desired behaviour ?
Thanks,
Andreas
--
http://cern.ch/openlab
-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click