I have problem using
SELECT PRINTER DIALOG TO print_ok PREVIEW
which gives:
........
Error BASE/2022 Argument error: ALLTRIM
Called from ALLTRIM(0)
Called from STRZERO(743)
......
I use and propose this solution:
in HMG\SOURCE\h_controlmisc.prg add
*-----------------------------------------------------------------------------*
*
* Mkl to avoid error in printer previewrefresh
* replace strzero with this
* also replace in include\i_print.ch
*-----------------------------------------------------------------------------*
Function sstrzero ( m_num, m_len )
*-----------------------------------------------------------------------------*
private m_s, m_v
m_v:=m_num
if type('m_v')<>'N'
m_num:=0
endif
m_s:=replicate('0',m_len)+alltrim(str(m_num))
m_s:=right(m_s,m_len)
return m_s
and replace all strzero with sstrzero in HMG\SOURCE\h_controlmisc.prg and HMG\INCLUDE\i_print.ch.
Then, create obj directory under HMG and use Makehmg.bat from HMG\SOURCE
You should have new libhmg.a in HMG\Lib
After this all compiled program work fine.
HMG 3.0.40, print preview problem
Moderator: Rathinagiri
- salamandra
- Posts: 311
- Joined: Thu Jul 31, 2008 8:33 pm
- DBs Used: DBF, MySQL, SQL
- Location: Brazil
Re: HMG 3.0.40, print preview problem
Hi majkll_ns ,
I use HMG 3.0.40 and work fine for me
[]´s Salamandra
I use HMG 3.0.40 and work fine for me
Be sure that "print_ok" it´s a logical value...SELECT PRINTER DIALOG TO print_ok PREVIEW
[]´s Salamandra
There is one time in which is crucial awakening. That time is now. ( Buddha )
Re: HMG 3.0.40, print preview problem
I try that in a first place, but no result.salamandra wrote: Hi majkll_ns ,
I use HMG 3.0.40 and work fine for meBe sure that "print_ok" it´s a logical value...SELECT PRINTER DIALOG TO print_ok PREVIEW
[]´s Salamandra
print_ok (lsuccess in demos) don't have to be defined. Command create it. To be sure I put print_ok:=.t. before it.
I locate problem in strzero(). If parameter given to strzero isn't defined or is a wrong type - it generates error. If I see it good, there are two things which can cause problem: seconds() and logic to deal with printing odd and even pages. I couldn't resolve it, so I change it in a described way.
And yes, and this take me great amount of time, same code which generate problem I put in separate program, just with part for generating one page and - it work just fine! And error in application. My solution can be marked as workaround. What is real cause I don't know.
If one ever face this as I do - try proposed solution
- esgici
- Posts: 4543
- Joined: Wed Jul 30, 2008 9:17 pm
- DBs Used: DBF
- Location: iskenderun / Turkiye
- Contact:
Re: HMG 3.0.40, print preview problem
Hi
The <hmg>\SAMPLES\PRINT\filledrectangle\demo.prg has a function that achieve this task with no problem :
If you give your code segment that cause the problem we will work on it.
Regards
--
Esgici
The <hmg>\SAMPLES\PRINT\filledrectangle\demo.prg has a function that achieve this task with no problem :
Code: Select all
Procedure PrintTest4()
*------------------------------------------------------------------------------*
Local i
Local lSuccess
SELECT PRINTER DIALOG TO lSuccess PREVIEW
If lSuccess == .T.
PrintDoc()
MsgInfo('Print Finished')
EndIf
Return
*------------------------------------------------------------------------------*
Regards
--
Esgici
Viva INTERNATIONAL HMG