EnglishGermanFrenchRussianItalianSpanish
Log inRegister
 
<RetVar/IF><Var/Array>[<Var/Number>][<Var/Number>]
Post new topic This topic is locked: you cannot edit posts or make replies.
View previous topic :: View next topic
Author Message
mark_a_condren





Joined: 03 Aug 2005
Posts: 1385 on topic
Location: Newcastle - Australia
Thank you for registering your game
PostPosted: Sat, 11. Sep 10, 15:56    Post subject: <RetVar/IF><Var/Array>[<Var/Number>][<Var/Number>] Reply with quote Print

[skip] if [not]|while [not]| <RetVar/IF> = <Var/Array> [ <Var/Number> ][ <Var/Number> ]


[skip] if [not]|while [not]| = The possible 'Conditional' statements that can be used with this command.
<RetVar/IF> = Command return, with an 'if' statement used it will be TRUE (1) if condition passes or FALSE (0) if it fails, otherwise if you use a Variable it will be the value of the selected array at the selected indexes.
<Var/Array> = The required array name.
<Var/Number> = The index (element) in the required array(s).


Allows you to assign the value of a nested array element to a variable, or to create a condition or
while loop based on whether the element is set to a value or is null. A nested array is when an array element is itself an array, or in other words, one array inside another array.

Think of it like the filing system on your computer, you can have folders inside folders and you can have as many files as you want in each folder.


Example:

$array.item = $array.1 [ 2 ][ 5 ]

$array.item will be the value from $array.1 at the selected indexes, in this case, element 2 [ 2 ], sub element 5 [ 5 ].


Array exploded view,
$array.1
    - $sub.array.1
      - $sub.array.1.element.0
      - $sub.array.1.element.1

    - $sub.array.2
      - $sub.array.2.element.0
      - $sub.array.2.element.1
      - $sub.array.2.element.2
      - $sub.array.2.element.3
      - $sub.array.2.element.4
      - $sub.array.2.element.5
      - $sub.array.2.element.6

    - $sub.array.3
      - $sub.array.3.element.0
      - $sub.array.3.element.1
      - $sub.array.3.element.2
      - $sub.array.3.element.3
      - $sub.array.3.element.4
      - $sub.array.3.element.5


The position marked in yellow would indicate the position of $array.item in array $array.1. (remember, the name may be $sub.array.1, but it is in index position 0, as with $sub.array.2 is in index position 1 and $sub.array.3 is in index position 2 )


Command Location:



Back to top
View user's profile Send private message Send e-mail
X2-Illuminatus
Moderator (Deutsch)
Moderator (Deutsch)

MEDALMEDALMEDAL

Joined: 02 Apr 2006
Posts: 20390 on topic

Thank you for registering your game
PostPosted: Sat, 9. Oct 10, 17:50    Post subject: [TiP][49] 286711 Reply with quote Print

[skip] if [not]|while [not]| <RetVar/IF> = <Var/Array> [ <Var/Number> ][ <Var/Number> ]


[skip] if [not]|while [not]| = Die möglichen bedingten Anweisungen, die mit diesem Befehl genutzt werden können.
<RetVar/IF> = Rückgabewert des Befehls, mit einer 'if' Anweisung wird dieser TRUE (1) (wahr) sein, wenn die Bedingung erfüllt ist oder FALSE (0) (falsch), wenn nicht. Andernfalls, wenn eine Variable genutzt wird, wird der Wert des ausgewählten Arrays an gewählter Stelle zurückgegeben.
<Var/Array> = Der benötigte Name des Arrays.
<Var/Number> = Das Index-Element in dem/den benötigten Array(s).


Der Befehl erlaubt es den Wert eines geschachtelten Array-Elements einer Variable zuzuzweisen oder eine Bedingung oder eine while-Schleife basierend auf der Tatsache, ob dem Array ein Wert zugewiesen oder ob es null ist, zu erstellen. Ein geschachteltes Array ist ein Array-Element, das selbst ein Array ist, oder mit anderen Worten: ein Array in einem Array.

Stelle es dir wie das Ordnersystem deines Computers vor: Du kannst Ordner innerhalb von Ordnern erstellen und so viele Dateien, wie du möchtest, wiederum in jedem Ordner haben.


Beispiel:

$array.item = $array.1 [ 2 ][ 5 ]

$array.item wird der Wert von $array.1 an der ausgewählten Stelle, in diesem Fall Element 2 [ 2 ], Subelement 5 [ 5 ] sein.


auseinandergezogene Ansicht eines Arrays:
$array.1
    - $sub.array.1
      - $sub.array.1.element.0
      - $sub.array.1.element.1

    - $sub.array.2
      - $sub.array.2.element.0
      - $sub.array.2.element.1
      - $sub.array.2.element.2
      - $sub.array.2.element.3
      - $sub.array.2.element.4
      - $sub.array.2.element.5
      - $sub.array.2.element.6

    - $sub.array.3
      - $sub.array.3.element.0
      - $sub.array.3.element.1
      - $sub.array.3.element.2
      - $sub.array.3.element.3
      - $sub.array.3.element.4
      - $sub.array.3.element.5


Die gelb markierte Position würde auf die Position $array.item im Array $array.1 hinweisen. (Vergiss nicht, der Name mag zwar $sub.array.1 sein, aber es ist dennoch an der Stelle 0, genauso wie $sub.array.2 an der Stelle 1 und $sub.array.3 an der Stelle 2 sind.)


Zu finden unter:



Back to top
View user's profile Send private message Visit poster's website
Juggernaut93



MEDAL

Joined: 17 Jul 2011
Posts: 2296 on topic
Location: DeVries/Verità Accecante/Corona Ardente
Thank you for registering your game
PostPosted: Mon, 27. Aug 12, 11:01    Post subject: [39]286711 Reply with quote Print

[skip] if [not]|while [not]| <RetVar/IF> = <Var/Array> [ <Var/Number> ][ <Var/Number>]


[skip] if [not]|while [not]| = La possibile istruzione condizionale che può essere utilizzata con questo comando.
<RetVar/IF> = Il valore di ritorno del comando; se si usa un'istruzione 'if' sarà TRUE (1) se la condizione è vera o FALSE (0) in caso contrario, mentre, se usi una variabile, essa assumerà il valore dell'array selezionato agli indici specificati.
<Var/Array> = Il nome dell'array richiesto.
<Var/Number> = L'indice (l'elemento) nel/negli array richiesto/i.


Ti permette di assegnare il valore di un elemento di un array nidificato a una variabile o di creare una condizione o un loop while in base a se l'elemento è impostato su un valore o se assume valore null. Un array nidificato si ha quando l'elemento di un array è esso stesso un array o, in altre parole, quando si ha un array all'interno di un altro array.

Pensalo come se fosse il file system del tuo computer: puoi avere cartelle all'interno di altre cartelle e puoi avere quanti file tu voglia in ciascuna cartella.


Esempio:

$array.item = $array.1 [ 2 ][ 5 ]

$array.item assumerà il valore dell'$array.1 agli indici selezionati, in questo caso elemento 2 [ 2 ], sotto-elemento 5 [ 5 ].


Visione esplosa dell'array:
$array.1
    - $sub.array.1
      - $sub.array.1.element.0
      - $sub.array.1.element.1

    - $sub.array.2
      - $sub.array.2.element.0
      - $sub.array.2.element.1
      - $sub.array.2.element.2
      - $sub.array.2.element.3
      - $sub.array.2.element.4
      - $sub.array.2.element.5
      - $sub.array.2.element.6

    - $sub.array.3
      - $sub.array.3.element.0
      - $sub.array.3.element.1
      - $sub.array.3.element.2
      - $sub.array.3.element.3
      - $sub.array.3.element.4
      - $sub.array.3.element.5



La posizione marcata in giallo indica la posizione di $array.item nell'array $array.1. (Ricorda: il nome può essere $sub.array.1, ma si trova nella posizione di indice 0, così come $sub.array.2 si trova all'indice 1 e $sub.array.3 all'indice 2)


Posizione dell'istruzione nella lista:



Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic This topic is locked: you cannot edit posts or make replies.
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum
Control Panel
Login Data
The time now is Sun, 19. Nov 17, 09:01

All times are GMT + 2 Hours


Board Security

Copyright © EGOSOFT 1989-2017
Powered by phpBB © 2001, 2005 phpBB Group
Template created by Avatar & BurnIt!
Debug: page generation = 1.08872 seconds, sql queries = 17