Re: Missing library

new topic     » goto parent     » topic index » view thread      » older message » newer message

irv mullins wrote:

> As it stands, not even Euphoria can programatically retrieve its own 
> version, can it?
> 
> Irv
> 

Hello Irv,I think Rob posted this a while back.



------------------------Get Version Info of Euphoria--------------------- include Win32lib.ew include wildcard.e object path,key integer lp,lv,fn sequence version

with trace trace(1) path=lower(command_line()) if equal(path[1],path[2]) then

if program is bound, we don't care what version or even whether euphoria is installed or not. puts(1,"bound?") if getc(0) then end if abort(0) end if path=getenv("EUDIR") if atom(path) then path=command_line() path=lower(path[1]) lp=length(path) if lp>7 and equal(path[lp-6..lp],"exw.exe") then lp-=7 elsif lp>6 and equal(path[lp-5..lp],"ex.exe") then lp-=6 elsif lp>2 and equal(path[lp-1..lp],"eu") then untested lp-=2 else puts(1,"unknown executable\n") if getc(0) then end if abort(0) end if if lp<5 or not find(path[lp],"
/") or not equal(path[lp-3..lp-1],"bin") or not find(path[lp-4],"
/") then puts(1,"bin dir not recognised\n") if getc(0) then end if abort(0) end if path=path[1..lp-5] end if path&="
include
get.e" fn=open(path,"r") if fn=-1 then printf(1,"error opening %s\n",{path}) if getc(0) then end if abort(0) end if version=gets(fn) close(fn) lv=length(version) while find(version[lv],"\r\n") do lv-=1 end while trace(1) version=version[lv-2..lv] if not equal(version,"2.4") then printf(1,"Version is:%s\n",{version}) puts(1,"upgrade required\n") if getc(0) then end if abort(0) end if printf(1,"Euphoria Version %s\n",{version}) key=wait_key() </eucode

Johnny :)

jln }}}

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu