Campbell CR800 Especificações Página 113

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 324
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 112
Section 5. Program Declarations
5-3
Const
Declares symbolic constants for use in place of numeric entries.
Syntax
Const constantname = expression
Remarks
The Const statement has these parts:
Part Description
constantname Name of the constant.
expression Expression assigned to the constant. It can consist of
literals (such as 1.0), other constants, or any of the
arithmetic or logical operators.
Tip Constants can make your programs easier to modify. Unlike
variables, constants can't be changed while your program is
running.
Caution Constants must be defined before referring to them.
Const Declaration Example
The example uses Const to define PI.
Const PI = 3.141592654 'Define constant.
Dim Area, Circum, Radius 'Declare variables.
Radius = Volt( 1 ) 'Get measurement.
Circum = 2 * PI * Radius 'Calculate circumference.
Area = PI * ( Radius ^ 2 ) 'Calculate area.
Dim
Declares variables and allocates memory for the variables. In CRBasic, ALL
variables MUST be declared.
Syntax
Dim varname[([subscripts]) [, varname[([subscripts])]]
Remarks
The Dim statement has these parts:
Part Description
varname Name of a variable.
subscripts Dimensions of an array variable. You can declare multiple
dimensions.
The argument subscripts has the following syntax:
size [size, size]
In CRBasic the lowest number in a dimension is 1 not 0.
Vista de página 112
1 2 ... 108 109 110 111 112 113 114 115 116 117 118 ... 323 324

Comentários a estes Manuais

Sem comentários