[fpc-pascal] Re: set envirom variable with pascal in linux

Jeff Pohlmeyer yetanothergeek at gmail.com
Tue Aug 30 15:23:39 CEST 2005


> 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20050830/768dec30/attachment.html>


More information about the fpc-pascal mailing list