B4R Question use type byte array in line c

mzsoft

Member
this is my code.
B4X:
Sub Process_Globals

Type weekype(nfirstnum As Int,sat_time(25) As Byte)

Dim week_sel As weekype

End Sub

sub show
    For k=0 To 23
        week_sel.sat_time(k)=Rnd(0,2)
    Next

RunNative("page_week_set_up_name", week_sel)
End Sub

#if C

void page_week_set_up_name(B4R::Object* o)
{
_weekype* tmp = (_weekype*)B4R::Object::toPointer(o) ; 
char n=tmp->firstnum; 
for(int y=0;y<8;y++)
{
 if(tmp->sat_time[n]==1)
 {
 }
 n++;
}
}
#End If

but when compile this error show.
B4X:
b4r_page_week.cpp:58:21: error: no match for 'operator==' (operand types are 'B4R::Array' and 'int')
  if(tmp->sat_time[n]==1)
                     ^
 

mzsoft

Member
i use lvgl and i have week table that has 24 hour select time.
i need to show selected time.
so i need time arry to set green color in table
table.jpg
 
Upvote 0
Top