comp.lang.ada
 help / color / mirror / Atom feed
From: Jeffrey Carter <spam.jrcarter.not@spam.not.acm.org>
Subject: Re: How to use a function in a procedure call?
Date: Fri, 30 Sep 2011 12:13:44 -0700
Date: 2011-09-30T12:13:44-07:00	[thread overview]
Message-ID: <j654pf$mhg$1@tornado.tornevall.net> (raw)
In-Reply-To: <604bf6ae-4050-4d03-be4a-aab907d42162@j10g2000vbb.googlegroups.com>

On 09/30/2011 03:41 AM, Sunny wrote:
> Hi all!
> I want so set a icon to my frame. Use GtkAda. But when I use the
> Set_Icon_From_File(win,"icon.jpg");
> An Error said that "can not use function 'Set_Icon_From_File' in a
> procedure call"

As the msg indicates, Set_Icon_From_File is a function, not a procedure. While 
some languages allow you to silently discard a function result, Ada does not. So 
you must do something with the result of the function call, such as store it in 
a variable, pass it to another subprogram, or use it in an expression.

-- 
Jeff Carter
"I would never want to belong to any club that
would have someone like me for a member."
Annie Hall
41



  parent reply	other threads:[~2011-09-30 19:13 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-30 10:41 How to use a function in a procedure call? Sunny
2011-09-30 12:16 ` Dmitry A. Kazakov
2011-09-30 19:13 ` Jeffrey Carter [this message]
2011-10-01  3:53   ` Sunny
2011-10-01  5:06     ` Jeffrey Carter
replies disabled

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