Hi Nicol,

Basically, yes. However, every programming language has its own unique
way of declaring and managing variables. What I'm basically saying
that every programming language has different rules how you declare
variables, but what you wrote is the basic concept. For example, in
C++ to create an integer variable you might type
int number = 1;
which would create a new integer number variable and set its value to
1. In Visual basic .NET you might do something like
Private number As Integer = 1
which would do the same thing as above, but as you can tell Visual
Basics method of declaring a new variable is much more verbose.
However, regardless of how you create the variable they all basically
work the same. To reuse one of your own examples I might asign a
message string to a variable called msg like this
msg As String = "Hello World!"
and later pass that variable to the Sapi Speak function like
sapi.Speak(msg, 0, 0)
and of course Sapi would speak "Hellow world" alloud because that is
the string of text msg holds. A more real world answer of using
variables is something like this.

Sub AddNumbers(x As Integer, y As Integer)
    result As Integer = x+y
    textbox.Text = result
End Sub

In the sample VB .NET code above I created a simple Sub that adds two
numbers together. Since we don't know what numbers are required we
have substituted them with x and y variables. Assuming this is a
calculator program the person would enter this data which would get
stored by x and y, and then the calculation can be performed. Once
calculation completes it prints it to a simple textbox on screen.

HTH


On 11/29/10, NIcol <nicoljaco...@telkomsa.net> wrote:
> Hi Tom
> Thanks for the explanation.
> Yeah, I do know a little bit about variables from what I read in a jaws
> scripting tutorial.
> In a jaws script, if you want to declare variables you would start with the
> word var on its own line at the beginning of a script.
> Then for  an integer variable you would write the letters int and  a space
> and then give any word as a  name for the variable, as long as it  starts
> with the word int.
> For example
> Int column
> For a text string variable  you would write for example:
> str box
> If you are specifying more than 1 variable, each variable except the last
> one, must have a comma at the end.
> then to declare a variable you would write for instance:
> let column = 1
> or
> let box = "hello world"
> then to use the say string or type string  function, instead of writing the
> strings in quotes you can just put for example:
> saystring box ()
> Does it also  work like that in game programming?
>

---
Gamers mailing list __ Gamers@audyssey.org
If you want to leave the list, send E-mail to gamers-unsubscr...@audyssey.org.
You can make changes or update your subscription via the web, at
http://audyssey.org/mailman/listinfo/gamers_audyssey.org.
All messages are archived and can be searched and read at
http://www.mail-archive.com/gam...@audyssey.org.
If you have any questions or concerns regarding the management of the list,
please send E-mail to gamers-ow...@audyssey.org.

Reply via email to