Good job my friend but you must fix something because if you start your pin with "0" and for example you have the pin "0123", in your txt file you will have the pin "123" not "0123"!
Sorry if i am wrong! :)
try this:
StringTokenizer st = new StringTokenizer(command);
st.nextToken();
String a-beep-t = null;
- int pin1 = 0;
- int pin2 = 0;
- int pin3 = 0;
- int pin4 = 0;
+ String pin1 = null;
+ String pin2 = null;
+ String pin3 = null;
+ String pin4 = null;
String message = "";
try
{
a-beep-t = st.nextToken();
- pin1 = Integer.parseInt(st.nextToken());
- pin2 = Integer.parseInt(st.nextToken());
- pin3 = Integer.parseInt(st.nextToken());
- pin4 = Integer.parseInt(st.nextToken());
+ if (st.hasMoreTokens()) pin1 = st.nextToken();
+ if (st.hasMoreTokens()) pin2 = st.nextToken();
+ if (st.hasMoreTokens()) pin3 = st.nextToken();
+ if (st.hasMoreTokens()) pin4 = st.nextToken();
while(st.hasMoreTokens())
message = message + st.nextToken() + " ";