if (A) {
}
else if (A && B && C) {
}
else if (A && B && C && D) {
}
Let's examine two cases. If A evaluates to false, then nothing will
be executed because everything in your if clauses will also evaluate
to false. If A evaluates to true, only the first clause ( if (A) )
will ever execute. In both cases, the code in the "else if" clauses
never executes. Reverse the order of your if clauses and you can
change that.
if (A && B && C && D) {
}
else if (A && B && C) {
}
else if (A) {
}
--- In [email protected], "Jeremy Rottman" <[EMAIL PROTECTED]>
wrote:
>
> I changed the way I calling the position of the agents in my
array. I
> have added the array var POSITION to my cfc. So if it is
agent1,agent2
> the position is returned like this
>
> Agent1's position = 0
> Agents2's position = 1
>
> This works fine and dandy. Except when I try to write conditions
off
> of it.
>
> If I use this.
> if (result[i].TRANSSIDE == 'buyer' && i = result[i].POSITION )
>
> I get this error.
> Cannot assign to non-reference value.
>
> If I use this.
> if (result[i].TRANSSIDE == 'buyer' && i == result[i].POSITION )
>
> It once again displays the last retuned array value in the first
grid.
>
> Anyone have a clue why it would do this.
>
>
>
>
> --- In [email protected], "Jeremy Rottman" <rottmanj@>
wrote:
> >
> > I am working on a section of my test app and I need a bit of
help with
> > the logic.
> >
> > In the function below, I have my outputs in a grid. And the
grid is
> > hidden until certain conditions are met. The issue I have is,
when I
> > have 2 or more returned values from my cfc. The first if
statement gets
> > messed up. It takes the last value of my array and puts it in
grid 1. So
> > if I have agent1, agent2 being returned it overwrites agent1 and
puts
> > agent 2 in first if statement. Instead of moving it to the
second else
> > if statement and so on.
> >
> > So the question I have is, how do I get them to output in order.
IE
> >
> > buyAgentId1.text = Agent1's Agent name
> > buyAgentId2.text = Agent2's Agent name.
> >
> > for (var i:Number=0;i<result.length;i++){
> > if (result[i].TRANSSIDE == 'buyer'){
> > displayGrid1.visible = 'true';
> > buyGC.text = result
[i].BUYERCOMM *
> > price.text;
> > displayItemBuyer1.visible
= 'true';
> > buyAgentId1.text = result
[i].AGENTNAME;
> > transInputBuyer.text =
> > result[i].TRANSFEE;
> > enoInputBuyer.text = result
[i].EN0;
> > addTransInputBuyer.text =
> > result[i].ADDTRANSFEE;
> > // SET BUYER 1 HIDDEN FIELDS
> > agentPercentBuy.text =
> > result[i].PERCENTSIDE;
> > buyerSideComm.text =
> > result[i].BUYERCOMM;
> > }
> >
> > else if (result[i].TRANSSIDE == 'buyer'
&&
> > buyAgentId1.text.length > 0 && buyAgentId2.text.length > 0 ){
> > displayGrid2.visible = 'true';
> > displayItemBuyer2.visible
= 'true';
> > buyAgentId2.text = result
[i].AGENTNAME;
> > transInputBuyer2.text =
> > result[i].TRANSFEE;
> > enoInputBuyer2.text = result
[i].EN0;
> > addTransInputBuyer2.text =
> > result[i].ADDTRANSFEE;
> > // SET BUYER 1 HIDDEN FIELDS
> > agentPercentBuy2.text =
> > result[i].PERCENTSIDE;
> > buyerSideComm2.text =
> > result[i].BUYERCOMM;
> > }
> > else if (result[i].TRANSSIDE == 'buyer'
&&
> > buyAgentId1.text.length > 0 && buyAgentId2.text.length > 0 &&
> > buyAgentId3.text.length > 0){
> > displayGrid3.visible = 'true';
> > displayItemBuyer3.visible
= 'true';
> > buyAgentId3.text = result
[i].AGENTNAME;
> > transInputBuyer3.text =
> > result[i].TRANSFEE;
> > enoInputBuyer3.text = result
[i].EN0;
> > addTransInputBuyer2.text =
> > result[i].ADDTRANSFEE;
> > // SET BUYER 1 HIDDEN FIELDS
> > agentPercentBuy3.text =
> > result[i].PERCENTSIDE;
> > buyerSideComm3.text =
> > result[i].BUYERCOMM;
> > }
> >
> >
> >
> > }
> >
>
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
SPONSORED LINKS
| Web site design development | Computer software development | Software design and development |
| Macromedia flex | Software development best practice |
YAHOO! GROUPS LINKS
- Visit your group "flexcoders" on the web.
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

