EnglishGermanFrenchRussianPolishItalianSpanish
Log inRegister
 
<RetVar/IF> is datatyp[ <Value> ] == <Var/Script Data Type>
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: Thu, 9. Sep 10, 13:30    Post subject: <RetVar/IF> is datatyp[ <Value> ] == <Var/Script Data Type> Reply with quote Print

[skip|else] if [not]|while [not]| <RetVar/IF> is datatyp[ <Value> ] == <Var/Script Data Type>


[skip|else] 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 TRUE / FALSE as an integer.
<Value> = This is the item that is having its data type checked.
<Var/Script Data Type> = This is what <Value> is being checked against. This can be a 'datatyp' or another variable.


Returns a [TRUE] or [FALSE] depending on whether or not the data type of <Value> is equal to <Var/Script Data Type>.


Example:

(As menus can not display integers, it can be useful to know if a variable needs to have its data type changed so it can be displayed)

$number = 15 (were 15 is an integer)

if -> is datatyp[ $number ] == DATATYP_INT
| $number.string = convert number $number to string
| add custom menu item to array $menu: text = $number.string returnvalue = null
else
| add custom menu item to array $menu: text = $number returnvalue = null
end

In the above example, if $number is an integer, it will convert it to a string before adding it to the menu for display. If however it is not an integer it will just put it straight into the menu for display.

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

Note:
See at the bottom of here for a list of possible data types.


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

Thank you for registering your game
PostPosted: Tue, 28. Sep 10, 22:40    Post subject: [TiP][49] 286535 Reply with quote Print

[skip|else] if [not]|while [not]| <RetVar/IF> is datatyp[ <Value> ] == <Var/Script Data Type>


[skip|else] 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 TRUE / FALSE als ganze Zahl zurückgeben.
<Value> = Dies ist der Gegenstand, dessen Dateityp überprüft wird.
<Var/Script Data Type> = Hiermit wird <Value> verglichen. Es kann ein 'datatyp' oder eine andere Variable sein.


Gibt [TRUE] oder [FALSE] wieder, abhängig ob der Dateityp von <Value> gleich oder ungleich <Var/Script Data Type> ist.


Beispiel:

(Da Menüs keine ganzen Zahlen anzeigen können, kann es nützlich sein zu wissen, ob der Dateityp einer Variable geändert werden muss, um diese anzeigen zu lassen.)

$number = 15 (were 15 is an integer)

if -> is datatyp[ $number ] == DATATYP_INT
| $number.string = convert number $number to string
| add custom menu item to array $menu: text = $number.string returnvalue = null
else
| add custom menu item to array $menu: text = $number returnvalue = null
end

In obigem Beispiel, wenn $number eine ganze Zahl ist, wird es zu einem String konvertiert bevor es zum Menü zur Anzeige hinzugefügt wird. Wenn es jedoch keine ganze Zahl ist, wird es dem Menü sofort zur Anzeige hinzugefügt.

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

Hinweis:
Sieh dir diesen Artikel an, für eine Auflistung der möglichen Dateitypen.


Zu finden unter:



Back to top
View user's profile Send private message Visit poster's website
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. May 13, 04:25

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.11231 seconds, sql queries = 22