INFO
	operators - operators available in LPC

DESCRIPTION
	These are the operators availailable in LPC. They are listed in the
	order or precedence (low priority first):

	expr1 , expr2	Evaluate 'expr1' and then 'expr2'. The returned value
			is the result of 'expr2'. The returned value of 'expr1'
			is thrown away.

	var = expr	Evaluate 'expr', and assign the value to 'var'. The new
			value of 'var' is the result.

	var += expr	Assign the value of 'expr' + 'var' to 'var'. This is
			equivalente to "var = var + expr".

	var -= expr	Similar to '+=' above.
	var &= expr
	var |= expr
	var ^= expr
	var <<= expr
	var >>= expr
	var *= expr
	var %= expr
	var /= expr

	expr1 || expr2	The result is true if 'expr1' or 'expr2' is true.
			'expr2' is not evaluated if 'expr1' was true.

	expr1 && expr2	The result is true i 'expr1' and 'expr2' is true.
			'expr2' is not evaluated if 'expr1' was false.

	expr1 | expr2	The result is the bitwise or of 'expr1' and 'expr2'.

	expr1 ^ expr2	The result is the bitwise xor of 'expr1' and 'expr2'.

	expr1 & expr2	The result is the bitwise and of 'expr1' and 'expr2'.

	expr1 == expr2	Compare values. Valid for strings and numbers.

	expr1 != expr1	Compare values. Valid for strings and numbers.

	expr1 > expr2	Compare values. Valid for strings and numbers.

	expr1 >= expr2	Compare values. Valid for strings and numbers.

	expr1 < expr2	Compare values. Valid for strings and numbers.

	expr1 <= expr2	Compare values. Valid for strings and numbers.

	expr1 << expr2	Shift 'expr1' left 'expr2' bits.

	expr1 >> expr2	Shift 'expr1' right 'expr2' bits.

	expr1 + expr2	Add 'expr1' and 'expr2'. If numbers, then arithmetic
			addition is used. If one of the expressions are a
			string, then that string is concatenated with the other
			value. You can also add two arrays together which gives
			an array containing all the elements from both arrays.

	expr1 - expr2	Subtract 'expr2' from 'expr1'. Valid for numeric values
			and arrays. In the latter case an array with the
			elements from the first array where the elements also
			existing in array 2 has been excluded.

	expr1 * expr2	Multiply 'expr1' with 'expr2'.

	expr1 % expr2	The modulo operator of numeric arguments.

	expr1 / expr2	Integer division.

	++ var		Increment the value of variable 'var', and return the
			new value.

	-- var		Decrement the value of variable 'var', and return the
			new value.

	- var		Compute the negative value of 'var'.

	! var		Compute the logical 'not' of an integer.

	~ var		The boolean 'not' of an integer.

	var++		Increment the value of variable 'var', and return the
			old value.

	var--		Decrement the value of variable 'var', and return the
			old value.

	expr1[expr2]	The array given by 'expr1' is indexed by 'expr2'.

	expr1->name(...)
			 'expr1' gives either an object or a string which is
			converted to an object, and calls the function 'name'
			in this object.

Help topics available:
C_vs_LPC Lesson1 README arrays block
class3 class4 class1 class2 control_structures
for foreach function inheritance keywords
learn_lpc/ lfuns lpc_standardized mappings operators
preprocessor profezzorn_has_the_word switch things_not_to_do types
virtual while

[START|BACK ]




[ NannyMuds main page | FAQ | Contact us ]

You are guest number 173 since November 2019.
This file was last modified: June 2000.