hmg 3.4.1 error help

HMG Unicode versions 3.1.x related

Moderator: Rathinagiri

kiritved
Posts: 9
Joined: Sun Dec 06, 2015 4:21 am

Re: hmg 3.4.1 error help

Post by kiritved »

Code: Select all

/*
hi to all
my request is to go through the test code of 47 lines 
attached below & guide me how to eliminate the error 
listed below instead of taking pain of going through 
2500 lines of code
*/
#include <hmg.ch>
REQUEST HB_GT_WIN_DEFAULT
function main
set date american
define window m0 at 0,0 height 400 width 400 main on init (my())
end window
activate window m0
retu nil
function my
if my_hi()
test()
endif
retu nil
function test
define window m1 at 50,50 height 300 width 300 
end window
activate window m1
retu nil
function my_hi
local rl
rl=.f.
if !file("c:\windows\system32\mymem.mem")
rl=.f.
else
restore from "c:\windows\system32\mymem.mem"
mdt1=ctod(enc_str(substr(z4,1,10)))
mdt2=ctod(enc_str(substr(z4,14,10)))
if date()>mdt2
rl=.f.
else
rl=.t.
endif
endif
retu rl
function enc_chr(s)
local rs
rs=chr(255-asc(s))
retu rs
function enc_str(s)
local rs,l
l=len(s)
rs=""
for i=1 to l
ks=substr(s,i,1)
rs=rs+enc_chr(ks)
next
retu rs
/*

Application Internal Error - E:\sai\err_test.exe
Terminated at: 2015-12-16 17:03:52
Unrecoverable error 9003: Too many recursive error handler calls
Called from DEFERROR(73) in source\ErrorSys.prg
Called from (b)ERRORSYS(55) in source\ErrorSys.prg
Called from DEFERROR(73) in source\ErrorSys.prg
Called from (b)ERRORSYS(55) in source\ErrorSys.prg
Called from DEFERROR(73) in source\ErrorSys.prg
Called from (b)ERRORSYS(55) in source\ErrorSys.prg
Called from DEFERROR(73) in source\ErrorSys.prg
Called from (b)ERRORSYS(55) in source\ErrorSys.prg
Called from DEFERROR(73) in source\ErrorSys.prg
Called from (b)ERRORSYS(55) in source\ErrorSys.prg
Called from DEFERROR(73) in source\ErrorSys.prg
Called from (b)ERRORSYS(55) in source\ErrorSys.prg
Called from DEFERROR(73) in source\ErrorSys.prg
Called from (b)ERRORSYS(55) in source\ErrorSys.prg
Called from DEFERROR(73) in source\ErrorSys.prg
Called from (b)ERRORSYS(55) in source\ErrorSys.prg
Called from _DEFINEWINDOW(4072) in source\h_windows.prg
Called from TEST(15) in err_test.prg
Called from MY(11) in err_test.prg
Called from (b)MAIN(5) in err_test.prg
Called from _PROCESSINITPROCEDURE(5855) in source\h_windows.prg
Called from _ACTIVATEWINDOW(5606) in source\h_windows.prg
Called from MAIN(7) in err_test.prg


*/
User avatar
andyglezl
Posts: 1461
Joined: Fri Oct 26, 2012 7:58 pm
Location: Guadalajara Jalisco, MX
Contact:

Re: hmg 3.4.1 error help

Post by andyglezl »

1.- Si sigues estándares de programación, será mas fácil para los miembros del foro leer tu código,
ya que el leer una "tira" de instrucciones a primera vista "desanima" leerlo.

2.- El código que enviaste funciona bien sin el error que comentas.
probado en HMG 3.4

3.- Mientras más información pongas en tu post, quizá más miembros puedan probarlo.
----------------------------------------------------------------------------------------------------------------------------------------
1. If you follow coding standards, it will be easier for forum members read your code,
       and that reading is a "strip" instruction at first sight "I discouraged" read.

2. The code sent works well without the error you mention.
       HMG tested 3.4

3. The more information you put in your post, perhaps more members to try.
ErrorRecursivo.jpg
ErrorRecursivo.jpg (125.73 KiB) Viewed 7665 times

Code: Select all

 #include <hmg.ch>

REQUEST HB_GT_WIN_DEFAULT

function main
	set date american
	define window m0 at 0,0 height 400 width 400 main on init (my())
	end window
	activate window m0
retu nil
*-------------------------------------------------------------
function my
	if my_hi()
		test()
	endif
retu nil
*-------------------------------------------------------------
function test
	define window m1 at 50,50 height 300 width 300 
	end window
	activate window m1
retu nil
*-------------------------------------------------------------
function my_hi
	local rl
	rl=.f.
	if !file("c:\windows\system32\mymem.mem")
		MSGINFO( "NO hay archivo .MEM" )
		rl=.f.
	else
		restore from "c:\windows\system32\mymem.mem"
		mdt1=ctod(enc_str(substr(z4,1,10)))
		mdt2=ctod(enc_str(substr(z4,14,10)))
		MSGINFO( "SI hay archivo .MEM" )
		if date()>mdt2
			rl=.f.
		else
			rl=.t.
		endif
	endif
retu rl
*-------------------------------------------------------------
function enc_chr(s)
	local rs
	rs=chr(255-asc(s))
retu rs
*-------------------------------------------------------------
function enc_str(s)
	local rs,l
	l=len(s)
	rs=""
	for i=1 to l
		ks=substr(s,i,1)
		rs=rs+enc_chr(ks)
	next
retu rs
*-------------------------------------------------------------
Andrés González López
Desde Guadalajara, Jalisco. México.
kiritved
Posts: 9
Joined: Sun Dec 06, 2015 4:21 am

Re: hmg 3.4.1 error help

Post by kiritved »

/*
hi thanks for your guideline. i am totally new to this forum.
i will pick up the norms suggested by you very soon
i request you to run following code separately,which will generate mymem.mem file in c:\windows\system32.
after generating this file if you run the program you have previously tested you will get the error mentioned by me.
i will be thankful to you , if you can check this and guide me
*/

Code: Select all

main()
function main()
	REQUEST HB_GT_WIN_DEFAULT
	set console off
	local ddt,nnum
	set date american
	set century on
	ddt=ctod("12-31-2015")
	nnum=180
	dedt=ddt+nnum
	z4=dtoc(ddt)+str(nnum,3)+dtoc(dedt)
	z4=enc_str(z4)
	save all to  c:\windows\system32\mymem.mem
	set console on
	retu .t.
function enc_chr(s)
local rs
rs=chr(255-asc(s))
retu rs
function enc_str(s)
local rs,l
l=len(s)
rs=""
for i=1 to l
ks=substr(s,i,1)
rs=rs+enc_chr(ks)
next
retu rs
User avatar
andyglezl
Posts: 1461
Joined: Fri Oct 26, 2012 7:58 pm
Location: Guadalajara Jalisco, MX
Contact:

Re: hmg 3.4.1 error help

Post by andyglezl »

If you follow coding standards,
Perdón, con lo anterior me refería a tabular el código que envias y separar cada función
con una linea de comentario (al menos) para que lo podamos leer mejor.
-------------------------------------------------------------------------------------------------
Forgiveness, with the above I meant you send the code tabular and separate each function
with a comment line (at least) so that we can read better.

Este nuevo código que envías da error de compilación,
ejecutaste y probaste este código en tu pc ?
-----------------------------------------------------------------
This new code that you send fails compilation,
you ran and you tried this code on your pc?
ErrorRecursivo2.jpg
ErrorRecursivo2.jpg (274.45 KiB) Viewed 7604 times
Aún corrigiendo ese error, no genera el archivo .MEM
Cualquier código que envíes, asegúrate de haberlo probado.

Syntax

SAVE TO <xcMemFile> [ALL [LIKE | EXCEPT <skeleton>]]

-------------------------------------------------------------------------
Even correcting that error does not generate the .MEM file
Any code that you send, be sure to trying it.

Syntax

SAVE TO <xcMemFile> [ALL [LIKE | EXCEPT <skeleton>]]



AYUDAS/HELP

\HMG\3.4\DOC\hmgdoc.htm
\HMG\3.4\HARBOUR\doc\harbour.html


viewtopic.php?f=6&t=4023&hilit=danny#p37755
Andrés González López
Desde Guadalajara, Jalisco. México.
kiritved
Posts: 9
Joined: Sun Dec 06, 2015 4:21 am

Re: hmg 3.4.1 error help

Post by kiritved »

thanks.
alternatively i resolved the error by simply typing
restore from "c:\windows\system32\mymem.mem" additive
once again thanking all of you for your efforts.
kiritved
Posts: 9
Joined: Sun Dec 06, 2015 4:21 am

help on hbformat error

Post by kiritved »

when the code is compiled with harbour it works well with out any error.
using hbformat give following error
reformatting tmp.prg (2590 lines)
<..error 3 on line 96 :enddo
what is the reason ?
where i am going wrong ?
Carlos Britos
Posts: 245
Joined: Sat Aug 02, 2008 5:03 pm

Re: help on hbformat error

Post by Carlos Britos »

kiritved wrote:when the code is compiled with harbour it works well with out any error.
using hbformat give following error
reformatting tmp.prg (2590 lines)
<..error 3 on line 96 :enddo
what is the reason ?

where i am going wrong ?
Hi
If is not exist error at compilation time, then be sure is not wrong.
hbFormat is harbour tool and is not 100% error free, you can check it at harbour forum. You have to do manually some things after the format, maybe an IF inline sentence is not well formated. Personally i prefer my own format while typing code.
Regards/Saludos, Carlos (bcd12a)
User avatar
esgici
Posts: 4543
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Contact:

Re: help on hbformat error

Post by esgici »

kiritved wrote:when the code is compiled with harbour it works well with out any error.
using hbformat give following error
reformatting tmp.prg (2590 lines)
<..error 3 on line 96 :enddo
what is the reason ?
where i am going wrong ?
Hi Kiritved

First, you are welcome aboard :)

HBFormat is a "Harbour only" utility; doesn't support HMG commands, statements.

You can temporary comment such statements in your code; and after formatting ...

And a humble request : your previous question has too long and un-formatted samples. Please keep your sample short, simple and working (SSW); or with a more common acronym: KISS ( Keep It Simple and Short).

For save format (especially indentation) of your code, you can use "Code" facility of post editor of our forum.

Happy HMG'ing :D
Viva INTERNATIONAL HMG :D
kiritved
Posts: 9
Joined: Sun Dec 06, 2015 4:21 am

Re: hmg 3.4.1 error help

Post by kiritved »

thanks for your hearty welcome.
which utility , we normally use to format hmg,3,4,2 source code ?
User avatar
esgici
Posts: 4543
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Contact:

Re: hmg 3.4.1 error help

Post by esgici »

kiritved wrote:thanks for your hearty welcome.
which utility , we normally use to format hmg,3,4,2 source code ?
No idea :(

I'm using HBFormat with with described precautions :arrow:

IMO the best way is formatting while writing, as Carlos Britos commented.

Happy HMG'ing :D
Viva INTERNATIONAL HMG :D
Post Reply