HMG 3.0.40, print preview problem
Posted: Tue Mar 20, 2012 6:17 pm
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.
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.