SI
SI
discoversearch

We've detected that you're using an ad content blocking browser plug-in or feature. Ads provide a critical source of revenue to the continued operation of Silicon Investor.  We ask that you disable ad blocking while on Silicon Investor in the best interests of our community.  If you are not using an ad blocker but are still receiving this message, make sure your browser's tracking protection is set to the 'standard' level.
Technology Stocks : All About Sun Microsystems -- Ignore unavailable to you. Want to Upgrade?


To: DiViT who wrote (35226)9/12/2000 1:52:31 PM
From: Prognosticator  Respond to of 64865
 
I don't have Visual Basic, which is what your code looked like, so I translated your code into Java, and fixed the undeclared variable stuff (did you compile this or just put it out there untested?) and this is what I got:


StillDelayed: using PIII
Ready! Using UltraSparcIII!


So in essence what you're saying is use PIII until UltraSparcIII is released? Also, your involuted logic makes it difficult to figure out what your intention is: there is beauty in simplicity. Does VisualBasic increment the while counter before executing the loop? If so, Gak! If not, you blew it :)

P.


public class TestLoop {
public TestLoop() {
int UseProcessor = 0, PIII = 1;
int Ready = 1, DelayedAgain = 1;
int StillDelayed = 0;
for (int SparkIII = 0; SparkIII < Ready; StillDelayed++) {
if( SparkIII < Ready){
UseProcessor = PIII;
Ready = StillDelayed;
}
System.out.println("StillDelayed: using " + (UseProcessor==PIII? "PIII": "UltraSparcIII"));
}
System.out.println("Ready! Using UltraSparcIII!");
}
public static void main(String args[])
{
new TestLoop();
}
}