Print Data Command

Moderator: Rathinagiri

Post Reply
User avatar
Clip2Mania
Posts: 99
Joined: Fri Jun 13, 2014 7:16 am
Location: Belgium

Print Data Command

Post 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?
User avatar
Rathinagiri
Posts: 5471
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: Print Data Command

Post 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"> ) 

East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
Clip2Mania
Posts: 99
Joined: Fri Jun 13, 2014 7:16 am
Location: Belgium

Re: Print Data Command

Post 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' :)
User avatar
Rathinagiri
Posts: 5471
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: Print Data Command

Post by Rathinagiri »

Yes. The starting point is INCLUDE directory. :)
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
Javier Tovar
Posts: 1275
Joined: Tue Sep 03, 2013 4:22 am
Location: Tecámac, México

Re: Print Data Command

Post by Javier Tovar »

Thanks Mr. Rathinagiri by kind!

regards
Post Reply