07-23-2012 11:26 PM
There is an array defined as:
unsigned char buf[20];
Now want to display it with the textbox control, the dispaly format is as this format: 01 1E 30 EE A0..., how to do with the control?
Thanks
David
07-24-2012 02:31 AM - edited 07-24-2012 02:33 AM
If you start from the number, you can format the string this way:
#include <ansi_c.h> static char msg[64]; static int n; static int msk1, msk2, msk3, msk4; msk1 = 0xFF; msk2 = 0xFF00; msk3 = 0xFF0000; msk4 = 0xFF000000; n = 12027; sprintf (msg, "%02X %02X %02X %02X", (n & msk4) >> 24, (n & msk3) >> 16, (n & msk2) >> 8, n & msk1);
The code above can be pasted in Interactive Execution Window and executed as is. In your program you'll have to SetCtrlVal 'msg' to the textbox.