- if (cmdline->param(1) == 0)
- {
- con->printf("Timer number is missing\n");
- return(0);
- }
- set_ticker(sim, cmdline->param(1));
- if (strstr(s, "c") == s ||
- strstr(s, "m") == s ||
- strstr(s, "a") == s)
- return(add(sim, cmdline, con));
- else if (strstr(s, "d") == s)
- return(del(sim, cmdline, con));
- else if (strstr(s, "g") == s)
- return(get(sim, cmdline, con));
- else if (strstr(s, "r") == s)
- return(run(sim, cmdline, con));
- else if (strstr(s, "s") == s)
- return(stop(sim, cmdline, con));
- else if (strstr(s, "v") == s)
- return(val(sim, cmdline, con));
- else
- con->printf("Undefined timer command: \"%s\". Try \"help timer\"\n",
- s);
+ as_nr= DD_TRUE;
+ id_nr= params[0]->value.number;
+ if (id_nr <= 0)
+ {
+ con->dd_printf("Error: "
+ "Timer id must be greater than zero or a string\n");
+ return(DD_TRUE);
+ }
+ ticker= uc->get_counter(id_nr);