[fpc-pascal] Re: set envirom variable with pascal in linux
mondrillo
mondrillo at terra.es
Wed Aug 31 08:34:42 CEST 2005
Thank's for the response, perhaps it's my arch ( amd64 ) and compiler
2.0.0, but when I execute this code say :
./sdlver
1.5426178.-248
if I execute `$sdl-config --version` output is not the same :(
1.2.8
El mar, 30-08-2005 a las 08:23 -0500, Jeff Pohlmeyer escribió:
>
> > In Bach, Perl, can do set SDL_VER=`sdl-config --version`
> > But in Pascal non have the setenv() procedure as in C :(
> > ...
> > Actualy I resolve this problem with sending the output to a file,
> and
> > then reading the file.
>
> It sounds to me like you just want a global
> variable, not an environment variable.
>
> Maybe something like this?
>
> (************************************)
> program sdlver;
>
> uses libc;
>
> type
> SDL_version = record
> major : byte;
> minor : byte;
> patch : byte;
> end;
> pSDL_version = ^SDL_version;
>
> function SDL_Linked_Version:pSDL_version; cdecl; external 'SDL';
>
> var
> SDL_VER:array[0..15] of char;
>
> begin
> with SDL_Linked_Version^ do sprintf(SDL_VER, '%d.%d.%d', [major,
> minor, patch]);
> WriteLn(SDL_VER);
> end.
> (************************************)
>
>
> Regards,
> - Jeff
>
More information about the fpc-pascal
mailing list