|
-
Aug 22nd, 2000, 09:53 PM
#1
Thread Starter
Fanatic Member
Code:
private void cheat_keyPress(Object source, KeyPressEvent e)
{
char c_char;
c_char = e.getKeyChar();
if(c_char == 13) {
String c_code;
String c_parse;
String c_get;
Form1 mon = new Form1();
long c_line;
c_code = cheat.getText();
c_get = c_code.substring(0,5);
if(c_get.substring(0,c_get.length()) == "money") {
c_parse = c_code.substring(6,c_code.length());
super.close();
c_line = Integer.valueOf(c_parse).intValue();
mon.addmoney(c_line,true);
cheat.setText(c_parse + "testing phase 1");
}
}
}
Whats wrong with this code? The second if wont execute, the first 1 will. ***!
ok, so... windows takes 1 minute to search for a file on my PC yet google.com takes 1 second to search the entire internet? 
-
Aug 23rd, 2000, 03:39 AM
#2
Frenzied Member
Just a guess here...
Try:
if(c_get.substring(0,c_get.length()).compareTo("money")== 0)
or
if(c_get.substring(0,c_get.length()).toString().compareTo("money")== 0)
-
Aug 23rd, 2000, 07:11 PM
#3
Thread Starter
Fanatic Member
-
Aug 24th, 2000, 02:18 AM
#4
Frenzied Member
I don't know why it's like that.
Perhaps a match returns 0 as in no error rather than true/false...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|