# Escape character for printing

**URL:** <https://techcommunity.softwareag.com/t/escape-character-for-printing/79764>\
**Category:** Forum\
**Tags:** Adabas-Natural, Natural, Natural-Code-Samples\
**Created:** [December 11, 2008, 12:12pm UTC](https://techcommunity.softwareag.com/t/escape-character-for-printing/79764 "2008-12-11T12:12:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [December 11, 2008, 12:12pm UTC](https://techcommunity.softwareag.com/t/escape-character-for-printing/79764/1 "2008-12-11T12:12:54Z")

</div>

I need to use the escape character to print barcodes to a tally printer.  
How would i define and write the escape sequence, any suggestions please? Escape character : 1B (hex)

define data local  
1 #esc (A4)  
end-define  
assign #esc = ‘H"1B32’  
write (1) #esc  
end

---

<div class="post-metadata">

**Author:** ![Douglas\_Kelly](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/douglas_kelly/32/102_2.png) [@Douglas\_Kelly](https://techcommunity.softwareag.com/u/Douglas_Kelly)\
**Post date:** [December 11, 2008, 9:40pm UTC](https://techcommunity.softwareag.com/t/escape-character-for-printing/79764/2 "2008-12-11T21:40:29Z")

</div>

You’re close! Put the H’ qualifier outside the quotes…

#esc need only be 2 characters.  
assign #esc = H’1b32’

If Natural’s print management gets in the way (sometimes happens with sending special characters to the print device), try using WRITE WORK FILE 1 #ESC stuff… instead. Downside is that you have to do all the line spacing, page ejects, headings, titles yourself, but for special device output like this that’s not always a bad thing.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [April 2, 2021, 2:51pm UTC](https://techcommunity.softwareag.com/t/escape-character-for-printing/79764/3 "2021-04-02T14:51:16Z")

</div>


