2 array declarations, String literals, Array declarations – ElmoMC Multi-Axis Motion Controller-Maestro User Manual

Page 71

Advertising
background image

type name

argument-list , type name

type-specifier:

int

float

Examples:

int a,b // declaration global variables

function run() // begin function declaration

global int a // global variable declaration inside body of function

int c // local variable declaration in function run()

c=56

a=b+c // !!!error!!! variable b not declared in this function

a=c+17

end function // end of function declaration

5.2.1.2

Maestro

Software Manual

MAXL Program Language

MAN-MASSW (Ver. Q)

Array Declarations

An "array declaration" names the array and specifies the type and the number of its
elements. The current release of MAXL supports only global arrays.

Syntax

array-declaration:

type-specifier array-name [define-dimension]

type-specifier:

int

float

define-dimension:

integer-constant
define-dimension , integer-constant

Examples:

int a[10],b[5] // declare global arrays

int xy_positions[100, 2] // declare multi dimensional array

function run() // begin function declaration

global int a[] // global array declaration inside of function

global int xy_positions[100,2]

a[0]=56 // define value of first element

end function // end function declaration

5-9

Advertising