comp.lang.ada
 help / color / mirror / Atom feed
* none
  1998-08-06  0:00 help about linux console graphics jtapasai
  1998-08-06  0:00 ` Jerry van Dijk
@ 1998-08-06  0:00 ` Anonymous
  1998-08-06  0:00 ` none Anonymous
  2 siblings, 0 replies; 4+ messages in thread
From: Anonymous @ 1998-08-06  0:00 UTC (permalink / raw)


On Thu, 06 Aug 1998 10:21:32 GMT, jtapasai@my-dejanews.com wrote:

> I am learning ADA with GNAT 3.10 under Linux.
> I use the Linux console graphics done by Jerry Van Dijk. Thanks !
> Good job !
> In this package there is a procedure as follows:
> 
> gl_write(x,y:interfaces.c.int;c_string:interfaces.c.strings.char_ptr);
> where c_string is
> 
> c_string:=interfaces.c.strings.new_string("hello world !");
> 
> this procedure displays in screen at x,y position the string hello world
> I must display in screen ( in graphics mode ) not a string, but a variable
> wich has integer type.
> How can it be solved ?
> Thanks in advance.
> ...

C_String := Interfaces.C.Strings.New_String
   (Your_Integer_Type'Image (Variable_Of_Your_Integer_Type) );

'Image returns a String of minimal length for the value in base 10. The
first character of the String is a space for a non-negative value and
'-' for a negative value. So

 -1 => "-1"
-10 => "-10"
  0 => " 0"
 10 => " 10"
100 => " 100"

If you need a fixed width or another base, look at
Ada.Text_Io.Integer_Io.Put with an out parameter of type String.


Jeff Carter  PGP:1024/440FBE21
My real e-mail address: ( carter @ innocon . com )
"Hello! Smelly English K...niggets."
Monty Python & the Holy Grail

Posted with Spam Hater - see
http://www.compulink.co.uk/~net-services/spam/





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

* none
  1998-08-06  0:00 help about linux console graphics jtapasai
  1998-08-06  0:00 ` Jerry van Dijk
  1998-08-06  0:00 ` none Anonymous
@ 1998-08-06  0:00 ` Anonymous
  2 siblings, 0 replies; 4+ messages in thread
From: Anonymous @ 1998-08-06  0:00 UTC (permalink / raw)


On Thu, 06 Aug 1998 10:21:32 GMT, jtapasai@my-dejanews.com wrote:

> I am learning ADA with GNAT 3.10 under Linux.
> I use the Linux console graphics done by Jerry Van Dijk. Thanks !
> Good job !
> In this package there is a procedure as follows:
> 
> gl_write(x,y:interfaces.c.int;c_string:interfaces.c.strings.char_ptr);
> where c_string is
> 
> c_string:=interfaces.c.strings.new_string("hello world !");
> 
> this procedure displays in screen at x,y position the string hello world
> I must display in screen ( in graphics mode ) not a string, but a variable
> wich has integer type.
> How can it be solved ?
> Thanks in advance.
> ...

C_String := Interfaces.C.Strings.New_String
   (Your_Integer_Type'Image (Variable_Of_Your_Integer_Type) );

'Image returns a String of minimal length for the value in base 10. The
first character of the String is a space for a non-negative value and
'-' for a negative value. So

 -1 => "-1"
-10 => "-10"
  0 => " 0"
 10 => " 10"
100 => " 100"

If you need a fixed width or another base, look at
Ada.Text_Io.Integer_Io.Put with an out parameter of type String.


Jeff Carter  PGP:1024/440FBE21
My real e-mail address: ( carter @ innocon . com )
"Hello! Smelly English K...niggets."
Monty Python & the Holy Grail

Posted with Spam Hater - see
http://www.compulink.co.uk/~net-services/spam/





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

* Re: help about linux console graphics
  1998-08-06  0:00 help about linux console graphics jtapasai
@ 1998-08-06  0:00 ` Jerry van Dijk
  1998-08-06  0:00 ` none Anonymous
  1998-08-06  0:00 ` none Anonymous
  2 siblings, 0 replies; 4+ messages in thread
From: Jerry van Dijk @ 1998-08-06  0:00 UTC (permalink / raw)


jtapasai@my-dejanews.com wrote:

: I must display in screen ( in graphics mode ) not a string, but a variable
: wich has integer type.

Fist convert the integer value into a String with the 'Image attribute.

	S : String := Integer'Image (5);

-- 
-- Jerry van Dijk  | email: jdijk@acm.org
-- Leiden, Holland | member Team-Ada
-- Ada & Win32: http://stad.dsl.nl/~jvandyk




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

* help about linux console graphics
@ 1998-08-06  0:00 jtapasai
  1998-08-06  0:00 ` Jerry van Dijk
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: jtapasai @ 1998-08-06  0:00 UTC (permalink / raw)


I am learning ADA with GNAT 3.10 under Linux.
I use the Linux console graphics done by Jerry Van Dijk. Thanks !
Good job !
In this package there is a procedure as follows:

gl_write(x,y:interfaces.c.int;c_string:interfaces.c.strings.char_ptr);
where c_string is

c_string:=interfaces.c.strings.new_string("hello world !");

this procedure displays in screen at x,y position the string hello world
I must display in screen ( in graphics mode ) not a string, but a variable
wich has integer type.
How can it be solved ?
Thanks in advance.

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum




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

end of thread, other threads:[~1998-08-06  0:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-08-06  0:00 help about linux console graphics jtapasai
1998-08-06  0:00 ` Jerry van Dijk
1998-08-06  0:00 ` none Anonymous
1998-08-06  0:00 ` none Anonymous

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