Share My Creation Another ScrollView example

chinku_chan

New Member
Hi Klaus - super newbie here.

From the code you modified for netchicken, could you explain how exactly this piece of code works - particularly the calculations you perform.
I'm having trouble customizing this code for my scroll view. Thanks in advance

Sub View_Click
Dim Send As View
Dim row, Obj As Int
Send=Sender

row=Floor(Send.Tag/10) 'HERE!!
Obj=Send.Tag-row*10 ' HERE!!
Select Obj
Case 0
Activity.Title="view click Row = "&row&" Main Panel"
Case 1
Activity.Title="view click Row = "&row&" Product = "&Obj

Case 2,3,4,5
Activity.Title="view click Row = "&row&" Label = "&Obj
Case 6
Activity.Title="view click Row = "&row&" Image"
End Select
End Sub
 

klaus

Expert
Licensed User
Longtime User
I don't remember exactly what the DB content was, and I don't have the file anymore.
But from the two lines it seems that the Tag value was 10 * row + ObjIndex.
So row=Floor(Send.Tag/10), which means the integer value of Send.Tag/10,
and Obj=Send.Tag-row*10 the Obj index = Send.Tag - row*10 removes the row value wich is 10 * row value.
then we need to multiply the reminder by 10 to get the object index.

Best regards.