Topic: CHECKVERS.VDM: Version check in Vedit macros (1 of 7), Read 12 times
Conf: VEDIT Macro Library
From: Christian Ziemski
Date: Friday, July 09, 2004 12:16 PM


Many macros require a special version number of VEDIT.
(For example while using features of a new VEDIT, that may not be
widely spread, aka beta test)

So they need a check whether the currently running VEDIT matches some
given version requirements.

To avoid reinventing the wheel every time I wrote a macro that can be
used in other macros to do that check.



Examples:

Reg_Set(103, "6.12") Call_File(Reg_Free, "CHECKVERS.VDM")
// checks for at least version 6.12


Reg_Set(103, "6131") Call_File(Reg_Free, "CHECKVERS.VDM")
// checks for at least version 6.13.1


Reg_Set(103, "6.12 2004-07-01") Call_File(Reg_Free, "CHECKVERS.VDM")
// or
Reg_Set(103, "612 20040701") Call_File(Reg_Free, "CHECKVERS.VDM")
// check for at least version 6.12 with
// release date 2004-07-01 or later


If the requirement isn't matched it displays an error dialog like:

"This macro requires a newer version of VEDIT than you are currently
using!"
"Current version: 6122 2004-05-24"
"Required: 6.13.1"

and sets the Return_Value > 0.

On success the Return_Value is set to 0.

So for example you can use a

if (Return_Value > 0) {
// do some cleaning up
return
}

just after the above call to quit the macro in question.

----------------------------------------------------------------------------

Note: This macro uses some new features of VEDIT 6.13
(Version_Num(EXTRA) and Version_Date)

But I implemented some code to let it work with VEDIT < 6.13 too.
Due to this compatibility code the macro is now much bigger than
technically necessary.

----------------------------------------------------------------------------

The macro is available here:
http://ziemski.privat.t-online.de/vedit/macros/checkvers.vdm

Comments are welcome, as usual.


Christian

 


Topic: Re: CHECKVERS.VDM: Version check in Vedit macros (2 of 7), Read 12 times
Conf: VEDIT Macro Library
From: Ted Green
Date: Friday, July 09, 2004 12:44 PM

At 12:17 PM 7/9/2004, you wrote:
>Many macros require a special version number of VEDIT.
>(For example while using features of a new VEDIT, that may not be
>widely spread, aka beta test)
>
>So they need a check whether the currently running VEDIT matches some
>given version requirements.
>
>To avoid reinventing the wheel every time I wrote a macro that can be
>used in other macros to do that check.

It seems a bit of an overkill. A simple check is usually sufficient:

if (Version_Num < 600) {
) Get_Key("\nThis macro requires VEDIT 6.00 or later.\n",STATLINE)
Return()
}

Ted.

 


Topic: Re: CHECKVERS.VDM: Version check in Vedit macros (3 of 7), Read 12 times
Conf: VEDIT Macro Library
From: Christian Ziemski
Date: Friday, July 09, 2004 02:04 PM

On Fri, 09 Jul 2004 00:44:00 -0400, Ted Green wrote:

>It seems a bit of an overkill.

Thanks! Yes, it is. :-)

If the compatibility parts regarding versions < 6.13 are deleted (some
time after 6.13 is released), the macro would/will be *much* smaller.


>A simple check is usually sufficient:
>
>if (Version_Num < 600) {
> ) Get_Key("\nThis macro requires VEDIT 6.00 or later.\n",STATLINE)
> Return()
>}
I know, and have used that often.

But every time one has to code a (DI1()) dialog here.
Now: Reg_Set(103, "6") Call_File(Reg_Free, "CHECKVERS.VDM")

And I wanted to have more flexibility especially regarding checking
the version date. Especially when using beta versions.

So I tried that "one fits all" macro.


And most important: "Computers are helping us in solving problems we
wouldn't have without computers."

Christian

 


Topic: Re: CHECKVERS.VDM: Version check in Vedit macros (4 of 7), Read 13 times
Conf: VEDIT Macro Library
From: Ted Green
Date: Friday, July 09, 2004 02:25 PM

At 02:04 PM 7/9/2004, you wrote:
>But every time one has to code a (DI1()) dialog here.
>Now: Reg_Set(103, "6") Call_File(Reg_Free, "CHECKVERS.VDM")
>
>And I wanted to have more flexibility especially regarding checking
>the version date. Especially when using beta versions.
>
>So I tried that "one fits all" macro.

I just wanted to point out to "novice" macro writers that your macro is not a "necessity", but an "overkill". :-)

>And most important: "Computers are helping us in solving problems we
>wouldn't have without computers."

Such as our anti-spam service. :-))

Ted.

 


Topic: Re: CHECKVERS.VDM: Version check in Vedit macros (5 of 7), Read 13 times
Conf: VEDIT Macro Library
From: Christian Ziemski
Date: Friday, July 09, 2004 04:26 PM

On Fri, 9 Jul 2004 14:25:50 -0400, Ted Green wrote:

>I just wanted to point out to "novice" macro writers that
>your macro is not a "necessity", but an "overkill". :-)

That's also true, yes!


BTW: Hey, Novices, where are you??? :-)

I wonder how few users are writing here. Still.
John H. and Shane Presley seem to be the only new ones since a long
time.

I hope I'm not the reason for users not to ask questions here or to
write messages at all.
Sometimes I fear I'm writing too many messages or answering too
quickly.
But that's the "problem": VEDIT is one of my hobbies and it's fun...

So, all you other VEDIT users: Don't hesitate to use this WebBoard and
let us work together at your problems, ideas, suggestions and so on.
And let us make VEDIT even better and more powerfull than it already
is!


>>And most important: "Computers are helping us in solving problems we
>>wouldn't have without computers."
>
>Such as our anti-spam service. :-))

Judging from your big smiley that service is still running well or
even better after the good review in "Network Computing".
Very good!


Christian

 


Topic: CHECKVERS.VDM: Version check in Vedit macros (6 of 7), Read 14 times
Conf: VEDIT Macro Library
From: John H
Date: Saturday, July 10, 2004 12:42 AM

On Fri, 9 Jul 2004 16:26:47 -0400 GMT, Christian Ziemski wrote:

> BTW: Hey, Novices, where are you??? :-)

I'm lurking.. :)

> I hope I'm not the reason for users not to ask questions here or to
> write messages at all.

I have many non-computer related tasks and projects which is now
taking most of my time. I can't afford to get wrapped up into the
computer too much (as is my usual manner - one extreme to another)
for the time being so monitoring personal email, the vedit webring
(http://vedit.home.comcast.net) email account and scanning the few
mail-lists I subscribe to is my boundary for now.

--
John

 


Topic: Re: CHECKVERS.VDM: Version check in Vedit macros (7 of 7), Read 10 times
Conf: VEDIT Macro Library
From: Christian Ziemski
Date: Sunday, July 11, 2004 10:35 AM

On Sat, 10 Jul 2004 12:42:00 -0400, John H wrote:

>I have many non-computer related tasks and projects which is now
>taking most of my time. I can't afford to get wrapped up into the
>computer too much (as is my usual manner - one extreme to another)

Almost no computers? I can't imagine!
Oooh, but wait - - - yesterday my computer was never switched on!
And, do you know what? It was fine.
There really is life outside of computers!
I sometimes forget this. ;-)

Happy weekend to all readers!

Christian