Old ternary operator problem


2008-05-20 10:12:34 PM
cppbuilder13
I found this problem reported a while back (for BCB 5), but I thought it
might have been fixed.
Place a TButton on a TForm and in the OnClick handler add;
AnsiString temp = ! Button1->Visible ? Caption : Button1->Caption;
Button1->Caption = temp;
Now run, and click the button and you get an AV.
Interestingly, pressing the space bar to activate the button doesn't
cause an AV.
I'm using CB2007 11.0.2987.10779
Stewart
(N.B. I don't have RAID access on this PC, so I can't do a search.)