(keitai-l) i-Appli Thread Question

From: Nik Frengle <eseller_at_eimode.com>
Date: 09/17/01
Message-ID: <001601c13f7c$f7ad2a20$0200a8c0@Sonet1>
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/ ]
Received on Mon Sep 17 16:13:28 2001