|
|
 |
View previous topic :: View next topic |
 |
|
|
|
|
Author |
Message |
|
|
|
|
|
mark_a_condren

Joined: 03 Aug 2005 Posts: 1384 on topic Location: Newcastle - Australia

|
Posted: Fri, 10. Sep 10, 17:36 Post subject: endsub |
|
|
endsub
Used in conjunction with a gosub statement.
Allows you to define the return point of the gosub statement.
Example:
write to player logbook = 1
write to player logbook = 2
gosub mix.numbers
write to player logbook = 3
write to player logbook = 4
return null
mix.numbers:
write to player logbook = 5
endsub
In this case the numbers would be written to the logbook in the following order, 1, 2, 5, 3 and 4 due to the 'gosub' causing 3 and 4 to be put after 5. After 5 was written the 'endsub' statement causes a return to immediatly below the 'gosub' statement resulting in 3 and 4 being written after 5. (5 would not be written twice due to the 'return null' being encountered)
Command Location:
|
|
|
|
|
|
|
Back to top |
|
|
|
 |
|
|
|
|
|
Alex Vanderbilt Winner X3 Sektorquest


Joined: 04 May 2006 Posts: 2103 on topic

|
Posted: Sat, 2. Oct 10, 18:18 Post subject: [TiP][49] 286649 |
|
|
endsub
Dieses Kommando wird in Verbindung mit einer gosub-Aussage verwendet. Es ermöglicht dir, den Umkehrpunkt des Skriptes festzulegen.
Beispiel:
write to player logbook = 1
write to player logbook = 2
gosub mix.numbers write to player logbook = 3
write to player logbook = 4
return null
mix.numbers:
write to player logbook = 5
endsub
In diesem Fall würden die wie folgt in das Logbuch geschrieben: 1; 2; 5; 3 und 4, da aufgrund der gosub-Anweisung von 2 zu 5 gesprungen wird, und das Skript nach dem endsub wieder zu 3 und 4 zurückkehrt. Das "return null" verhindert, dass 5 doppelt in das Logbuch geschrieben wird.
Zu finden unter:
|
|
|
|
|
|
|
Back to top |
|
|
|
 |
|
|
|
|
|
Juggernaut93

Joined: 17 Jul 2011
Location: Battipaglia (SA)
|
Posted: Wed, 23. May 12, 14:35 Post subject: [39]286649 |
|
|
endsub
Usato insieme a un'istruzione gosub.
Ti permette di definire il punto di 'return' di un'istruzione gosub.
Esempio:
write to player logbook = 1
write to player logbook = 2
gosub mix.numbers
write to player logbook = 3
write to player logbook = 4
return null
mix.numbers:
write to player logbook = 5
endsub
In questo caso i numeri sarebbero scritti nel diario di bordo nell'ordine 1, 2, 5, 3 e 4 poiché il 'gosub' fa in modo che il 3 e il 4 siano scritti dopo il 5. Dopo che il 5 è stato scritto, l'istruzione 'endsub' fa ritornare lo script immediatamente sotto l'istruzione 'gosub', con il risultato che il 3 e il 4 vengono scritti dopo il 5. (Il 5 non viene scritto due volte poiché si incontra il 'return null')
Posizione dell'istruzione nella lista:
|
|
|
|
|
|
|
Back to top |
|
|
|
 |
|
|
|
|
|
|
|
 |
|
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
|
 |
|
|
|
|
|