Diferencia entre revisiones de «Gambas/Conceptos básicos de programación»

Contenido eliminado Contenido añadido
Sin resumen de edición
Línea 18:
 
== '''Operadores''' ==
=== '''Arithmetic Operators''' ===
A = Number + Number 'Adds two numbers
A =- Number 'Computes the opposite sign of a number. Zero is the opposite of itself
A = Number – Number 'Subtracts two numbers
A = Number * Number 'Multiplies two numbers
A = Number / Number 'Divides two numbers. A Division By Zero (#26) error will occur if the value of the number to the right of the slash is zero
A = Number ^ Power 'Raises Number to the power Power.
A = Number \ Number
A = Number DIV Number 'Computes the quotient of the two Integer numbers, truncating the result. A Division By Zero (#26) error will occur if the value of the number to the right of the backslash is zero
A = Number MOD Number 'Computes the remainder of the quotient of the two numbers. A Division By Zero (#26) error will occur if the value of the number to the right of the operator MOD is zero
 
=== '''Comparison Operators''' ===
*Aritmeticos
Number = Number 'Returns TRUE if two numbers are equal
*De Comparación
Number <> Number 'Returns TRUE if two numbers are different
*De Asignación
Number1 < Number2 'Returns TRUE if Number1 is strictly lower than Number2
Number1 > Number2 'Returns TRUE if Number1 is strictly greater than Number2
Number1 <= Number2 'Returns TRUE if Number1 is lower or equal than Number2
Number1 >= Number2 'Returns TRUE if Number1 is greater or equal than Number2
'If the result of a Comparison is assigned to an integer variable, then the result is either -1 (True) or 0 (False)
 
==='''Assignment Operators''' ===
Variable = Expression 'Direct assignment
Variable += Expression 'Assignment with addition. This is a synonymous for Variable = Variable + Expression
Variable -= Expression 'Assignment with substraction. This is a synonymous for Variable = Variable - Expression
Variable *= Expression 'Assignment with multiplication. This is a synonymous for Variable = Variable * Expression
Variable /= Expression 'Assignment with division. This is a synonymous for Variable = Variable / Expression
Variable \= Expression 'Assignment with integer division.This is a synonymous for Variable = Variable \ Expression
Variable &= Expression 'Assignment with string concatenation. This is a synonymous for Variable = Variable & Expression
Variable &/= Expression 'Assignment with path concatenation. This is a synonymous for Variable = Variable &/ Expression
 
== '''Comentar el código''' ==