Android Question Variable in script designer

DALB

Active Member
Licensed User
Hello,

looking at the forums, I didn't find if it is possible to write a variable in the script designer like this :

variable in script designer:
r =27/359
label1.left=r%x
r=152/359
label1.width=r%x

I have read that the formula 'r%x' seems impossible to use.

Thanks much for answering
 

emexes

Expert
Licensed User
Longtime User
@klaus beat me to the finish line via a similar route, but hey, the more options you have, the merrier

This is probably better:
B4X:
width = 100%x
Button1.left = width * 27 / 359
Button1.width = width * 154 / 359

or if you're doing multiple buttons that are aligned in some way, use multiple variables:
B4X:
width = 100%x

buttonleft = width * 27 / 359
buttonwidth = width * 154 / 359

Button1.Left  = buttonleft
Button1.Width = buttonwidth
Button2.Left  = buttonleft
Button2.Width = buttonwidth
Button3.Left  = buttonleft
Button3.Width = buttonwidth
 
Upvote 0

DALB

Active Member
Licensed User
All of you save my day. Thank you very much ! Here I find the most concentred clever people of the world !
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…