logo Command in ESC POS Command Printing

2k views Asked by At

logo Command Eg:

Chr(29) + Chr(40) + Chr(76) + Chr(6) + Chr(0) + Chr(48) + Chr(69) + Chr(48) + Chr(49) + Chr(1) + Chr(2)

logo = datareader(logo)

I am storing this string in logo column in bill options table, but when I am retrieving this data and appending it using printstring += logo then it is not printing the logo.
Instead it is printing the same string as is Chr(29) + Chr(40) + Chr(76) + Chr(6) + Chr(0) + Chr(48) + Chr(69) + Chr(48) + Chr(49) + Chr(1) + Chr(2)

What is the problem?

Thank you.

1

There are 1 answers

2
Patrick Kanzler On

What Sam Axe wanted to say and what is probably your problem (you do not give much information...) is that while code and strings might look the same to you, it is not for your compiler or interpreter. Code will be executed and a string is just text.

You seem to store the text "Chr(29) + ..." in a variable that is called logo. As you wrote this is a string, so just text. Some languages have functions like "eval" that you can give strings which will be executed as code. But I would consider this bad practice, because there should be better solutions.

For example in this case you could store only the numbers of your characters and then parse them. (That means reading the numbers, translating them into characters and concatenating them.) Even better, depending on what you want to do, would probably be just storing the characters in your variable.