1. multi OS support
- Posted by Talvitie <smtoa at SAUNALAHTI.FI> Sep 25, 1999
- 330 views
- Last edited Sep 26, 1999
Rob, If I want my program to support both, dos32 and win32, how may I do = this? if I save the file as .exw it won't run under DOS, right? if I = save it as .ex it can't have include files named .ew and windows will = treat it as dos program, right again? what if I'd like to include Linux support too? Quess it's not possible for a single executable file but just wanted to = ask. --Talvitie
2. Re: multi OS support
- Posted by Robert Craig <rds at ATTCANADA.NET> Sep 25, 1999
- 337 views
Talvitie writes: > If I want my program to support both, dos32 and win32, > how may I do this? if I save the file as .exw it won't > run under DOS, right? You can say: ex myfile.exw No problem. The various file extensions are just conventions to let other people know the platform that the program is normally supposed to run on. If you don't supply an extension then ex will add ".ex", exw will add ".exw" and exu will add ".exu". If you do supply an extension, then it can be anything: .ex, .foo, .whatever - the interpreter will simply open the file that you name on the command line, and try to run it. Similarly, the include file extensions, .e, .ew, and .eu, are completely arbitrary - use whatever extension you like, at the risk of confusing other people or yourself. > if I save it as .ex it can't have include files named .ew > and windows will treat it as dos program, right again? You can mix and match include file names as you see fit. > what if I'd like to include Linux support too? To run on multiple platforms, a Euphoria source program must be platform-independent, or it can have: if platform()=LINUX then ... elsif platform()=DOS32 then ... etc. in some places. [In Euphoria for Linux 2.2 beta (coming soon), I've added a PLATFORM constant, that you can use instead of platform() - it's faster.] Since a *bound* program includes an interpreter for a specific platform, it will only run on that platform. Regards, Rob Craig Rapid Deployment Software http://www.RapidEuphoria.com
3. Re: multi OS support
- Posted by nieuwen at XS4ALL.NL Sep 26, 1999
- 328 views
Couldn't you internally have the platform () function handled as a constant (if statements based on the platform function can be short-circuited, btw) .. wouldn't that be better than adding another *global* constant ? (also because it uses the same name, it can be a little confusing) .. just wondering. Rob Craig wrote: > [In Euphoria for Linux 2.2 beta (coming soon), > I've added a PLATFORM constant, > that you can use instead of platform() - it's faster.] Ralf Nieuwenhuijsen [[ Email ]] nieuwen at xs4all.nl ralf_n at email.com [[ I-Seek-You ]] UIN: 9389920 [[ The Elevator ]] http://www.xs4all.nl/~nieuwen
4. Re: multi OS support
- Posted by Robert Craig <rds at ATTCANADA.NET> Sep 26, 1999
- 343 views
- Last edited Sep 27, 1999
Ralf writes: > Couldn't you internally have the platform () function handled > as a constant (if statements based on the platform function > can be short-circuited, btw) .. wouldn't that be better > than adding another *global* constant ? (also because it > uses the same name, it can be a little confusing) .. just wondering. Rob Craig wrote: >> [In Euphoria for Linux 2.2 beta (coming soon), >> I've added a PLATFORM constant, >> that you can use instead of platform() - it's faster.] I agree that it's not nice to have both platform() and PLATFORM as global symbols in misc.e. I should really have defined PLATFORM (alone) as a global constant right from the start. I'll look into optimizing calls to platform() into constant values (1,2, or 3). It's not completely trivial, since you might edit misc.e and change what platform() does, or you might create your own platform() routine that does something completely different. It would be wrong to blindly replace all calls to "platform()" with a constant. Eventually, I'll try to do a proper job of in-lining of small routines, but for now a special case optimization for platform() will let us avoid adding another global symbol (that can never be removed). Regards, Rob Craig Rapid Deployment Software http://www.RapidEuphoria.com