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

Contenido eliminado Contenido añadido
Sin resumen de edición
Sin resumen de edición
Línea 26:
 
*Declaración
[STATIC] {PUBLIC|PRIVATE} Identifier [Static array declaration] AS Datatype [=Expression]
STATIC PUBLIC GridX AS Integer
STATIC PRIVATE bGrid AS Boolean
PUBLIC Name AS String
PRIVATE Control AS Object
PRIVATE Languages AS String[] = [ "fr", "it", "es", "de", "ja" ]
PRIVATE DefaultLanguage AS String = Languages[1]
 
'''Todas las declaraciones DIM debe estar en FUNCTION o SUB antes de cualquier comando ejecutable''
DIM fTimeDiff2 AS Float
DIM iTest AS Integer
DIM iK[9] AS Integer 'ik[0] to ik[8]
DIM shX[3,3] AS Short
DIM date1 AS Date
 
[STATIC] {PUBLIC|PRIVATE} Identifier AS NEW Native Datatype [Array dimensions...]
PUBLIC CONST WORD_MAX AS Integer = 12
PRIVATE Words AS NEW String[WORD_MAX * 2]
PUBLIC Matrix AS NEW Float[3, 3]
 
*Asignación
Destination = Expression
iVal = 1972
Name = "Gambas"
hObject.Property = iVal
cCollection[sKey] = Name
 
== '''Constantes''' ==
 
{PUBLIC|PRIVATE} CONST Identifier AS Datatype = Constant value
'''Los tipos de datos de las Constantes pueden ser: Boolean, Integer, Long, Float o String''
PUBLIC CONST MAX_FILE AS Integer = 30
PRIVATE CONST DEBUG AS Boolean = TRUE
PRIVATE CONST MAGIC_HEADER AS String = "# Gambas form file"
 
== '''Operadores''' ==