Re: Future reuse of code
Roedy Green wrote:[color=blue]
> Don't be silly. Look at any C code designed to run on many platforms.
> It is riddled with macros to pull off the feat.
>
> You can do a few simple things like parse the command line, open a
> flat file in a platform independent way, but not even the size of int
> is guaranteed unless you play some games with macros.[/color]
Well, no you can't open a file in a generic way. Opening a file on a PC
is different than opening a file on a mainframe. You need a special
library to do this:
#ifdef I370
#include <lcio.h>
#endif
Which works with the SAS C compiler.
Plus, all your variables and function names need to be 8 characters or
less, AND mixed case is ignored, so VarA and VARA are the same, thanks
to the mainframe linker.
At least it was a few years ago. Things may have chnaged since then....
Roedy Green wrote:[color=blue]
> Don't be silly. Look at any C code designed to run on many platforms.
> It is riddled with macros to pull off the feat.
>
> You can do a few simple things like parse the command line, open a
> flat file in a platform independent way, but not even the size of int
> is guaranteed unless you play some games with macros.[/color]
Well, no you can't open a file in a generic way. Opening a file on a PC
is different than opening a file on a mainframe. You need a special
library to do this:
#ifdef I370
#include <lcio.h>
#endif
Which works with the SAS C compiler.
Plus, all your variables and function names need to be 8 characters or
less, AND mixed case is ignored, so VarA and VARA are the same, thanks
to the mainframe linker.
At least it was a few years ago. Things may have chnaged since then....
Comment