Structure property bug?
Steven Schveighoffer
schveiguy at yahoo.com
Thu Oct 4 06:54:14 PDT 2007
"Todd" wrote
> I'm using DFL w/DMD ver 1.020 and receive the following compile
> error's:
>
> no property 'Data' for type 'ARINCDATA_CELL [51u]'
> ArincWord is not an lvalue
> ReceivedChannel is not an lvalue
> Returned status code 1
>
> Code:
>
> alias uint ArincWord;
> alias uint TimeRead;
> alias short ReceivedChannel;
>
> struct ARINCDATA_CELL
> {
> align(1):
> short Channel;
> uint Time;
> uint Data;
> }
> .
> .
> .
> ARINCDATA_CELL ArincData[51];
> .
> .
> if(ArincData.Data &0xff == 203)
> {
> ArincWord = ArincData[i].Data;
> ReceivedChannel = ArincData[i].Channel;
> }
> .
> .
> .
> Tried everything I could think of but no dice.
> Think its related to the "[51]" or a bug. I've seen this error
> posted in the past, however none of the solutions seem to work,
> unless I missed one somewhere?
>
> Any idea's?
This works. I think you have a few syntax errors:
if(ArincData[i].Data &0xff == 203)
{
ArincWord v1 = ArincData[i].Data;
ReceivedChannel v2= ArincData[i].Channel;
}
Note the [i] in the if statement, and the variable names v1 and v2.
-Steve
More information about the Digitalmars-d
mailing list