Log in

View Full Version : Avisynth 2.5.8 detection/handling


tacman1123
21st September 2008, 14:47
Is there a way to programmatically check for what version of AviSynth is running? In particular, now that Max() is a built-in function, I want to make sure to not attempt to redefine it.

Something like


if Version < 2.5.8
import("minmax.avs")
endif


Of course, there is no "if/endif" structure, so this would probably need to be done with some sort of eval() or try/catch structure.

Thx,

Tac

tacman1123
21st September 2008, 14:48
Whoops! Meant to post this in "Usage", since it probably already exists (but I was poking around trying to find the latest 2.5.8 info, which is here).

J_Darnley
21st September 2008, 17:56
Try VersionNumber() and VersionString().
http://avisynth.org/mediawiki/Internal_functions/Version_functions
Use something like:
( VersionNumber()<=2.58 ) ? import("minmax.avs") : NOP()

foxyshadis
21st September 2008, 23:01
You can also include in your minmax.avsi something like

try {
max(1,1)
}
catch {
function definitions.....
}