Hello,
Perhaps you should try making the current Thread that is running go
to sleep by calling:
Thread.currentThread.sleep(300);
That usually works for me.
Zev
----- Original Message -----
From: "Nik Frengle" <eseller@eimode.com>
To: <keitai-l@appelsiini.net>
Sent: Monday, September 17, 2001 10:30 PM
Subject: (keitai-l) i-Appli Thread Question
>
> I am writing an application, actually a game, and am having a problem with
using a for loop. In the middle of the loop I have a Thread.sleep (300).
This works fine on i-Jade (P and F), but the command seems to act as a sort
of continue statement in the DoJa emulator and my (real world) SO503i,
creating another iteration before the code below the sleep has been
executed. Below is the code:
>
> for (int i=0;i<h;i++){
> state=3;
> squarePosition(pbkey[i]);
> currentcolor=6;
> repaint();
> ap[pbkey[i]].play();
> Thread.sleep (300); //Code executes fine up
until this point
> currentcolor=startcolor[pbkey[i]]; //All of the code from this
point only gets executed on the last iteration
> ap[pbkey[i]].stop();
> repaint();
> }
>
> I realise this is probably something really stupid and simple, but damn me
if this novice knows what the problem is.
> Any help at all would be truly appreciated (so that I don't have to end up
on the JavaHz list asking the same question, albeit in rather broken
Japanese).
>
> -Nik Frengle
>
>
> [ Need archives? How to unsubscribe? http://www.appelsiini.net/keitai-l/ ]
>
>
[ Need archives? How to unsubscribe? http://www.appelsiini.net/keitai-l/ ]
Received on Tue Sep 18 03:50:07 2001