How to obtain the same value?

Asked

Viewed 44 times

1

I have a code in Delphi that is responsible for an ESC/POS communication with a matrix printer...:

var
    comando : AnsiString;
    pL, pH : AnsiString;
begin
  pL := #147; //96
  pH := #2;   //2
  comando := #29+#40+#76+pL+pH+#48+#67+#48+ #32  +#32   +#1+#72+#0+ #68+#0+#49 + hexa;

end;

I’d like to take the pH and pl values of an Edit. If the user types in Edit '147', I tried to convert it to integer. Ex:

pL := 147;

But I believe that pl := #147 and pl := 147 are different, because the command did not work the second way.

How I do this conversion?

1 answer

0


You can try it like this:

pL := Chr(StrToInt(SeuEdit.Text));

Try and tell us if it worked.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.