Re: Detecting the Eu version
- Posted by "Igor Kachan" <kinz at peterlink.ru> Dec 13, 2004
- 573 views
Juergen Luethje wrote: > > 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". Ok, I do understand this. > > 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. Described way, author can detect *any* concrete version of Euphoria, where his program *can not run*. Then it is just an author's problem - to stop his program with a warning message or to give user a standard crash message without any additional explanations. So, I just didn't see some "gap", as you say in the part of your message, that I have snipped off. I snipped that part, where I have nothing to say or comment, sorry, that was just usual practice, I think. Regards, Igor Kachan kinz at peterlink.ru