syntax of window print

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

Post Reply
huangchenmin
Posts: 157
Joined: Mon Jun 07, 2010 2:24 am

syntax of window print

Post by huangchenmin »

Dear all
I need to print a window, so I follow the syntax to print and fail,followinf are info I got from HMG reference

Print Method
Print The Content Of a Window
Syntax:
<WindowName>.Print [ ( lPreview , ldialog , nRow , nCol , nWidth , nHeight ) ]

Syntax error occured no matter which following were used.
1. CardInfo.print cardInfo.Row,CardInfo.Col,CardInfo.Width,CardInfo.Height
hbmk2: Processing configuration: c:\hmg.3.0.34\harbour\bin\hbmk.cfg
Harbour 2.0.0 (Rev. 13372)
Copyright (c) 1999-2010, http://www.harbour-project.org/
icreader.prg(307) Error E0030 Syntax error "syntax error at 'GETPROPERTY'"
1 error
No code generated.
hbmk2: Error: Running Harbour compiler (embedded). 1
(c:\hmg.3.0.34\harbour\bin\harbour.
2. CardInfo.print(cardInfo.Row,CardInfo.Col,CardInfo.Width,CardInfo.Height)
hbmk2: Processing configuration: c:\hmg.3.0.34\harbour\bin\hbmk.cfg
Harbour 2.0.0 (Rev. 13372)
Copyright (c) 1999-2010, http://www.harbour-project.org/
icreader.prg(307) Error E0030 Syntax error "syntax error at '('"
1 error
No code generated.
hbmk2: Error: Running Harbour compiler (embedded). 1
(c:\hmg.3.0.34\harbour\bin\harbour.exe) -n2 icreader.prg /q -ic:/hmg.3.0.34/harbour/include -ic:/hmg.3.0.34//include -iJ:/ReadIC

attachment is icreader.prg
Please help!
Best Regards
Attachments
ICReader.zip
(4.3 KiB) Downloaded 199 times
User avatar
Rathinagiri
Posts: 5482
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: syntax of window print

Post by Rathinagiri »

I had seen your print function. Some of my recommendations:

1. We don't require select printer...start printpage ... end printpage sequence for window printing.
2. The method syntax should be <WindowName>.Print [ ( lPreview , ldialog , nRow , nCol , nWidth , nHeight ) ] as mentioned in the reference. So, we have to change the line calling the print method as follows:

CardInfo.print(.f., .f., 0,0,CardInfo.Width,CardInfo.Height)

Accordingly the following shall be the print function:

Code: Select all

function PTW()
   CardInfo.print(.f.,.f.0,0,CardInfo.Width,CardInfo.Height)
   return
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
huangchenmin
Posts: 157
Joined: Mon Jun 07, 2010 2:24 am

Re: syntax of window print

Post by huangchenmin »

rathinagiri wrote:I had seen your print function. Some of my recommendations:

1. We don't require select printer...start printpage ... end printpage sequence for window ...
.....CardInfo.print(.f., .f., 0,0,CardInfo.Width,CardInfo.Height)
Accordingly the following shall be the print function:

Code: Select all

function PTW()
   CardInfo.print(.f.,.f.0,0,CardInfo.Width,CardInfo.Height)
   return
I did in your way and fail.
Following are error message after compiled

hbmk2: Processing configuration: c:\hmg.3.0.34\harbour\bin\hbmk.cfg
Harbour 2.0.0 (Rev. 13372)
Copyright (c) 1999-2010, http://www.harbour-project.org/
icreader.prg(312) Error E0030 Syntax error "syntax error at '('"
1 error
No code generated.
hbmk2: Error: Running Harbour compiler (embedded). 1
(c:\hmg.3.0.34\harbour\bin\harbour.exe) -n2 icreader.prg /q -ic:/hmg.3.0.34/harbour/include -ic:/hmg.3.0.34//include -iJ:/ReadIC
User avatar
nguyenchiduc
Posts: 78
Joined: Sat Nov 13, 2010 7:27 am

Re: syntax of window print

Post by nguyenchiduc »

huangchenmin wrote:Dear all
CardInfo.print
I use Window.Print => It's OK

But <WindowName>.Print [ ( lPreview , ldialog , nRow , nCol , nWidth , nHeight ) ] => It does not work

===========

My computer at home, no printer. I have not tried window.print with a printer

I will test it on Monday next week
huangchenmin
Posts: 157
Joined: Mon Jun 07, 2010 2:24 am

Re: syntax of window print

Post by huangchenmin »

nguyenchiduc wrote:
huangchenmin wrote:Dear all
CardInfo.print
I use Window.Print => It's OK
But <WindowName>.Print [ ( lPreview , ldialog , nRow , nCol , nWidth , nHeight ) ] => It does not work
.......
I will test it on Monday next week
me 2
I use to codeing like you, and print window to pdf printer for testing..
The reason i would like to know more details about parameters is the big margins around image.
I think those parameter such as nRow、nCol、nWidth、nHeight might improve that.
or HMG print system have propertied to mangine margins.
Best Regards
Post Reply