Page 1 of 1

Print Data Command

Posted: Wed Jun 25, 2014 3:23 pm
by Clip2Mania
The "Print Data" command is

Code: Select all

@ <Row> , <Col> PRINT [ DATA ] <xData>
    [ TO <nToRow> , <nToCol> ]
    [ FONT <cFontName> ]
    [ SIZE <nFontSize> ]
    [ BOLD ]
    [ ITALIC ]
    [ UNDERLINE ]
    [ STRIKEOUT ]
    [ COLOR <aColor> ]
    [ RIGHT | CENTER ] 
 
I can load the Fontname and Fontsize through variables (which I load from an Ini file). But what about BOLD, ITALIC, UNDERLINE and STRIKEOUT ?
Is there a way to switch those ON - other than do...case or if... then - (as Marek does in moldruk.prg)? If you want to allow all these features, this is 16 different possibilities!
Wouldn't it be easier with something like

Code: Select all

 <Row> , <Col> PRINT [ DATA ] <xData>
    [ TO <nToRow> , <nToCol> ]
    [ FONT <cFontName> ]
    [ SIZE <nFontSize> ]
    [ STYLE <aStyle>] 
    [ RIGHT | CENTER ] 
where aStyle could be an array of 4 logical flags?

Re: Print Data Command

Posted: Wed Jun 25, 2014 3:54 pm
by Rathinagiri
You can add following lines in your code and aStyle shall be aStyle[ lBold, lItalic, lUnderline, lStrikeout ] and call MYPRINT

Code: Select all

#xtranslate @ <Row> , <Col> MYPRINT [ DATA ] <cText> ;
	[ <lfont : FONT> <cFontName> ] ;
	[ <lsize : SIZE> <nFontSize> ] ;
        [ STYLE <aStyle> ];
	[ <lcolor : COLOR> <aColor> ] ;
	[ <align:CENTER,RIGHT> ] ;
	=> ;
	_HMG_PRINTER_H_PRINT ( _HMG_SYSDATA \[ 374 \] , <Row> , <Col> , <cFontName> , <nFontSize> , <aColor>\[1\] , <aColor>\[2\] , <aColor>\[3\] , <cText> , <aStyle>\[1\] , <aStyle>\[2\] , <aStyle>\[3\] , <aStyle>\[4\] , <.lcolor.> , <.lfont.> , <.lsize.> , <"align"> ) 


Re: Print Data Command

Posted: Wed Jun 25, 2014 10:02 pm
by Clip2Mania
Thanks, Rathinagiri!
Didn't know this was possible. Don't know the 'internals' of HMG yet :) . Guess I'll have to do some more "code digging' :)

Re: Print Data Command

Posted: Thu Jun 26, 2014 1:56 am
by Rathinagiri
Yes. The starting point is INCLUDE directory. :)

Re: Print Data Command

Posted: Sun Jun 29, 2014 12:04 am
by Javier Tovar
Thanks Mr. Rathinagiri by kind!

regards