[futurebasic] Re: Sound Manager

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : January 2002 : Group Archive : Group : All Groups

From: Richard Goodman <bhomme@...>
Date: Sun, 27 Jan 2002 09:19:00 -0800
While were on the topic of the Sound ManagerŠ

The following statement occurs in Hommel's Sound Tutor program as modified
by Alain Pastor:

cmd  = song[index]

I am in the process of incorporating Hommel's code into Sebastian and
transforming it into a somwhat different form that is more compatible with
my approach.

I have tried to understand the above statement by looking for something
similar in the reference manual. Here is what I think is going on:

"cmd" is a variable that has been dimensioned as CHAR. I don't know what
CHAR stands for, but I believe that it is an ASCII number for a character,
e.g. 115 for the letter s. Is that correct?

"song" has been dimensioned as a STR255.

"index" is a short integer.

What I think this statement does is to PEEK the character in the song
string at the position in the string determined by "index" and put the
ASCII code for that character in the variable "cmd".

Can someone tell me if my interpretation is correct?
If I am not correct, can someone interpret the statement for me?
If my interpretation is correct, can I use the same syntax with a container?

I am storing my melodies as containers rather than strings because they are
may be longer than 255 characters.

In other words, if "song" were dimensioned as a CONTAINER would the
statement cmd  = song[index] still be valid?

TIA for any help on this.

P. S. Containers are the greatest thing since sliced bread. Thanks, Alain,
for cluing me in to them.

Richard