Spec char printing with esc
Posted in 1994
Status of special character printing problem and suggested use. Thanks to Jeff Cauhape, Alan Popiel, Stuart Kemp, and Todd Burkhardt and Charlie Hussey for their advise. The problem has evolved a bit as I have experimented and have worked with various suggestions. I have arrived at the conclusion that it is possible to control the column position of the next variable to the right by using a computed column variable e.g. print column n, "Next column data" Of course I have to compute where that column must be from the length of the escape sequences already used, but that isn't particularly difficult. the problem of the "extra line" seems to be a function of what the printer does when it gets the line with the string. It is making the determination of whether the second line is needed based apparently on the content of the string. We can suppress this printer activity with unix switches in the actual print command ( -o -dp seems to do it on the Deskjet 500 under IBM's AIX.) Unfortunately, that also causes other problems. I didn't mention in the original statement of the problem that we were also attempting to print some substitute characters (the Greek mu--the funny looking lower-case u with a tail-- for micro). Use of the -o -dp switches causes the Deskjet 500 to misrepresent the ascii character being sent to represent mu. We can probably sort that out and come up with a printer specific ascii character to generate. It will take a little more code but it should work. By the way, this all came out from the effort to implement a schema some code contributed by Informix-Denver's Steve Black who contributed it to the Colorado Informix user group's Newletter. It allows for the storage of the escape sequences in a data base table and greatly facilitate use of special representaion. With it the user can request in simple text just how certain unit description should appear. For example, if the lab people want the unit description for a test to be 10 to the third power per microliter, they can specify something English like, (e.g. 10_3_per_microliter) and our programming can recognize it and pick up the escape sequences from the data base table. Of course, we must create the code that recognizes "10_3_per_microliter" but that is a pretty fixed set of cases that and because of the data base stuff from Steve it is simply another routine within a case structure[B e.g. case unit_string when "10_3_per_microliter" call Printer_Control("SUPER_ON") returning escape_sequence, seq_length let output_string = escape_sequence clipped let accum_length = accum_length + seq_length call Print_Control("SMALL_CHAR") returning escape_sequence let output_string = output string clipped, let accum_length = accum_length + seq_length escape_sequence clipped . . . when "#_microliter" . . Printer_Control is a function that handles the data base lookup of the escape sequences and determines the length of the escape sequence. If anyone is interested in this sort of thing let us know. Thanks again to everyone who contributed