Re: Two questions about using Win32Lib

new topic     » goto parent     » topic index » view thread      » older message » newer message

Prasanta Chakraborty wrote:

> 2. How can I print formatted text in windows
> printer. I can print text using wPuts() but if
> I put TAB control character in my text, it is not
> recognised by my printer, it comes out as garbage
> character.

The print routines don't recognize tabs. If you are using fixed width
characters to print, you can use this routine to convert tabs into spaces:

-- size of the tab
constant Tab = 8

function tab_to_space( sequence s )
    sequence new
    integer at
    new = ""
    for i = 1 to length( s ) do
        if s[i] = '\t' then
            at = length( new )
            new &= repeat( ' ', (Tab) - remainder( at, Tab ) )
        else
            new &= s[i]
        end if
    end for
    return new
end function

-- David Cuny

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu