Guest User

Untitled

a guest
Nov 24th, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. if (printer.CheckConnection()) {
  2. int start = 0;
  3. int and = 0;
  4. CString str = CommandSendTB->Text;
  5. CString Command;
  6. byte * vvv = new byte[100];
  7.  
  8. richTextBox1->Clear();
  9.  
  10. int temp;
  11. int count = 0;
  12. int countN = CommandSendTB->Lines->Length - 1;
  13.  
  14. for (int i = 0; i < CommandSendTB->Text->Length; i++) {
  15. if (str[i] == (CString)"<") {
  16. start = i + 1;
  17. }
  18. if (str[i] == (CString)">") {
  19. and = i - start;
  20. Command = str.Mid(start, and);
  21. temp = _ttoi(static_cast<LPCTSTR>(Command));
  22. vvv[count] = temp;
  23. count++;
  24. }
  25.  
  26. if (str[i] == (CString)"n") {
  27. printer.SendComand(vvv);
  28.  
  29. for (int k = 0; k < sizeof(sim); k++) {
  30. if (sim[k] != 0) {
  31. int l = int(sim[k]);
  32. richTextBox1->Text += l + "n";
  33. }
  34. }
  35. count = 0;
  36. memset(vvv, 0, sizeof(vvv));
  37. }
  38. }
  39. }
  40. else
  41. FalseConnection();
Add Comment
Please, Sign In to add comment