Re: Detecting the Eu version
- Posted by "Juergen Luethje" <j.lue at gmx.de> Dec 13, 2004
- 569 views
Igor Kachan wrote: > Hi, Juergen! > > You wrote: > >> Hi all, >> >> recently Derek and Pete (L) posted here some useful code, that allows >> a program to detect the current Eu version at runtime. I think it is >> especially helpful to use such a functionality in libraries, that >> require at least a particular Eu version. >> >> Concerning Eu 2.5, it can look like this: >> }}} <eucode> >> include machine.e >> if routine_id("crash_routine") = -1 then -- crash_routine() was >> puts(1, "Euphoria 2.5 or later required." -- introduced in v2.5 >> & "\n\nPress Enter ...") >> if getc(0) then end if >> abort(1) >> end if My previous post begins with an "introduction", that ends with the word "OK". _Thereafter_ follows the description of the problem that I see. What you quoted here, is only a part of the "introduction". > There is some universal method - all ex.exes, exw.exes, exus, ec.exes etc > have the unique lengths. > > So, you can detect the version with something like to: > > }}} <eucode> > global function version(sequence name, atom EXE_Length) > name = machine_func(22, name) -- dir info > if name[1][3] = EXE_Length then > return 1 > else > return 0 > end if > end fubction > </eucode> {{{ > > [snip] > > Just pass the name of the needed interpreter and > its known length and you'll get an answer is it yours one > or no, it is not. That will not solve the problem that I described. If I had expressed myself ambiguously or otherwise unclear in my original post, please tell me what you didn't understand. Regards, Juergen -- Have you read a good program lately?