EnglishGermanFrenchRussianPolishItalianSpanish
Log inRegister
 
copy array <Var/Array> index <Var/Number> … <Var/Number> into array <Var/Array>
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, 18:33    Post subject: copy array <Var/Array> index <Var/Number> … <Var/Number> into array <Var/Array> Reply with quote Print

copy array <Var/Array> index <Var/Number> ... <Var/Number> into array <Var/Array> at index <Var/Number>


<Var/Array> = The name of the source array.
<Var/Number> = The first element to be copied in the source array.
<Var/Number> = The last element to be copied in the source array.
<Var/Array> = The name of the destination array.
<Var/Number> = The index in the destination array for the first copied element from the source array.


Copies the contents of the source <Var/Array> from elements <Var/Number> to <Var/Number> into the already existing destination array <Var/Array>.
The destination array must have been previously allocated large enough to hold all the elements.


Example:

$station.array = $sector get station array from sector

$station.array.size = size of array $station.array ... (for arguments sake, lets say $station.array.size = 10)

$needed.array.size = $station.array.size / 2 ... (5 = 10 / 2)

$partial.array = array alloc: size= $needed.array.size

$mid.point = $needed.array.size - 1 ... (4 = 5 - 1)(remember the first element in an array = 0 not 1, so 0, 1, 2, 3, 4 = 5 elements)

copy array $station.array index 0 ... $mid.point into array $partial.array at index 0

--------------

In the above example, $partial.array would be the first half of $station.array.
(checks for size of $station.array being greater than 1 and other needed checks have been omitted from the example for the sake of less complexity)


Command Location:

    »» General Commands
      »» Arrays
      copy array <Var/Array> index <Var/Number> ... <Var/Number> into array <Var/Array> at index <Var/Number>


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: 20260 on topic

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

copy array <Var/Array> index <Var/Number> ... <Var/Number> into array <Var/Array> at index <Var/Number>


<Var/Array> = Der Name des Quell-Arrays.
<Var/Number> = Das erste Element, das aus dem Quell-Array kopiert werden soll.
<Var/Number> = Das letzte Element, das aus dem Quell-Array kopiert werden soll.
<Var/Array> = Der Name des Ziel-Arrays.
<Var/Number> = Die Stelle im Ziel-Array, an die das erste Element des Quell-Arrays kopiert werden soll.


Kopiert den Inhalt der Quelle <Var/Array> der Elemente <Var/Number> bis <Var/Number> in das bereits existierende Ziel-Array <Var/Array>.
Das Ziel-Array muss vorher reserviert worden sein, groß genug um alle Elemente aufnehmen zu können.


Beispiel:

$station.array = $sector get station array from sector

$station.array.size = size of array $station.array ... (der Erklärung zuliebe sei $station.array.size = 10)

$needed.array.size = $station.array.size / 2 ... (5 = 10 / 2)

$partial.array = array alloc: size= $needed.array.size

$mid.point = $needed.array.size - 1 ... (4 = 5 - 1) (Vergiss nicht, dass das erste Element eines Arrays gleich 0 ist, nicht 1. Somit sind 0, 1, 2, 3, 4 = 5 elements)

copy array $station.array index 0 ... $mid.point into array $partial.array at index 0

--------------

In obigem Beispiel wäre $partial.array die erste Hälfte von $station.array.
(Überprüfungen, ob die Größe von $station.array größer als 1 ist, und andere wurden in diesem Beispiel zu Gunsten geringerer Komplexität weggelassen.)


Zu finden unter:

    »» General Commands
      »» Arrays
      copy array <Var/Array> index <Var/Number> ... <Var/Number> into array <Var/Array> at index <Var/Number>


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



MEDAL

Joined: 17 Jul 2011
Posts: 2281 on topic
Location: DeVries/Verità Accecante/Corona Ardente
Thank you for registering your game
PostPosted: Tue, 5. Feb 13, 18:31    Post subject: [39]286723 Reply with quote Print

copy array <Var/Array> index <Var/Number> ... <Var/Number> into array <Var/Array> at index <Var/Number>


<Var/Array> = Il nome dell'array sorgente.
<Var/Number> = Il primo elemento da copiare dell'array sorgente.
<Var/Number> = L'ultimo elemento da copiare dell'array sorgente.
<Var/Array> = Il nome dell'array di destinazione.
<Var/Number> = L'indice dell'array di destinazione per il primo elemento copiato dall'array sorgente.


Copia il contenuto dell'array sorgente <Var/array> dall'elemento <Var/Number> a quello <Var/Number> nell'array destinatario già esistente <Var/array>.
L'array di destinazione deve essere stato precedentemente allocato con una grandezza sufficiente a contenere tutti gli elementi.


Esempi:

$station.array = $sector get station array from sector

$station.array.size = size of array $station.array ... (supponiamo $station.array.size = 10)

$needed.array.size = $station.array.size / 2 ... (5 = 10 / 2)

$partial.array = array alloc: size= $needed.array.size

$mid.point = $needed.array.size - 1 ... (4 = 5 - 1) (ricorda che il primo elemento di un array è 0, non 1, dunque 0, 1, 2, 3, 4 = 5 elementi)

copy array $station.array index 0 ... $mid.point into array $partial.array at index 0

--------------

In questo esempio, $partial.array verrebbe a contenere la prima metà di $station.array.
(i controlli per verificare che la dimensione di $station.array sia maggiore di 1 e altri controlli necessari sono stati omessi per evitare un'eccessiva complessità)


Posizione dell'istruzione nella lista:

    »» General Commands
      »» Arrays
      copy array <Var/Array> index <Var/Number> ... <Var/Number> into array <Var/Array> at index <Var/Number>


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 Wed, 20. Sep 17, 16:37

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 = 0.52708 seconds, sql queries = 17