comp.lang.ada
 help / color / mirror / Atom feed
* Re: making music
       [not found] ` <35398fdf.116942877@news.nextdim.com>
@ 1998-04-24  0:00   ` JimBOB
  1998-04-26  0:00     ` Niklas Holsti
  1998-04-26  0:00     ` Simon Wright
  0 siblings, 2 replies; 3+ messages in thread
From: JimBOB @ 1998-04-24  0:00 UTC (permalink / raw)



hello,
hopefully you can help me..
I'm writing for Linux.. or any other port!

I compiled a small body of code,

with text_io,basic_num,mcc-sounds;
use  text_io,basic_num,mcc-sounds;

procedure play_for_me is
wav:string;
begin
  put("what wav file would you like to listen to?");
  get(wav);
  Play_Sound(wav);
end play_for_me;

With a package body from ftp.usafa... I tried to get this to work, but it
tells me:

play_for_me.adb:4:27:is missing";"
play_for_me.adb:5:27:is missing";"
gnatmake:"play_for_me.adb"compilation error


Hopefully you know the package body stuff, or should I send that to?
I can't see that Im missing a ";" anywhere!

Any help will be appreciated.






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

* Re: making music
  1998-04-24  0:00   ` making music JimBOB
  1998-04-26  0:00     ` Niklas Holsti
@ 1998-04-26  0:00     ` Simon Wright
  1 sibling, 0 replies; 3+ messages in thread
From: Simon Wright @ 1998-04-26  0:00 UTC (permalink / raw)



"JimBOB" <house@theprairy> writes:

> with text_io,basic_num,mcc-sounds;
> use  text_io,basic_num,mcc-sounds;

I imagine these are the lines; should be 'mcc.sounds' in both cases.
                                    ---------^---------
I know the GNAT file name is mcc-sounds.ads!

When GNAT says

play_for_me.adb:4:27:is missing";"

it means that the point at which it's detected the error is the 27th
character of the 4th line.




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

* Re: making music
  1998-04-24  0:00   ` making music JimBOB
@ 1998-04-26  0:00     ` Niklas Holsti
  1998-04-26  0:00     ` Simon Wright
  1 sibling, 0 replies; 3+ messages in thread
From: Niklas Holsti @ 1998-04-26  0:00 UTC (permalink / raw)



JimBOB wrote:
> 
> hello,
> hopefully you can help me..
> I'm writing for Linux.. or any other port!
> 
> I compiled a small body of code,
> 
> with text_io,basic_num,mcc-sounds;
> use  text_io,basic_num,mcc-sounds;

The package name "mcc-sounds" is incorrect; Ada does not allow
a hyphen in names. Perhaps you meant "mcc_sounds" ?

(This is one of the rare cases in which the GNAT error message
is not very precise.)

> procedure play_for_me is
> wav:string;

You should also define the length of the "wav" string, ie.
constrain it with an index range such as
   wav: string (1..50);

> begin
>   put("what wav file would you like to listen to?");
>   get(wav);

You may want to modify the "get" call so that the user can enter
a string that is shorter than the total length of "wav".

Hope this helps...

- Niklas

>   Play_Sound(wav);
> end play_for_me;
> 
> With a package body from ftp.usafa... I tried to get this to work, but it
> tells me:
> 
> play_for_me.adb:4:27:is missing";"
> play_for_me.adb:5:27:is missing";"
> gnatmake:"play_for_me.adb"compilation error
> 
> Hopefully you know the package body stuff, or should I send that to?
> I can't see that Im missing a ";" anywhere!
> 
> Any help will be appreciated.




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

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

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <35397BC6.2A85CEAC@wvnet.at>
     [not found] ` <35398fdf.116942877@news.nextdim.com>
1998-04-24  0:00   ` making music JimBOB
1998-04-26  0:00     ` Niklas Holsti
1998-04-26  0:00     ` Simon Wright

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