J
Joyrider
First let me say that I am not a C programmer. I have a small piece of
code used in a hand held data collector. Its purpose is to pad zeros
to the front of a scanned barcode so its length is 14 char. What I
want is for an ENTER to be suffixed so the user does not have to press
the Enter button after the scan and padding. If anyone can help me I
would be very appreciative.
char buf[16];
void _PadZero_3()
{
unsigned n;
int pos, row;
n = strlen(_CountUpc_F01);
if (n <14){
pos = _get_cursor();
row = ((pos >> 8) & 0xff) - 1;
sprintf(buf, "%014s", _CountUpc_F01);
strcpy(_CountUpc_F01, buf);
_set_cursor(row, 0);
printf("%s\n", _CountUpc_F01);
}
}
code used in a hand held data collector. Its purpose is to pad zeros
to the front of a scanned barcode so its length is 14 char. What I
want is for an ENTER to be suffixed so the user does not have to press
the Enter button after the scan and padding. If anyone can help me I
would be very appreciative.
char buf[16];
void _PadZero_3()
{
unsigned n;
int pos, row;
n = strlen(_CountUpc_F01);
if (n <14){
pos = _get_cursor();
row = ((pos >> 8) & 0xff) - 1;
sprintf(buf, "%014s", _CountUpc_F01);
strcpy(_CountUpc_F01, buf);
_set_cursor(row, 0);
printf("%s\n", _CountUpc_F01);
}
}