few questions...

bjanko

Member
Licensed User
Longtime User
hey volks,
neci to be here... since i find out the basic4android i have no other things in my mind...

for first i would 2 ask some silly things... and hope for helpfull feedback... ;-)

1. why i can't add 0.0 to double??? if 0.00 isn't right how can i initialize the variable at start of my app...

2. tryed to make simple gaga app where you press on start and the main target was to drop randomized digits as label.text... yes it did... but i wanted some funky changing digits (yeaahhh... like in movies where they hack the pass... :icon_clap:) on the display until the last 4 randomized comes... therefore i maked 4 variables as int, 4 labels where they should be shown, and packed into loops, something like:
for i < 10000
d1 = Rnd(0,9)
a1.Text=d1
.
.
.
loop

and so on... but unfortunately the presentation behavior isn't like i hoped to have it... unstead having "playing digits" in the a1.Text the label is black until the loops stops and go out of computing.... do i have any posibility to slow it down so the device can update the label.text????
thanks all....

cheers
bobbi
 

sorex

Expert
Licensed User
Longtime User
1. that should work, atleast it does here

dim x as double
x=0.00


2.

your label doesn't update, to do so you'll need to use doevents inside the loop, but it's better to use timers instead (when having other stuff happening)
 
Upvote 0

bjanko

Member
Licensed User
Longtime User
hey sorex,
thx for the fast feedback... and u will guess i found it... there wasn't that i give him the 0 at initializing but more that the second varible, which is double too, don't have any input so i go with "" into the second double... aaand... here we got the exception trouble... ;-) thanks a lot...

furthermore the update event... how can i make update event to the label txt... i thought that this is allready done when i give him blabla.Text=blablavariable...

cheers
bobbi
 
Upvote 0

sorex

Expert
Licensed User
Longtime User
it actually does when no other code is left to run.

but since you do it in a loop you'll need to force the update to see it.

B4X:
for i= 0 to 10000
a1.Text=Rnd(0,9)
doevents
next
 
Upvote 0
Top