Hi Oriol,

A small correction, void functions can indeed contain return statements, however only the word return with a semicolon after it and no actual value. This allows you to break prematurely out of a function, even if it doesn't return a value.


Kind regards,

Philip Bennefall
----- Original Message ----- From: "Oriol Gómez" <ogomez....@gmail.com>
To: "Gamers Discussion list" <gamers@audyssey.org>
Sent: Wednesday, March 24, 2010 8:01 PM
Subject: Re: [Audyssey] Bgt stuff that confuses me


I'm going to try to answer your questions:
1. Void fucntions are functions that don't return anythin gI.e: No
return statements allowed.
2. "3+5" in between quotes is going to be printed  as such.
Example:
if you say alert("3+5=8"); it's going to print exactly that. if you
said something like.
alert("hey "+3+5);
that would print 8 because you're putting it outside a string.

hth

On 3/24/10, dark <d...@xgam.org> wrote:
Hi.

Having already read through the tutorial once, I stil find myself mildly
confused on a couple of matters.

Firstly, all the stuff relating to doubled short or long intagers and bits
and bytes. I'm rather uncertain why or when I would want to use variables
such as int8, double, or short which relate to the size of bits and bytes.
Shorely, a number is a number and can be written as such?

Secondly, I'm uncertain as to the difference betwene void functions and
return result functions, and I must confess I don't follow this example:

void main()
{
int x=add_numbers(3, 5);
alert("Wow", "3 + 5 is... " + x + "!");
}
int add_numbers(int first, int second)
{
int result=first+second;


I can see that the alert will write the text string with the int x, however,
hasn't the (3 + 5), already produced the result of 8 for x?

Also, I have absolutely no idea what the business involving "int first" and
"int second" is all about, sinse how does bgt know what first and second
actually mean? it seems this function is working with a lot of intagers
which haven't been defigned successfully, but which work (I tried creating a
secript with this and it printed fine).

Any thoughts on this would be appreciated.

Btw, sinse I'm interested in rpg games (and sinse I'm not exactly
overflowing with useable sounds), I thought I'd begin by writing a basic
text box turn based combat game similar to acefire. I can't promise anything astounding, but I'm hoping it'll be a good exercise for me if nothing els,
and teach me something useful about Bgt.

Beware the grue!

Dark.
---
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.


---
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.


---
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