Page 1 of 1
PRINT DATA With Macro Substitution
Posted: Thu May 08, 2014 3:38 am
by hmgchang
Dear Masters and Friends,
How to use the PRINT DATA with macro subtitution ( &) ?
Code: Select all
aLabel := { "one", "two", 1000000}
aFont := { { "Verdana", 10, "BOLD ITALIC UNDERLINE"}, ;
{ "Arial", 09, "BOLD ITALIC"}, ;
{ "Courier", 10, "BOLD"}}
FOR nLabel := 1 TO LEN( aLabel)
nRow := ( nLabel - 1) * 4
nCol := 5 + 4
cBIU := aFont[ nLabel, 3]
@ nRow, nCol PRINT T_AllToChar( aLabel[ nLabel]) ;
FONT aFont[ nLabel, 1] ;
SIZE aFont[ nLabel, 2]
&cBIU
// CENTER
NEXT
Get an compile error !
TIA
Best Rgds,
Chang
Re: PRINT DATA With Macro Substitution
Posted: Thu May 08, 2014 4:17 am
by Rathinagiri
Code: Select all
@ nRow, nCol PRINT T_AllToChar( aLabel[ nLabel]) ;
FONT aFont[ nLabel, 1] ;
SIZE aFont[ nLabel, 2] ;
&cBIU
Did you miss the ; in the third line?
Tried in a single line?
Re: PRINT DATA With Macro Substitution
Posted: Thu May 08, 2014 5:29 am
by mol
hmgchang wrote:Dear Masters and Friends,
How to use the PRINT DATA with macro subtitution ( &) ?
Code: Select all
aLabel := { "one", "two", 1000000}
aFont := { { "Verdana", 10, "BOLD ITALIC UNDERLINE"}, ;
{ "Arial", 09, "BOLD ITALIC"}, ;
{ "Courier", 10, "BOLD"}}
FOR nLabel := 1 TO LEN( aLabel)
nRow := ( nLabel - 1) * 4
nCol := 5 + 4
cBIU := aFont[ nLabel, 3]
@ nRow, nCol PRINT T_AllToChar( aLabel[ nLabel]) ;
FONT aFont[ nLabel, 1] ;
SIZE aFont[ nLabel, 2]
&cBIU
// CENTER
NEXT
Get an compile error !
TIA
Best Rgds,
Chang
Only way, I found to use variables to define bold, italic, underline was to convert @ nRow, nCol PRINT phrase to function:
Code: Select all
_HMG_PRINTER_H_PRINT ( _HMG_SYSDATA[374], nStartRow, nStartCol ,;
cFontName, nFontSize,;
nColorR, nColorG, nColorB ,;
cTextToPrint ,;
lBold, lItalic, lUnderline, lOverline ,;
.T. ,;
.T. ,;
.T. ,;
cJust )
for multilines printout:
Code: Select all
_HMG_PRINTER_H_MULTILINE_PRINT ( _HMG_SYSDATA[374], nStartRow, nStartCol ,;
nEndRow, nEndCol,;
cFontName, nFontSize,;
nColorR, nColorG, nColorB ,;
cTextToPrint ,;
lBold, lItalic, lUnderline, lOverline ,;
.T. ,;
.T. ,;
.T. ,;
cJust )
Re: PRINT DATA With Macro Substitution
Posted: Fri May 09, 2014 7:58 am
by hmgchang
Yes Mr. Diamond, I missed the colon... thks
Good suggestion Mr. Marek Olszewski and thks, I will give a try...
but should i include any file or libs ?
Re: PRINT DATA With Macro Substitution
Posted: Fri May 09, 2014 12:01 pm
by mol
Any include is required
Re: PRINT DATA With Macro Substitution
Posted: Sat May 10, 2014 4:20 am
by hmgchang
Salute for Mr. Mol...
It is working now... thks a lot...
BTW, any idea what the 3 boolean( .T.) after the lOverLine ?
PRINT DATA With Macro Substitution
Posted: Sat May 10, 2014 5:35 am
by Pablo César
hmgchang wrote:BTW, any idea what the 3 boolean( .T.) after the lOverLine ?
It's about of: <.
lcolor.>,<.
lfont.>,<.
lsize.>
According
C:\HMG.3.2\INCLUDE\i_print.ch:
_HMG_PRINTER_H_MULTILINE_PRINT ( _HMG_SYSDATA \[ 374 \] , ;
<Row> , ;
<Col> , ;
<ToRow> , ;
<ToCol> , ;
<cFontName> , ;
<nFontSize> , ;
<aColor>\[1\] , ;
<aColor>\[2\] , ;
<aColor>\[3\] , ;
<cText> , ;
<.bold.> , ;
<.italic.> , ;
<.underline.> , ;
<.strikeout.> , ;
<.lcolor.> , ;
<.lfont.> , ;
<.lsize.> , ;
<"align"> )
Re: PRINT DATA With Macro Substitution
Posted: Mon May 12, 2014 6:40 am
by hmgchang
Thanks very much mr. Cesar.
When the command print preview, it display toolbar for Save
instead of printing... but it only save to .emf ?
How about to other format or PDF ?
Pls help me...
Thks n Rgds
Chang
PRINT DATA With Macro Substitution
Posted: Mon May 12, 2014 12:35 pm
by Pablo César
hmgchang wrote:When the command print preview, it display toolbar for Save
instead of printing...
ToolBars in HMG_PREVIEW it for your own options. User decides if wants to print or just PREVIEW.
but it only save to .emf ?
In the next HMG release, we can count with others options to convert metafiles to other image format like: "BMP","JPG","GIF","TIFF","PNG".
- Screen.PNG (69.78 KiB) Viewed 5458 times
How about to other format or PDF ?
For this option, we can count with HMGHPDF it is so simple and very good library. See also an example at C:\HMG.3.2\hfcl\Samples\HMGHPDF\demo.Prg
Pls help me...
Helping in what ? Many question: many responses... you need to study deep into HMG sources. All it is in your own computer when HMG is installed. I suggest to see all HMG examples in SAMPLES folder and you will learn a lot with it.
Re: PRINT DATA With Macro Substitution
Posted: Tue May 13, 2014 5:38 am
by hmgchang
Thks Sirs,
Really the HMGHPDF is wonderful...
only the supported fonts limited .
Best Rgds
Chang