Re: multi OS support

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

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

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

Search



Quick Links

User menu

Not signed in.

Misc Menu