comp.lang.ada
 help / color / mirror / Atom feed
* ACCESS TO SYSTEM VARIABLES
@ 2011-03-07  9:34 Emile8
  2011-03-07 11:47 ` Georg Bauhaus
  2011-03-07 22:51 ` Keith Thompson
  0 siblings, 2 replies; 8+ messages in thread
From: Emile8 @ 2011-03-07  9:34 UTC (permalink / raw)


On Linux I want to know the number of lines and columns of my working
terminal. When on the command line I call by hand the system variables
$LINES and $COLUMNS, I get the right answers.

When I try to do the same from a program written in Gnat Ada 2005
(Year 2010) using the specialized package Ada.Environment_Variables,
as in the following code called from the same terminal, I get no
answer for COLUMNS and LINES as if the corresponding system variables
do not exist (I get a correct answer for PATH).


with Ada.Environment_Variables; use Ada.Environment_Variables;
with Ada.Text_Io; use Ada.Text_Io;

procedure Print_Env is
begin
Put_Line("Columns : " & Value("COLUMNS"));
Put_Line("Lines : " & Value("LINES"));
Put_Line("Path : " & Value("PATH"));
end Print_Env;


I would like to understand the reasons of this behavior. Are there
different kinds of system variables in Linux ? Those as HOME, PATH
whose values depend only on the user session and those as LINES,
COLUMNS defined for each used terminal. Is there a way in Ada to
overcome this limitation ?



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2011-03-09 18:59 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-07  9:34 ACCESS TO SYSTEM VARIABLES Emile8
2011-03-07 11:47 ` Georg Bauhaus
2011-03-07 15:32   ` Adam Beneschan
2011-03-07 20:14   ` Emile8
2011-03-07 21:32     ` Peter C. Chapin
2011-03-08 17:13       ` Emile8
2011-03-09 18:59         ` Emile8
2011-03-07 22:51 ` Keith Thompson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox