invitro
Aug 20th, 2000, 06:30 PM
if(c_code.substring(0,6) == "money=")
Ok this little line wont execute, im traying to figure out why. My whole code is this.
private void cheat_keyPress(Object source, KeyPressEvent e)
{
String c_code;
String c_parse;
char c_char;
Form1 mon = new Form1();
long c_line;
c_char = e.getKeyChar();
if(c_char == 13) {
//c_code = cheat.getText();
c_code = cheat.getText();
// c_code = c_code.substring(0,6);
//cheat.setText(c_code);
//button1.setText(c_code.substring(0,6));
if(c_code.substring(0,6) == "money=") {
c_parse = c_code.substring(6,c_code.length());
c_line = integer.valueOf(c_parse).intValue();
mon.addmoney(c_line,true);
}
}
}
I know the keypress works, because if i add a statment before the if(c_code) then it will execute.
I type in money=50000 (cheat for a game)
and hit enter, and it wont recognize the money=.
Any ideas?
Ok this little line wont execute, im traying to figure out why. My whole code is this.
private void cheat_keyPress(Object source, KeyPressEvent e)
{
String c_code;
String c_parse;
char c_char;
Form1 mon = new Form1();
long c_line;
c_char = e.getKeyChar();
if(c_char == 13) {
//c_code = cheat.getText();
c_code = cheat.getText();
// c_code = c_code.substring(0,6);
//cheat.setText(c_code);
//button1.setText(c_code.substring(0,6));
if(c_code.substring(0,6) == "money=") {
c_parse = c_code.substring(6,c_code.length());
c_line = integer.valueOf(c_parse).intValue();
mon.addmoney(c_line,true);
}
}
}
I know the keypress works, because if i add a statment before the if(c_code) then it will execute.
I type in money=50000 (cheat for a game)
and hit enter, and it wont recognize the money=.
Any ideas?