Re: BGT help please.

You only should ever have one void main() line in your script.
the alert functions only takes two pieces of data, what will be displayed in the title bar, and what the dialogue box will say. These arguements are both strings. The line below might be able to help you understand a little better.
alert(string titleBar, string message);
A string is just another variable type that can hold any kind of data, letters, numbers, symbols. The best part about these types of variables is that they can be concatinated to create longer strings. Kind of like when you do 1+1, it would equal 2, but if you tried doing '"Purple "+"eggs", it' would equal "Purple eggs".
I'll write the void main loop two different ways to show you the benefits of concatinating.
//Void main, the only void main in this script.
Int apples=5;
Int mangos=4;
void main()
{//The opening left brace for our main function.
//The line below is the first alert function. We provided the following as the titleBar message, "Mangos". We then provided the following as the dialogue message, "You have "+mangos+" Mangos". This line takes three pieces of information and concatenates it into one string of information. So when it displays it will read out You have 4 Mangos. You concatenate two variables together by adding them together like so, “Hello”+” world”
alert("Mangos", "You have "+mangos+" mangos");
//Same as above, just using apples instead of mangos.
alert("Apples", "You have "+apples+" apples");
//Same as before, just using mangos and apples along with different strings to create a new message.
alert(“All fruits”, “You have a total of “+mangos+apples+” fruit in your basket”);
}//The closing brace for our main function.
//Now that we understand concatenation, let’s see if we can’t combine all three of those alert functions into one message.
Int apples=5;
Int mangos=4;
Int fruitBasket=apples+mangos;
//the only main function defined in our example.
Void main()
{//Our opening left brace for the main function.
Alert(“Fruit basket”< “You have “+mangos+” mangos. You have “+apples+” apples. All together in your basket you have “+fruitBasket+” fruits”);
}//The closing right brace to the main functions opening left-brace.

I hope this helps.

_______________________________________________
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
  • ... AudioGames . net Forum — Developers room : lukas via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : sneak via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : sneak via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : sneak via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : Ishan Dhami via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : sneak via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : Ishan Dhami via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : lukas via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : Hrvoje via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : Ishan Dhami via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : sneak via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : sneak via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : sneak via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : nibar via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : Trajectory via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : Ishan Dhami via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : Ishan Dhami via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : nibar via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : Trajectory via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : sneak via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : Ishan Dhami via Audiogames-reflector

Reply via email to