EnglishGermanFrenchRussianPolishItalianSpanish
Log inRegister
 
endsub
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: 1384 on topic
Location: Newcastle - Australia
Thank you for registering your game
PostPosted: Fri, 10. Sep 10, 17:36    Post subject: endsub Reply with quote Print

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
View user's profile Send private message Send e-mail
Alex Vanderbilt
Winner X3 Sektorquest


MEDALMEDAL

Joined: 04 May 2006
Posts: 2111 on topic

Thank you for registering your game
PostPosted: Sat, 2. Oct 10, 18:18    Post subject: [TiP][49] 286649 Reply with quote Print

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
View user's profile Send private message
Juggernaut93



MEDAL

Joined: 17 Jul 2011
Posts: 1789 on topic
Location: Battipaglia (SA)
Thank you for registering your game
PostPosted: Wed, 23. May 12, 14:35    Post subject: [39]286649 Reply with quote Print

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
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 Fri, 24. Oct 14, 10:26

All times are GMT + 2 Hours


Board Security

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