News : The level of daily SPAM has reached insane proportions, all registrations are now manual. I ask you to send me an e-mail (john (at) murga (dot) org), to confirm that you want me to create an account for you.


Post Reply  Post Thread 
testing presence of ML feature
Author Message
Juergen
Member
***


Posts: 81
Group: Registered
Joined: May 2007
Status: Offline
Reputation: 0
Post: #1
RE: testing presence of ML feature

There was a small bug in the previous version. This should fix it all:

Code:
function minimal_version(minimal_version)
  local x=string.gmatch((murgaLua and murgaLua.version or "0"),"%d+")
  local y=string.gmatch(minimal_version,"%d+")
  local t=function(x) return tonumber(x() or 0) end
  local version=0; local min_version=0 ; local a,b
  for i=1,3 do a,b=t(x),t(y);
    version=version*(a==0 and 1 or 100)+a
    min_version=min_version*(b==0 and 1 or 100)+b end
  if version<min_version then
    print("You must use a murgaLua version > "..minimal_version) os.exit(1) end
end

minimal_version("<>5test6.............")


Maybe this could be a little beautified.

Juergen

02-08-2008 06:13 AM
Find all posts by this user Quote this message in a reply
Post Reply  Post Thread 

Messages In This Thread
testing presence of ML feature - mikshaw - 01-20-2008, 05:37 AM
RE: testing presence of ML feature - Juergen - 02-08-2008 06:13 AM

View a Printable Version
Send this Thread to a Friend
Subscribe to this Thread | Add Thread to Favorites

Forum Jump: