Differences

This shows you the differences between the selected revision and the current
version of the page.


es:kbase:variables_and_objects 2009/03/25 07:07 es:kbase:variables_and_objects 2009/03/25 07:18 current
Line 14: Line 14:
Una variable se declara utilizando la palabra clave **var** o **global**, que determina el ámbito en el que dicha variable es válida. Veremos esto mas tarde. Una variable se declara utilizando la palabra clave **var** o **global**, que determina el ámbito en el que dicha variable es válida. Veremos esto mas tarde.
-Por ahgora vamos a ignorar lo que hay en este fichero. Añade la siguiente línea de código inmediatamente después de la línea**#include "base.inc"**:+Por ahora vamos a ignorar lo que hay en este fichero. Añade la siguiente línea de código inmediatamente después de la línea**#include "base.inc"**:
<code script> <code script>
Line 20: Line 20:
</code> </code>
-** TRADUCCION EN PROGRESO POR HELLRAISER ** +Este tipo de variable simple se puede alimentar con lo que quieras en tu script, podemos probarlo fácilmente. A partir de ahora añade todos los ejemplos que vienen a continuación en tu archivo scene_init.script. Este cada vez crecerá más y se convertirá en una buena referencia en caso de que olvides algo más tarde.
- +
-Since I was speaking about the single variable type in the sense that you can feed whatever you want into your script, we can easily test it. From now on append all examples below so your scene_init.script file will grow larger and larger. It will make you a nice reference in case you forget anything later.+
<code script> <code script>
-my_variable = 1;                  // First we assign a number to our variable +mi_variable = 1;                  // Primero asignamos un número a nuestra variable 
-my_variable = my_variable * 500;  // Perform some numeric operation on it +mi_variable = my_variable * 500;  // Realizamos una operación numérica en ella 
-Game.Msg(my_variable);            // Prints out the value (a number) assigned to our variable+Game.Msg(mi_variable);            // Mostramos el valor (un número) que contiene nuestra variable
-my_variable = "Hello World";       // Now we assign a string to our variable +mi_variable = "Hola a todos";     // Ahora asignamos una cadena de texto a nuestra variable 
-Game.Msg(my_variable);            // Prints out the string we just assigned+Game.Msg(mi_variable);            // Mostramos el valor (una cadena de texto) que contiene nuestra variable
</code> </code>
 +
 +** TRADUCCION EN PROGRESO POR HELLRAISER **
If you run your test now you will see that it works and that a variable can hold whatever type you assign it. Additionally, you can change what type of value is stored in your variable at any time. Since most of you already knew this part I am moving to something more interesting: **Arrays**. If you run your test now you will see that it works and that a variable can hold whatever type you assign it. Additionally, you can change what type of value is stored in your variable at any time. Since most of you already knew this part I am moving to something more interesting: **Arrays**.
 
es/kbase/variables_and_objects.1237961240.txt.gz · Last modified: 2009/03/25 07:07 by HelLRaiseR
Recent changes RSS feed Creative Commons License Driven by DokuWiki