Topic: Strange macro behavior (1 of 7), Read 20 times
Conf: VEDIT Macro Language Support
From: John H
Date: Friday, May 21, 2004 12:03 PM

Hi,

in this little revision date macro:

http://cu2.home.comcast.net/vedit/MOD_DATE.VDM

..loaded with Reg_Load(111,"MOD_DATE.VDM",USERMACRODIR) as the last
line in my htm.cft file.

I was testing it on one of my HTML files, I came upon a strange
happening that I can't explain.

If in my file I have (!--MOD@DATE-->2004-05-20 the macro will
overwrite the date with the present date as expected.

Anyhow, as I am testing this, I changed the date to 2004-05-01 from
2004-05-21. This change is, also the only change in the file, to
trigger the file close event. When I close the file and the macro
fires, the date is being changed to 2004-05-22. If I change the date
to 2004-05-01 and then save (not firing the macro) then 'touch'
something in the file to set it as altered, then close the file the
date is changed to the anticipated date.

I'm at a complete loss of what is happening that would change the
date to 2004-05-22. At first I thought maybe it's mask related, but
then that really didn't explain anything after thinking about it.
The other thing I was thinking was maybe the macro need to unload
itself somehow like a sub-routine macro using Return(). But then I
don't quite see how that would work in with the event macro system
so I didn't pursue that angle.

I set my clock back to the 5-17-2004 and tried this again. No
problems. So it seems like for some reason the date is being
incremented a day. So, if you don't test this on 5-21-2004 then it
might not exhibit the anomaly!

Realistically I don't think this is going to be a problem for me and
my ability to use the macro but I would like to understand what's
going on.

--
John
VEDIT SN: 95651
VEDIT (DOS) Ver. 6.12.1 05/20/04
VEDIT (32-Bit) Ver. 6.12.1 05/20/04
VEDIT Pro (64-Bit) Beta Test Ver. 6.12.1 05/20/04
Windows 2000 (5.0.2195 Service Pack 4)

 


Topic: Re: Strange macro behavior (2 of 7), Read 21 times
Conf: VEDIT Macro Language Support
From: Christian Ziemski
Date: Friday, May 21, 2004 01:09 PM

On Fri, 21 May 2004 00:03:00 -0400, John H wrote:

>in this little revision date macro:
>
>http://cu2.home.comcast.net/vedit/MOD_DATE.VDM
>
>I was testing it on one of my HTML files, I came upon a strange
>happening that I can't explain.

A quick view shows a wrong command-matching:


} else {
Out_Reg(103) // route output to register 103
Date(REVERSE|NOMSG|NOCR) // get date in yyyy-mm-dd format - v6.12
Out_Ins(CLEAR) // resume console output
}


The Out_Reg(103) doesn't have a matching Out_Reg(CLEAR).

So you should change
Out_Ins(CLEAR) // resume console output
to
Out_Reg(CLEAR) // resume console output
That may not explain/solve your problem, but ...


Christian

 


Topic: Strange macro behavior (3 of 7), Read 21 times
Conf: VEDIT Macro Language Support
From: John H
Date: Friday, May 21, 2004 05:11 PM

On Fri, 21 May 2004 13:09:20 -0400 GMT, Christian Ziemski wrote:

> A quick view shows a wrong command-matching:

Teach me to cut and paste in my last waking hour! I remember doing
that just to maintain the comment..

> That may not explain/solve your problem, but ...

Fixed the typo, but not effective on the weird date replacement.

Here's what I have in the html/htm.cft files, seems all correct to
me. I just added the first and last lines here. Additionally, if
it's maybe related, I have F_E_F_Macro, 0 in u/startup.vdm, just
enabling it only in/by the cft file.

Config( F_E_F_Macro, 1,LOCAL )
Config( D_DSP_WRAP, 0,LOCAL )
Config( D_DSP_MODE, 0,LOCAL )
Config( D_E_NEWL_D_C, 0,LOCAL )
Config( D_TAB_D_C, 32,LOCAL )
Config( D_NULL_D_C, 0,LOCAL )
Config( E_EXP_TAB, 0,LOCAL )
Config( E_RETAB_BK, 0,LOCAL )
Config( E_RETAB_FILL, 0,LOCAL )
Config( E_TRIM_BK, 1,LOCAL )
Config( E_BK_FILL_C, 32,LOCAL )
Config( E_SCRL_MARG, 0,LOCAL )
Config( E_SCRL_INC, 20,LOCAL )
Config( F_OVER_MODE, 1,LOCAL )
Config( F_F_BROWSE, 1,LOCAL )
Config( F_AUTO_F_TYPE, 1,LOCAL )
Config( F_EOF_PROC, 0,LOCAL )
Config( PG_AUTO_IND, 0,LOCAL )
Config( PG_IND_INC, 4,LOCAL )
Config( PG_CASE_CONV, 0,LOCAL )
Config( PG_CONV_C, 59,LOCAL )
Config( PG_E_SYNTAX, 1,LOCAL )
Config( PG_E_TEMPLAT, 1,LOCAL )
Config( U_USER_P, 0,LOCAL )
Config( W_WORD_WRAP, 0,LOCAL )
Config( W_LF_MARG, 0,LOCAL )
Config( W_RT_MARG, 0,LOCAL )
Config_String( SYN_NAME, "html.syn",LOCAL )
Config_String( VTM_NAME, "html.vtm",LOCAL )
Config_Tab( 8;LOCAL )
Reg_Load(111,"MOD_DATE.VDM",USERMACRODIR)

--
John

 


Topic: Re: Strange macro behavior (4 of 7), Read 20 times
Conf: VEDIT Macro Language Support
From: Christian Ziemski
Date: Saturday, May 22, 2004 03:06 AM

On Fri, 21 May 2004 17:11:00 -0400, John H wrote:

>Fixed the typo, but not effective on the weird date replacement.

Does the error happen too if you are executing MOD_DATE.VDM manually
on your HTML file?

Christian

 


Topic: Strange macro behavior (5 of 7), Read 19 times
Conf: VEDIT Macro Language Support
From: John H
Date: Saturday, May 22, 2004 05:49 PM

On Sat, 22 May 2004 03:07:17 -0400 GMT, Christian Ziemski wrote:

> Does the error happen too if you are executing MOD_DATE.VDM manually
> on your HTML file?

I set the clock back to 5-21-2004 since that seemed to be part of
the equation for what ever reason.

Yes, I removed the event macro enabling and the reg_load from the
CFT and manually ran the macro.

I did get some new findings though. It appears to only occur (change
the 2004-05-01 to 2004-05-22) on the last occurrence of the tag.

My test html file had two 'tags' in it, the first was changed
correctly but the final tag became 2004-05-22.

--
John

 


Topic: Re: Strange macro behavior (6 of 7), Read 19 times
Conf: VEDIT Macro Language Support
From: Christian Ziemski
Date: Sunday, May 23, 2004 03:00 AM

On Sat, 22 May 2004 17:49:00 -0400, John H wrote:

>I did get some new findings though. It appears to only occur (change
>the 2004-05-01 to 2004-05-22) on the last occurrence of the tag.
>
>My test html file had two 'tags' in it, the first was changed
>correctly but the final tag became 2004-05-22.

I tested it with a primitive test file, but I can't replicate your
problem.

Did you check your macro with the debugger, step by step?
That often shows where to search...

Christian

 


Topic: Strange macro behavior (7 of 7), Read 18 times
Conf: VEDIT Macro Language Support
From: John H
Date: Sunday, May 23, 2004 08:16 PM

On Sun, 23 May 2004 03:00:34 -0400 GMT, Christian Ziemski wrote:

>>I did get some new findings though. It appears to only occur (change
>>the 2004-05-01 to 2004-05-22) on the last occurrence of the tag.
>>
>>My test html file had two 'tags' in it, the first was changed
>>correctly but the final tag became 2004-05-22.

> I tested it with a primitive test file, but I can't replicate your
> problem.

Hmm. Oh well. There are so many factors I guess. I thank you for
trying it out though.

> Did you check your macro with the debugger, step by step?
> That often shows where to search...

I've only used the debugger a little, and no, have not with this
macro. I've got some more reading, learning to do with the debugger
and the '??' command yet.

I'll give it a try though.

--
John