silogarrett Posted October 14, 2010 Share Posted October 14, 2010 Hello Guru! The article on dot matrix printing was great! Question: How would one send commands, such as a carriage return and/or a line feed, to the printer? Mike Link to comment Share on other sites More sharing options...
AzeoTech Posted October 14, 2010 Share Posted October 14, 2010 Well, in the code provided, we opened the file with the "Text file" flag set to 1 in File.Open(). This means a carriage return / line feed pair are automatically added after every file.write(). However, in general, you can send them by using chr(13) for carriage return and chr(10) for line feed. chr() just makes a character with the given ASCII code. So, for example, if you wanted to put a tab between two values: file.write("First col" + chr(9) + "second col") 9 is the ASCII code for the tab character. Search the internet for an ASCII table for all the codes. Link to comment Share on other sites More sharing options...
silogarrett Posted October 14, 2010 Author Share Posted October 14, 2010 Got it. Thank you! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.