Android Question how send variable and call variable to function ?

fgh3966

Active Member
Licensed User
Hi everybody


i want write this function with public variable BV0 as byte
BV0 declared at Sub Globals function

function quartet :
Sub quartet ' [U][B](BV0 as Byte[/B][/U]) [B][I]are not possible[/I][/B]

        If BV0 <> 4 Then
'******************************** 4 *************************************             
        ImageView1.Bitmap = LoadBitmap(File.DirAssets, "led_off.png")
        ImageView2.Bitmap = LoadBitmap(File.DirAssets, "led_on.png")
        ImageView3.Bitmap = LoadBitmap(File.DirAssets, "led_off.png")
        ImageView4.Bitmap = LoadBitmap(File.DirAssets, "led_off.png")
        End If

End sub


is not possible to write : Sub quartet (BV0 as Byte) in my code.


And how call this fonction with variable BV0 ?

Thank you very much
 

agraham

Expert
Licensed User
Longtime User
You should be able to write
B4X:
Sub quartet (BV0 As Byte)
    If BV0 <> 4 Then
        ******************************** 4 *************************************
        ImageView1.Bitmap = LoadBitmap(File.DirAssets, "led_off.png")
        ImageView2.Bitmap = LoadBitmap(File.DirAssets, "led_on.png")
        ImageView3.Bitmap = LoadBitmap(File.DirAssets, "led_off.png")
        ImageView4.Bitmap = LoadBitmap(File.DirAssets, "led_off.png")
    End If
End Sub
 
  • Like
Reactions: zed
Upvote 0
Top