Print Data Command

Moderator: Rathinagiri

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

Print Data Command

Post by Clip2Mania » Wed Jun 25, 2014 3:23 pm

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: 5181
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Has thanked: 141 times
Been thanked: 131 times
Contact:

Post by Rathinagiri » Wed Jun 25, 2014 3:54 pm

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
Been thanked: 1 time

Post by Clip2Mania » Wed Jun 25, 2014 10:02 pm

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: 5181
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Has thanked: 141 times
Been thanked: 131 times
Contact:

Post by Rathinagiri » Thu Jun 26, 2014 1:56 am

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: 1274
Joined: Tue Sep 03, 2013 4:22 am
Location: Tecámac, México
Has thanked: 1 time
Been thanked: 2 times

Post by Javier Tovar » Sun Jun 29, 2014 12:04 am

Thanks Mr. Rathinagiri by kind!

regards

Post Reply