Page 1 of 1

Code acting oddly

Posted: Tue Feb 10, 2015 9:22 pm
by neomodus
Hi
I have the following code on a button mouse up event

Global tWords
On mouseUp
set the visible of field "Dict" to true
put "Dictionary decompressing - please wait" into field "Dict"
put decompress(the cMaximumtext of this stack) into tWords
lock screen for visual effect
Go to card id 1005
unlock screen with visual effect push left
End mouseUp

What I want to do is display a wait message whilst the dictionary is being decompressed but on IOS the button just appears depressed and the message only appears after the dictionary has decompressed and then displays the next card.
Any advice please?
Thanks

Re: Code acting oddly

Posted: Wed Feb 11, 2015 1:56 pm
by jmburnod
Hi neomobus,

You can maybe try to divide your script in several parts and you may use a "send in time" message
something like that

Code: Select all

Global tWords
On mouseUp
   set the visible of field "Dict" to true
   put "Dictionary decompressing - please wait" into field "Dict" 
   send "doDecompressMyText" to me in 300 milliseconds
   send "doGoCd" to me in 1300 milliseconds
End mouseUp

on doDecompressMyText
   put decompress(the cMaximumtext of this stack) into tWords
end doDecompressMyText

on doGoCd
   lock screen for visual effect
   Go to card id 1005
   unlock screen with visual effect push left
end doGoCd
Best regards
Jean-Marc

Re: Code acting oddly

Posted: Wed Feb 11, 2015 9:53 pm
by neomodus
Thanks Jean Marc
That code works fine.
Thanks